Relative Path in Python

   3041   4   0
User Avatar
Member
79 posts
Joined: March 2016
Offline
Hello,

Inside an asset I have a ‘render’ button to bake animations. As expected I want to be able to press this button without having to ‘allow editing of contents’ of this asset.
Since dragging and dropping the render button to the Type Properties doesn't work for me, I wanted to make a solid execute button by using python.

So I came along the following line:

kwargs['/obj/MY_ASSET/ropnet1/bake/'].parmTuple('execute').set(1)

My question would be, how can I make this first path in the kwargs line procedural, of direct from the main asset node itself into the ropnet?

Thanks in advance,
Chris
https://www.youtube.com/@Klonkel
User Avatar
Member
106 posts
Joined: June 2011
Offline
Why isn't Type Properties working for you ? Did you try this ? Go to Type Properties -> Parameters -> From Nodes (in create parameters)choose the parameter from your embedded node and click on the Arrow or drag/drop to the parameters list to promote it on the asset parameter.

If that doesn't work, you can manually create a button parameter and link it in the channels.For example, just add ropnet1/bake/execute to the linked channels in the channels tab.

or you could add a callback script to the button
hou.pwd().node('ropnet1/bake').parm('execute').pressButton()


-J
User Avatar
Member
79 posts
Joined: March 2016
Offline
Thanks for your reply!

I have tried all the options and slowly starting to come to a conclusion that using the bake_animation node inside a HDA is not possible?

The connection is not the problem as I find, the callback also works fine, but as soon as I allow editing of contents the baking works, but when I match current definition it doesnt?
Edited by Klonkel - Sept. 27, 2019 05:57:01
https://www.youtube.com/@Klonkel
User Avatar
Member
79 posts
Joined: March 2016
Offline
I re-made a HDA with a bake_animation node inside of it, and indeed it isn't working when the asset is locked.

After diving into the asset and also unlocking the bake_animation node I found the error on the ‘Shell’ node saying:

PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions

Is there a way to give the bake_animation node permission to do it's actions when inside a locked HDA?
https://www.youtube.com/@Klonkel
User Avatar
Member
106 posts
Joined: June 2011
Offline
It's because bake_animation node itself is a locked HDA and execute in bake_animation is actually modifying some parameters inside the locked asset.


You could make the bake_animation node editable. Go to your HDA's Type properties => Node tab => Editable Nodes and select the bake_animation node inside your HDA.


-J
  • Quick Links