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.

Animating cloned objects

Home Forums Programming Animating cloned objects

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #64405
    huib
    Customer

    Hello
    I want to clone an animated cube with its animation working but the cloning function still seems to get rid of the animation clip. (bugged or intentional not a feature?)
    kdv Solution seems to work nicely but I don’t understand how and where to implement this. Is it possible to share how you did this?

    #64414
    kdv
    Participant

    but I don’t understand how and where to implement this

    That code above should be used inside the cloneObject() function that can be found in puzzles.min.js

    Or you can use this plugin which includes the modified puzzle.

    Verge3D tools plugin

    Puzzles and JS. 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 meaning at all.

    #64416
    huib
    Customer

    but I don’t understand how and where to implement this

    That code above should be used inside the cloneObject() function that can be found in puzzles.min.js

    Or you can use this plugin which includes the modified puzzle.

    Verge3D tools plugin

    Hey thanks for the quick reply!
    How to change the code in the minified javascript is a bit beyond my skills.
    The code looks a lot different than the snippet you posted here earlier.
    I cant really find in the documentation anything about how this is done, it’s might be very obvious to a programmer used to this kind of work haha.

    Will also look into the plugin with the additional puzzles thanks :)

    • This reply was modified 10 months, 2 weeks ago by huib.
    • This reply was modified 10 months, 2 weeks ago by huib.
    #64419
    kdv
    Participant

    If you open visual_logic.js you can find this function (initially it’s in puzzles.min.js)

    In that function you can add this JS code to clone an object’s animation.

        const objAnim = v3d.SceneUtils.getAnimationActionByName(app, objName);
        if (objAnim) {
            const newAnim = app.mixer.clipAction(objAnim._clip.clone(), newObj, objAnim.blendMode);
            newAnim._clip.name = newObj.name;
            newAnim._localRoot = objAnim._localRoot;
            app.actions.push(newAnim);
        }

    Once it works you can transfer this code into puzzles.min.js if needed.

    Puzzles and JS. 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 meaning at all.

    #64612
    huib
    Customer

    Great thanks for explaining managed to get it to work.
    We also picked up the plugin, works great. The javascript puzzle is also a great addition.

    #64613
    kdv
    Participant

    The javascript puzzle is also a great addition.

    That’s the best puzzle with no limitations )))

    Puzzles and JS. 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 meaning at all.

    #65369
    saurav
    Participant

    Hi,
    I have opened the puzzle.min.js file to search for the cloneObject function, but it is appearing in a different format, which you can see in the image attached here.

    Do I need to download some specific software or application to view it in the format that are visible in your solutions above?

    Attachments:
    You must be logged in to view attached files.
    #65371
    kdv
    Participant

    You see the same function but as a single line. EOL is replaced by \n

    Puzzles and JS. 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 meaning at all.

    #72031
    c4cc
    Participant

    Apparently this is due to a bug in Verge3D. We’ll try to fix this ASAP. Thanks for reporting!

    Is this clone animation bug fixed?

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.