- This topic has 7 replies, 2 voices, and was last updated 1 year, 3 months ago by kdv.
-
AuthorPosts
-
2023-09-08 at 10:25 am #66694sauravParticipant
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?
2023-09-08 at 10:29 am #66695kdvParticipantAny idea how I can achieve this?
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-09-08 at 11:03 am #66696sauravParticipantI 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.2023-09-08 at 11:23 am #66698kdvParticipantThis 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 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-09-08 at 11:37 am #66700sauravParticipantWhenever 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.2023-09-08 at 11:40 am #66702kdvParticipantWhenever 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 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-09-08 at 12:10 pm #66703sauravParticipantActually 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?
2023-09-08 at 12:16 pm #66704kdvParticipantThere 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 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.