Hello!
From what I've read, adding parameters automatically to an interface is something that can be done with Python, but most of the examples are too specific to relate to my current goal.
What I want to achieve simply is to have a simple button in an interface that, onclick, will add labelled file path fields in the same interface.
Forgive my novice question, I'm trying to use Python but I hardly have any knowledge of it
Thanks,
- Samboosa.
Simple button to add more parameters
5617 12 1- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
To illustrate my point a bit clearer, if you look at the ADD node, in the points tab there is a ‘ + ’ to the right of the number of points field, this button does exactly what I want but I can't find it back when I try to edit the interface…
Update:
After looking into the hou.ParmTemplateGroup in the houdini help, I think I should be trying to use this:
insertAfter(self, name_or_parm_template_or_indices, parm_template)
My issue is my lack of knowledge on this part…I wouldn't know how to structure this on the callback of a button :?
Update:
After looking into the hou.ParmTemplateGroup in the houdini help, I think I should be trying to use this:
insertAfter(self, name_or_parm_template_or_indices, parm_template)
My issue is my lack of knowledge on this part…I wouldn't know how to structure this on the callback of a button :?
- tamte
- Member
- 8786 posts
- Joined: July 2007
- Offline
it's called Multiparm Block
to do that just create a Folder (while editing interface) and change it's type from Tabs to one of Multiparm options
whatever parameter you put into that Folder will be part of that multiparm and will be added or removed in the same way as in Add SOP
anyway, you can see it if you edit Add SOP's interface (the Number Of Points folder is multiparm block)
EDIT: for further usage just search the forums for multiparm
to do that just create a Folder (while editing interface) and change it's type from Tabs to one of Multiparm options
whatever parameter you put into that Folder will be part of that multiparm and will be added or removed in the same way as in Add SOP
anyway, you can see it if you edit Add SOP's interface (the Number Of Points folder is multiparm block)
EDIT: for further usage just search the forums for multiparm
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
Wow, thank you Tamte! What you suggested works like I want…looks like I was looking for the wrong thing
Edit:
Actually, the multiparm is working, but what I want is to have a button create a number of nodes based on the multiparm value,
If I put this in the callback script of the button an Invalid syntax error:
n = hou.ch('obj/geo_boxes/numboxes')
range = (0, n)
for i in range:
hou.copyNodesTo( , hou.node(“/obj/geo_boxes”) )
I get no error when I do it in the python shell What is going wrong?
Edit:
Actually, the multiparm is working, but what I want is to have a button create a number of nodes based on the multiparm value,
If I put this in the callback script of the button an Invalid syntax error:
n = hou.ch('obj/geo_boxes/numboxes')
range = (0, n)
for i in range:
hou.copyNodesTo( , hou.node(“/obj/geo_boxes”) )
I get no error when I do it in the python shell What is going wrong?
- tamte
- Member
- 8786 posts
- Joined: July 2007
- Offline
- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
Tamte, I was actually just using dummy boxes to test it out.
My goal is to create multiple UVQuickshade nodes with a button (done) but then to have them automatically connect to a switch so I can randomly assign the materials to different objects.
Basically to add and remove multiple materials(with texture map) with just a button…
My goal is to create multiple UVQuickshade nodes with a button (done) but then to have them automatically connect to a switch so I can randomly assign the materials to different objects.
Basically to add and remove multiple materials(with texture map) with just a button…
- tamte
- Member
- 8786 posts
- Joined: July 2007
- Offline
no need for scripting, but rather than guessing what you want exactly since UVquickshade is not at all a tool to assign material I would like to know what exactly you are aiming for
if you specify exactly what you want, you may get straight answer, if you keep asking for ways to do things way you think they might work it will be very long way to get working solution and it will probably not be the most efficient
anyway, Material SOP has multiparm inside which can be linked to yours if you have use for that
or you can make an attribute to override textures per primitive based on your multiparm as I mentioned on odforce
if you specify exactly what you want, you may get straight answer, if you keep asking for ways to do things way you think they might work it will be very long way to get working solution and it will probably not be the most efficient
anyway, Material SOP has multiparm inside which can be linked to yours if you have use for that
or you can make an attribute to override textures per primitive based on your multiparm as I mentioned on odforce
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
Tamte/anim,
I tried what you suggested on odforce, and I'm probably doing something wrong.
I've gotten as far as to store the filepaths in a primitive string attribute, but in a ForEach I'm trying to assign a UVQuickshade with the texture path the string attribute.
The UVquickshade filepath field and the attributecreate have the same expression to generate the filename…so why am I only seeing one texture
I tried what you suggested on odforce, and I'm probably doing something wrong.
I've gotten as far as to store the filepaths in a primitive string attribute, but in a ForEach I'm trying to assign a UVQuickshade with the texture path the string attribute.
The UVquickshade filepath field and the attributecreate have the same expression to generate the filename…so why am I only seeing one texture
- tamte
- Member
- 8786 posts
- Joined: July 2007
- Offline
houdini cannot display different textures if they are just overriden by primitive attributes, but they will render correctly
and you don't need UV quickshade since it is assigning a material node inside etc, if you assign your own material
EDIT: and you don't need for each if you already have some ID attribute which you can use to generate your texture names from
and you don't need UV quickshade since it is assigning a material node inside etc, if you assign your own material
EDIT: and you don't need for each if you already have some ID attribute which you can use to generate your texture names from
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
- tamte
- Member
- 8786 posts
- Joined: July 2007
- Offline
sure, since your attribute name is just attribute1
you need to name it the same as parameter in the shader you want to override
so if the parameter has internal name baseColorMap as in Mantra Surface, your attribute name will be the same
if it's map_base as in uvquickshades material, you need to call it that etc.
here is very simple example of overriding the texture per primitive, you need to render though as overrides happen in the shader where it uses that attribute to get texture path rather than value of the parameter
you need to name it the same as parameter in the shader you want to override
so if the parameter has internal name baseColorMap as in Mantra Surface, your attribute name will be the same
if it's map_base as in uvquickshades material, you need to call it that etc.
here is very simple example of overriding the texture per primitive, you need to render though as overrides happen in the shader where it uses that attribute to get texture path rather than value of the parameter
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- samboosa
- Member
- 26 posts
- Joined: Sept. 2010
- Offline
- tamte
- Member
- 8786 posts
- Joined: July 2007
- Offline
it's not a predefined name but rather a way how VEX work
you need to always explore vop network of your shader and if you create attribute of the same name and type as any parameter it will be used instead of the parameter value
and because inside uvquickshade there is a material which has diffuse texture parameter named map_base you can override it by attribute of the same name and type, so for different material shader it will be different as I mentioned with mantra surface
you need to always explore vop network of your shader and if you create attribute of the same name and type as any parameter it will be used instead of the parameter value
and because inside uvquickshade there is a material which has diffuse texture parameter named map_base you can override it by attribute of the same name and type, so for different material shader it will be different as I mentioned with mantra surface
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Quick Links