Jump to content

Python script to change operator type


BaiLong

Recommended Posts

Hi,

 

I would like to use python to run whatever functions are executed when you use the righ click menu > "Change Type...". Because I have to do it on a number of nodes.

 

Does anyone have an idea how to change the operator type of a node?

 

That's what I have so far:

changeNodes = []
objs = hou.root().recursiveGlob('*', hou.nodeTypeFilter.Obj)
for o in objs:
    if o.type().name() == 'nodeType_A':
        changeNodes.append(o)
for c in changeNodes:
    #change nodeType to 'nodeType_B'
    #Keep name
    #Keep Parameters

Any ideas? If there is a way to just get whatever code is run when I use the "Change Type..." that would already be of huge help!

 

Thanks a lot!

 

--Markus

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