Forum Replies Created
-
AuthorPosts
-
David DuperronCustomer
@kdv77kdv
I found something quite odd but interesting, that is apparently not in line with what you mentionned here:They don’t work at all. You can read them, you can change them, but that’s all.
The “Userdata/CustomProps” dictionnary which is part of the Object3D javascript object IS changed when I manipulate my Object with puzzles, even if I do not explicitely tell my application to write the data in the object’s dictionnary.
In other words, in my Application, I create from scratch a custom dictionnary (addedObjectsDictionnary) where I import a blender created CustomProps dictionnary, name it with a new unique ID. This dictionnary is updated when I make modifications on my object (color, position, rotation, etc…), but for some reason, the “Userdata/CustomProps” dictionnary inside the 3D object is also changed!
And the reason why my objects where linked previously (I guess!) was that I did not make the “import customprops” step and simply duplicated my puzzle created dictionnary and asigned a new UID. But inside the 3D object they were still linked.
Here are two screenshots of the console log for one of my objects before and after a modification (obtained with getObjectByName, no other manipulation). And as I said, I never explicitely tell my application to write something in the Object3D object…
Before:
Hoping this is clear…?
David DuperronCustomerYes I know… I started again from scratch, using the same method I use for appending objects in the first place, to create a clone based on the same gltf file, and now it’s working! I guess this had to do with the way I was defining the custom parameters for my “cloned” objects…
for the record, the two puzzles:
the one which is working fine:
and the one which is not:
David DuperronCustomerI found something: it seems that this has to do with custom properties recovered from the original appended gltf file.
For “properly” appended objects, where the custom properties (that I store in a dictionnary) are pulled from the gltf file, everything works fine.
But for “cloned” objects, where I do not write the new objects properties from the original custom properties, but rather copy them from the cloned object, these properties seem to be linked!
Do you know how exactly these custom properties work and how are they linked/updated (if so?) from within the puzzles??David DuperronCustomerI don’t know if I can build something “simple” to reproduce this behaviour… there are a lot of procedures and puzzles involved as well as UI.
However I’ve tried to inspect the various objects to get a clue.
Attached are the console logs of three “Object3D”
The cube1 is the first one to be appended to the scene, from an original file called GENERIC_cube.gltf.
The cube2 is a second object appended from the exact same gltf, with the same parameters.
The cube3 is a duplicated object that I create by copying the parameters of the cube1 (in an internal dictionnary: gltf_file path, dimensions, rotations, etc… basically all the parameters that are originally imported with the object as customprops), using the same processus as for a new object appending (like for cube2): I get the gltf file path, append the scene, rename the objects, etc…
And for a completely unknown reason the cube2 and cube3 are linke din some way, and when I try to change some parameters on one it changes on both.
Cube1 remains untouched.
I don’t know if these json files can give us a direction to look??
Cube1
Cube2
Cube3
David- This reply was modified 1 year ago by David Duperron.
David DuperronCustomerOk… I will need to investigate deeper. Appending the same object several times works perfectly fine, but cloning causes all sorts of troubles… strange…
David DuperronCustomerYes I already used the console to have a closer look to the 3Dobjects
Everything looks separate (materials, objects) except the “geometries” which is identical for both objects (same UUID, same everything…).
Can this be causing these kind of trouble?David DuperronCustomerHi kdv,
I’m already using your “clone object” puzzle, and yes the objects in question originally come from an appended scene, but I the objects renaming and parenting to the new scene was already done, or at least i thought so…
How can I check what exactly I cloned and if the meshes and/or materials are linked in any way?
Thanks for your help again!David
David DuperronCustomerWhole tabs can be easily copied/pasted within a couple of minutes
Thanks! great tip
David DuperronCustomerGood hints, as usual… ;)
I quickly identified that this “function within a function” – local function – was not directly accessible, and as suggested copied it in a custom procedure in my puzzles.
Just had to identify that I needed to properly set the “mesh” using thegetObjectByName
function and that’s it!
Thanks again!- This reply was modified 1 year ago by David Duperron.
- This reply was modified 1 year ago by David Duperron.
David DuperronCustomerOk… and could you give me a hint or two about what I need to change or add to adapt this function to my needs??
Thanks!David DuperronCustomer@kdv77kdv I think I might already have the exact function for that, right?
function setObjectScale(mesh, factor) {
right?
Can I call this function from any other location in my puzzles using the javascript puzzle?- This reply was modified 1 year ago by David Duperron.
David DuperronCustomer:). Simple.
David DuperronCustomerThanks for the info!
These parameters have an effect indeed, but that’s not really what I was looking for.
My issue is that it looks like there is a constant number of zoom steps, whatever the distance between MinZoom and MaxZoom is, meaning that for small distance, controlling the zoom level is easier than for big distances where one mouse wheel step equals to a much greater distance. My question was: is there a way to increase the number of zoom steps depending on the MinZoom/MaxZoom distance??
Thanks for the help!David
David DuperronCustomerHaha! I should have listened my parents better I guess…
Anyway: THANK YOU! ;)David DuperronCustomerChanging the camera Object controls using javascript does not seem to have any effect:
const camera = app.scene.getObjectByName('Camera') camera.controls.orbitMaxDistance = 1500; camera.far = 3000; console.log(camera)
using the above code I change the max distance from 500 (original Blender setting) to 1500, and the far distance from 1500 to 3000 but it does not change anything in the 3D viewport…
-
AuthorPosts