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.

clone animation to cloned object

Home Forums Puzzles clone animation to cloned object

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #66694
    saurav
    Participant

    I made a scene in which a cube is moving back and forth on the x axis. This is done in blender using keyframes.
    Then I made a clone of this cube in verge 3D using clone object puzzle, but I want to clone the animation of my cube as well and give it to this cloned object.

    Any idea how I can achieve this?

    #66695
    kdv
    Participant

    Any idea how I can achieve this?

    This way or this way

    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.

    #66696
    saurav
    Participant

    I have added the suggested lines in the visual_logic.js as per the first link that you shared but it is still not working.

    I have attached the screenshot of my function after adding the suggested code lines. Please have a look and point my mistake if any.

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

    This code should be added 2 lines upper, before
    appInstance.scene.add(newObj);
    And this code doesn’t play the cloned clip automatically, just clones.

    Add this piece of code for auto-playing

          if (objAnim._mixer._isActiveAction(objAnim))
            newAnim.play();

    before
    app.actions.push(newAnim);

    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.

    #66700
    saurav
    Participant

    Whenever I am adding the clone object puzzle and then ‘Save’ & ‘Play’ in the puzzle editor to see if the animation is getting cloned as well or not, my visual_logic.js file gets reset.

    You said to add this in the puzzle_min.js file as well but in my directory it is not visible.
    I have attached the screenshot of my directory as well.

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

    Whenever I am adding the clone object puzzle and then ‘Save’ & ‘Play’ in the puzzle editor to see if the animation is getting cloned as well or not, my visual_logic.js file gets reset.

    It won’t wotk in the puzzles editor (visual_logic.js is not used when in puzzles). After manual changing in visual_logic.js run the app itself to see how it works.

    puzzles.min.js is located in the Verge3D installation directory.

    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.

    #66703
    saurav
    Participant

    Actually when I run the app as soon as I made this change in visual_logic.js what I saw was my original cube moving back and forth, but there was no clone cube, and so I went to the puzzle editor to see why despite adding clone object puzzle there is no clone of the cube present in my running app.

    Because my end Goal is to see at least one more cube which is cloned and also has the cloned animation of the original cube.

    And will I have to add these code lines in puzzle_min.js while following that ‘\n’,’\t’ required format?

    #66704
    kdv
    Participant

    There is no need to use Tab \t. You just need to replace every EOL (end of line) with \n manually.

    Instead of a multi-line text

    functionOne();
    
    if (condition)
      functionTwo();

    you will get one line
    functionOne();\n\nif (condition)\n functionTwo();\n

    Actually when I run the app as soon as I made this change in visual_logic.js what I saw was my original cube moving back and forth, but there was no clone cube

    Actually, if you really added the “clone object” puzzle and saved puzzles after that you must see at least a static clone…

    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.

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