We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Make Unique and independent copies of Objects

Home Forums Puzzles Make Unique and independent copies of Objects

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #68075
    David Duperron
    Customer

    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”?
    Thanks

    David

    #68076
    kdv
    Participant

    This 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.

    #68077
    David Duperron
    Customer

    Hi 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

    #68078
    kdv
    Participant

    How 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.

    #68079
    David Duperron
    Customer

    Yes 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?

    #68081
    kdv
    Participant

    except 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.

    #68082
    David Duperron
    Customer

    Ok… I will need to investigate deeper. Appending the same object several times works perfectly fine, but cloning causes all sorts of troubles… strange… :wacko:

    #68083
    kdv
    Participant

    Meshes 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.

    #68089
    David Duperron
    Customer

    I 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

    #68093
    kdv
    Participant

    Show 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.

    #68094
    David Duperron
    Customer

    I 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??

    #68095
    kdv
    Participant

    how 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.

    #68096
    David Duperron
    Customer

    Yes 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:

    #68097
    kdv
    Participant

    See no cloning at all, only appended scenes :scratch:

    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.

    #68100
    kdv
    Participant

    deleted…

    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.

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.