Houdini Python SOPs not loading in Houdini Engine for Maya

   5456   6   2
User Avatar
Member
23 posts
Joined: March 2013
Offline
I have a digital asset which contains several Python SOPs that manipulate the geometry in various ways and am having issues getting it to load in Maya via Houdini Engine.

Maya throws the following error:

/obj/createModule1/createModule1/ModuleDivide:
Error: Python error: Traceback (most recent call last):
File “<stdin>”, line 40, in <module>
File “<stdin>”, line 38, in moduleDivide
File “/Library/Frameworks/Houdini.framework/Versions/13.0.509/Resources/houdini/python2.7libs/hou.py”, line 48086, in set
return _hou.Parm_set(*args)
PermissionError: Failed to modify node or parameter because of a permission error. Possible causes include locked assets, takes, product permissions or user specified permissions



Has anyone encountered this? Is there a way I need to “pack” my python SOP code into the digital asset or should I be able to have python SOPs in digital assets for Houdini Engine for Maya? Is Maya trying to use its own Python library and not Houdini's?

Just so I have the proper workflow as well, is there any difference between Python SOPs and a new operator type –> Python other than one is mean to be reused easily and the other is for one off changes? Is there any advantage specifically for Houdini Engine for Maya to use one method vs the other?

Additionally should I be saving my Houdini Engine for Maya digital assets somewhere outside Library/Preferences/houdini/13.0/otls in order to avoid possible permissions issues or should that not be a problem for Maya?

Tech Specs:
Houdini Indie 13.0.509
Maya 2015
Mac 10.8.5

Thanks!
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
Hey david, without looking at your asset, is your python code trying to set parameters in nodes inside of your digital asset network? That would trigger that error. The reason you may not see that error in houdini could be because your asset is editable (name is red in the network view) , but when it gets to maya, it automatically locks. You can test this by right clicking on your asset in houdini, choosing match current definition, and see if this occurs in houdini

The python snippet sop is indeed for quick one offs specific to your network, whereas a python defined sop is literally declaring a new node type which can be reused. I reserve defined sops to atomic functionality that is reusable
-G
User Avatar
Member
23 posts
Joined: March 2013
Offline
Hi Gray,

Thank you for your reply! My python code is indeed setting parameters in nodes inside the digital asset network. The asset works when it is editable and it throws an error that the python operator failed to cook when “match current definition” is selected.

Is there a way to manipulate parameters of nodes within the digital asset network via Python and have it work when the asset is locked and no longer editable?
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
Yup! In your digital asset type properties, in the main tab, you have a section to set certain nodes to be editable. This will allow you to write to the nodes even when the node is locked.

Alternatively (and recommended) if you are in sop space, is to have your python node create a detail attrobute, and have your parameters which you want to modify read the detail attribute using the detail () expression function. That allows you to do what you want to do without editable nodes (thus maintaining a “stronger” definition )
-G
User Avatar
Member
23 posts
Joined: March 2013
Offline
That worked! I ended up using your recommended method and now the asset holds up when “Match Current Definition” is selected!

A few additional learns in case other people find this and are working through the same issue: Once I was correctly referencing the detail attribute instead of setting the node value directly in Python, I was still getting an incorrect result when selecting “Match Current Definition. I realized it was matching a previously saved definition and I needed to ”Save Operator Type“ to have it save the current, now corrected, contents of the HDA. Once I did that, it displayed correctly when I selected ”Match Current Definition".

Citing http://www.sidefx.com/docs/houdini13.0/hom/hou/HDADefinition [sidefx.com]:

updateFromNode(self, node)
Update and save the definition to match the contents of a given unlocked instance of the asset. Calling this method is the same as selecting Save Operator Type on the node’s menu.


Additionally the attribute I was needing to create and access from the detail level was a string and detail() wasn't working - I found it needed to be details() in order to return the string attribute.

A good resource to learn about all of the expression functions which I found by researching detail()

http://www.sidefx.com/docs/houdini13.0/expressions/ [sidefx.com]

Thank you SO much for your help, that is a huge concept to pick up and I'm back on track!
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
hey David, I am glad it all worked out ok This app is an ocean full of pleasant surprises
-G
User Avatar
Member
101 posts
Joined: Dec. 2012
Offline
worked for me as well! thanks!
  • Quick Links