How to save a "Default" kay-frame animation with a digital asset?

   2018   2   1
User Avatar
Member
39 posts
Joined: Feb. 2016
Offline
Hi,

I've created a digital asset for an explosion, it simply hides the pyro simulation network and exposes simple parameters such as buoyancy, smoke dissipation. I want to allow the asset users customize some animation curves such as “gasrelease” (which is defined in the pyro solver). This seems problematic because:

a-If I keep the animation inside the digital asset network, then this animation curve is considered part of the digital asset and it will be locked by default. The only way to edit the curve would be to unlock the digital asset and save the file, but this is bad because users might save the new asset definition and replace the default one, plus it's not practical to ask users to unlock the asset each time they want to edit it!

b-If I keep the animation as an external new parameter (i.e. use the type interface to add a new parameter and add the animation curve to it), for some unknown reasons it won't get saved as part of the digital asset definition! i.e. even If create a new parameter and create some key frames then save the asset type, the next time I create a new instance of the asset the animation curve will be lost, i.e. will be constant value…

Okay, I am not sure what I am doing wrong, but this seems like an easy thing to do but yet I cannot accomplish! All, what I want to do is to create an initial animation curve for the gas released parameters and then allow users to change it if they wish?

Thanks
User Avatar
Member
8588 posts
Joined: July 2007
Online
you can create a null with some spare parms inside of your asset, which will hold default animations for whatever
then create OnCreated python script module for your asset that will get your parm from asset UI and gets a templateparm from inside which holding the curve and does something like:
parm.setKeyframes(templateparm.keyframes())

so every time you create fresh copy of your asset it will create the parm at default non-animated value, but then the OnCreated script kicks in and sets up the curve for you, so it will look like the node came with the curve in the UI by default
Edited by tamte - April 10, 2017 20:27:37
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
39 posts
Joined: Feb. 2016
Offline
Thanks Tomas! This is exactly what I want.

Thanks…
Edited by catchyid - April 12, 2017 14:48:07
  • Quick Links