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.
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.
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?
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.