- This topic has 22 replies, 2 voices, and was last updated 1 year, 1 month ago by kdv.
-
AuthorPosts
-
2023-10-30 at 5:48 pm #68075David DuperronCustomer
Hi!
I would like to make copies of existing objects in my scene, but completely unlinked to their original.
I have already tried using the clone Object puzzle, but it seams that there is a link remaining whatever I am doing (renaming the object, assigning a new material to the new object…).
This link affects materials, clic events, etc…
Anyone has a clue on how to perform this “full copy”?
ThanksDavid
2023-10-30 at 6:11 pm #68076kdvParticipantThis link affects … click events
Looks like you clone an empty (or appended scene) with meshes as children. In this case the empty (scene) is cloned and renamed but children are not renamed (although they are cloned too). You should clone meshes themselves. As for unique materials for clones you can use this puzzle.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-30 at 6:31 pm #68077David 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
2023-10-30 at 6:38 pm #68078kdvParticipantHow can I check what exactly
You can use the console log for debugging…
materials are linked in any way?
No. With the
materials
option enabled
they can be independent like here.Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-30 at 6:44 pm #68079David 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?2023-10-30 at 6:48 pm #68081kdvParticipantexcept the “geometries” which is identical for both objects
That’s normal. Clones share the same geometry.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-30 at 7:31 pm #68082David DuperronCustomerOk… I will need to investigate deeper. Appending the same object several times works perfectly fine, but cloning causes all sorts of troubles… strange…
2023-10-30 at 8:05 pm #68083kdvParticipantMeshes from appended scenes have nothing common except names. Clones by default share practically all parameters of their original except names. Two big differencies.
Create a simple demo reproducing this issue and attach it here.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-31 at 2:03 pm #68089David 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, 1 month ago by David Duperron.
2023-10-31 at 2:38 pm #68093kdvParticipantShow the complete puzzles set that appends scenes and the one that clones objects.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-31 at 4:11 pm #68094David 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??2023-10-31 at 4:16 pm #68095kdvParticipanthow exactly these custom properties work and how are they linked/updated (if so?) from within the puzzles??
They don’t work at all. You can read them, you can change them, but that’s all. The proplem is 146% in your logic. No puzzles – no answers.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-31 at 5:01 pm #68096David 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:
2023-10-31 at 5:20 pm #68097kdvParticipantSee no cloning at all, only appended scenes
Cloning with puzzles looks a little different…
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-10-31 at 6:27 pm #68100kdvParticipantdeleted…
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
-
AuthorPosts
- You must be logged in to reply to this topic.