Jump to content

[ python ] cannot dynamically set min&max parm values of my DA ..


zarti

Recommended Posts

hi everyone !

 

as title 'said' .. i cannot dynamically ( after-getting-value-from-somewhere-else ) set minValue / maxValue of a parm .

 

it is an IntParmTemplate ; i can read, manipulate but not "replace" .

 

after searching through forum best i could find something similar ( asked some days before ) but it applied to a parmTemplateGroup .

 

sorry i cannot copy paste since im posting from tablet but my code is something like this :

nd = hou.node( 'somepath' )
ptg = nd.parmTemplateGroup()
i = ptg.find( 'myintparm' )
i.setMinValue( int( min ) )
i.setMaxValue( int( max ) )
ptg.replace( 'myintparm', i )
nd.setParmTemplateGroup( ptg ) # parms do not change !!

what im doing wrong ?

 

it sounded simple when i started to do it , .. but here i am =)

 

 

 

! thaks in advance 

 

 

 

 

 

 
Link to comment
Share on other sites

.. additionally ( and strangely ) ,

 

when i use "append" instead of "replace" it seems to work ( a new parameter with min&max values assigned by me ; is created as it should )

 

 

? strange

Link to comment
Share on other sites

you can modify only spare parameters

so if you are trying to change parameters that are in definition of the node it will not work as you are not able to change them through Edit Parameter Interface either

 

that's why appending works as it is appending a spare parm

but if you try to modify spare parm, it should work as you have it

  • Like 1
Link to comment
Share on other sites

first of all, thank you for your reply !

 

it was Really helpful for not wasting more of my time floating between my ignorance <-> thin documentation <-> searching on forums .

 

you can modify only spare parameters

so if you are trying to change parameters that are in definition of the node it will not work as you are not able to change them through Edit Parameter Interface either

 

that's why appending works as it is appending a spare parm

but if you try to modify spare parm, it should work as you have it

 

i built a clean SOP_Python DA just to test "how many points has the input node to my DA" and it really worked .

min and max integer values are updating correctly with the help of 'clear()' method .

i need to find a way trigger the updating the values , but that appears to be easy trying tricks .

changing defined parameters not be a limitation in houdini , imho , but anyway ..

 

i'll post the code later since i havent yet found one on forums fully illustrated for future reference to someone like me , or even for me only .

who knows where this DA will end after some time .. =}

 

thanks again anim !

 

--

 

second - just few thoughts after this experience ;

 

? Why there exists a 'second-class-citizen of parameters' ?

is this because of some limits of parameters defined in a DA or spareParameters have extra-special-Powers ?

 

another open question is : where i can find a concise list of " where Spare Parameters should / should Not be used " ?

 

this seems important and i can read about it superficially here-and-there in some docs paragraphs / forum posts ..

but this is not how i do store it in my permanent brain memory .

spare parms and similar exclusive houdini terms / jargon , IMHO , should be specifically Defined in some official place !

 

maybe im missing something simple , but all i know for sure is ;

the time i consumed to solve this situation ( or similar ones ) would have been better spent producing 'nice outputs' .

 

while i appreciate SESIs efforts to make houdini's viewport interactivity , shading and rendering more powerful and conventional i think a new ( important ) front should be open in the documentation and referencing system .

 

this would be tremendously helpful in countless tasks everyday ; especially for generalists .

if the Power of Houdini is 'hidden' in constructing Digital Assets , then building DA UIs should be simply ..  SPECTACULAR . 

 

.. sounds like a rant , but sincerely it is a critique . 

 

 

.cheers

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