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
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:
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
if it's for SOPs you usually don't need to duplicate nodes by script but rather pair your multiparm with For Each SOP to get what you want there should be a few examples on the forums for that
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…
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
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, I'm still trying to grasp how to apply materials like you would a lambert in Maya, all I want is to have a basic test texture…that's kind of why I'm using a uvquickshade for ease.
Nevertheless, with the method I had a screenshot of, Houdini is still rendering only one texture
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
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