Forum

questions on setting parent on the fly[solved]

14 December 2015 12:27
Hello.
I have a scene to showcase a few models. I used button object to launch a animation on a empty. I parented all models to the empty and hidden them. When i click on a button the object is shown is animated with the empty wich is parent and then hidden again.

Is there a way of animating the buttons by parenting the one that is clicked to an empty and unparenting it at the end of the animation. In the node editor would be best but maybe it has to be javascript?
15 December 2015 11:54
Hello.

it has to be javascript?

I think, yes.

Could you tell me about your button? Is it a scene object or html-element?

If it's a scene object, you can use the constrain module to parent your button-object to animated object.
15 December 2015 17:47
It's a scene object. It's clickable buttons that trigger animations. I would like to animated the fact that it's pressed by moving it on it's X local axis.
I was thinking of animating an empty and when i click one of the buttons i parent it to the empty a launch the "press" animation.
I use something similar with the object that are animated by showing the selected one. But it always is the empty that is really animated the objects just follow because they are parented.
I'm not sure i'm very clear…

Also i was wondering how do i add a .JS file (obviously i can do that ) and make blender be aware of it when i export the scene???
Do i have to add the link in the HTML file every time???
15 December 2015 19:13
Hello.
Also i was wondering how do i add a .JS file (obviously i can do that ) and make blender be aware of it when i export the scene???
Do i have to add the link in the HTML file every time???
You don't need to aware Blender about JavaScript code. When you prepared and exported some assets, you have to process them in your application, which consists of html and js files.
The best approach for creating a new project is to use Project Manager. It will do all dirty work for you.
Here is a video by Will Welker. He uses such an approach here.
15 December 2015 20:13
In deed. It's just that i hadn't asked for startup files. I'l start again then!
 
Please register or log in to leave a reply.