magneto Posted October 4, 2012 Share Posted October 4, 2012 Hi, I have a matrix4 parameter with 16 float fields. I can assign references to them one by one, but is it possible to do it at once. So like: matrixParm.set(anotherMatrixParm)[/CODE]instead of:[CODE]m1.set(mm1)m2.set(mm2)m3.set(mm3)[/CODE]etcWhen I do this, it can't find my matrix parameter called "m" in the attribcreate1.[CODE]hou.node('/obj/geo1/attribcreate1').parm('m')[/CODE]It works if I use "m1", "m2" for individual fields, but I want to assign the whole parameter like above.Is this possible?Thanks Quote Link to comment Share on other sites More sharing options...
graham Posted October 4, 2012 Share Posted October 4, 2012 A parameters as a whole is generally referred to as a parameter tuple. This is basically a collection of the sub parms. Take the Translate parm on an object for example. >>> pt=hou.parmTuple('/obj/geo1/t') >>> for parm in pt: ... parm ... <hou.Parm tx in /obj/geo1> <hou.Parm ty in /obj/geo1> <hou.Parm tz in /obj/geo1> This is the reason you cannot find just 'm'. hou.Node.parmTuple('m') should return the parm tuple named after 'm': m1, m2, .... That being said, hou.Parm objects support setting to other hou.Parm objects (hou.Parm.set(hou.Parm)) and automatically generating the corresponding channel references. Unfortunately hou.ParmTuples don't (existing RFE). Luckily hou.ParmTuple objects are iterable with the hou.Parm objects contained in them. You can do something like this: def setParmTupleToParmTuple(m, mm): for m_parm, mm_parm in zip(m, mm): m_parm.set(mm_parm) 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted October 4, 2012 Author Share Posted October 4, 2012 Thanks Graham, exactly what I needed So in essence hou.Parm is for channels but hou.ParmTuple is for a parameter as a whole, right? Btw I noticed you become staff, congrats Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.