remove parameters from a node

   9244   6   3
User Avatar
Member
14 posts
Joined: Oct. 2015
Offline
Hi everyone,

I have been trying but unable to remove parms from a node… specifically the parameters in a multiParm block on a ROP under Images > Extra Image Planes.

I want to get remove user added image planes on a rop using python.

I can list these parameters but can delete:


p = hou.parm('/out/TEST1/vm_numaux')
mi = p.multiParmInstances()
for x in mi:
print x

Any pointers?

Cheers,
amit
User Avatar
Member
624 posts
Joined: Aug. 2008
Offline
removing a parameter is not as simple of remove parm. done.

you will have to clone the node interface, to memory alterate the interface, and then load it back to the node.

I forgot the commands and I am not siting in front of my Houdini to test. start for adding a parameter to the UI, a couple of forums have a small example scripts for doing that.
User Avatar
Member
14 posts
Joined: Oct. 2015
Offline
I have already managed to add Parms but unable to remove them.

Only alternative I figured was to make a copy of all existing Parms and then make a new parms list with edits and add them back.

But I was hoping for a better solution than a hack!

Thanks for you reply though… Hope to see some code once you have access to Houdini.

Cheers,
ak
User Avatar
Member
9380 posts
Joined: July 2007
Offline
isn't this what you want?
https://www.sidefx.com/docs/houdini14.0/hom/hou/Parm#removeMultiParmInstance [sidefx.com]
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
14 posts
Joined: Oct. 2015
Offline
Hi Tomas,

I believe yes. I have tried this but it removed all the parms in each tab under Images folder.

Iam not infront of my workstation so can't post my code.
Any pointers on how can I target specific parms under a folder>subfolder?

Thanks,
ak
User Avatar
Member
14 posts
Joined: Oct. 2015
Offline
Alright so this is what I tried.

Create a Mantra node and add an Image Plane and run this:

n = hou.selectedNodes()
n = n

p = hou.parm('/out/mantra1/vm_numaux')
mpi = p.isMultiParmInstance()
spr = p.isSpare()

pt = n.parmTuple('vm_numaux')

print mpi
print spr

n.removeSpareParmTuple(pt)




It prints False for isMultiParmInstance and True for isSpare and deletes the whole image plane adding buttons and any variable multi parms.


I've tried a couple of things with “vm_disable_plane1” too but no success.
There's clearly something that I am missing.

Please help!


Thanks,
ak
User Avatar
Member
14 posts
Joined: Oct. 2015
Offline
Ok,

I guess I was over thinking this one. This is really simple and exactly what Tomas also mentioned in earlier post.

this : p.removeMultiParmInstance(1) is what worked. Below are a few commands I found useful.

p = hou.parm('/out/mantra1/vm_numaux')
f = p.containingFolders()

# return template type
# print p.parmTemplate()
# <hou.FolderParmTemplate name='vm_numaux' label='Extra Image Planes' folder_type=MultiparmBlock>

# return all multiParm instances under p
# print p.multiParmInstances()

# insert at index location
# p.insertMultiParmInstance(0)

# remove multi parm instance by index
p.removeMultiParmInstance(1)

Cheers,
ak
  • Quick Links