Jump to content

createNode is not working.


cloudfx

Recommended Posts

Running the python code as OTL (geometry operator type with python)

 

Its getting this error --> 

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.313/houdini/python2.7libs\houpythonportion.py", line 5
67, in decorator
    return hdefereval.executeInMainThreadWithResult(func, *args, **kwargs)
  File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.313/houdini/python2.7libs\hdefereval.py", line 41, in 
executeInMainThreadWithResult
    return _queueDeferred(code, args, kwargs, block=True)
  File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.313/houdini/python2.7libs\hdefereval.py", line 74, in 
_queueDeferred
    raise exc_info[1]
OperationFailed: The attempted operation failed.
This node cannot contain other nodes

 

 

Here is the code..

# This code is called when instances of this SOP cook.
node = hou.pwd()
geo = node.geometry()

# create a temporary ROP node 
fbx_rop = hou.node('/obj/pyro_import1/OUT').createNode('filmboxfbx') 


# set the output path to whereever you want the file to go 
fbx_rop.parm('sopoutput').set("$TEMP/out.fbx") 


# Path to object hierarchy you want to export 
obj_path = hou.node('/obj/pyro_import1/OUT').path() 
fbx_rop.parm('startnode').set(obj_path) 


# Now just run the "render" method on the node, and delete the ROP 
fbx_rop.render() 
fbx_rop.destroy() 
Link to comment
Share on other sites

@symek

 

Actually, it is not, it has all the point attributes and geo that I want to export..

 

Understood, but it still might be a Null SOP, albeit: 

hou.node('/obj/pyro_import1/OUT').createNode('filmboxfbx')

above line attempts to create a filmboxfbx ROP inside .../OUT node, which doesn't make sense, unless OUT it's a ropnet node. Is it? (your error output suggests it is not).

 

Assuming filmboxfbx is a ROP type (can't check now, no Houdini around, sorry), you would like to do something like:

geometry_to_export = hou.node("/obj/pyro_import/OUT")
parent = geoemtry_to_export.parent()
ropnet = parent.createNode("ropnet")
ropnet.createNode("filmboxfbx") ...

more or less...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...