Hi,
I'm building a super simple tool - a Color Map with pre-built attribute promotion, since I need uvs to be point, not vertex for it to work properly.
Is it possible to have Attribute Promote (or some custom made replacement) auto-detect what is the input uv's original class?
Also is it possible to have class auto-detection in other contexts - in a custom Bind VOP for instance?
If not, would you consider it something worth submitting an RFE for?
In XSI ICE general purpose nodes that worked with more than one kind of input could automatically recognize what kind of data was fed to them, and adapted accordingly. I see no advantage in identifying the kind of input by hand, other than it keeps you on your toes. Having the nodes recognize the data properly (by default, not instead of the manual solution) would help eliminate some human error.
Sorry if it is a noob question.
Cheers
Autodetect attribute class?
3266 6 0- Filip Tarczewski
- Member
- 38 posts
- Joined: 2月 2014
- Offline
- chrism
- スタッフ
- 2551 posts
- Joined: 9月 2007
- Offline
- Filip Tarczewski
- Member
- 38 posts
- Joined: 2月 2014
- Offline
- Filip Tarczewski
- Member
- 38 posts
- Joined: 2月 2014
- Offline
So I'm guessing I should make a Python SOP that does something like this:
Check what type the original uv attribute is (hou.attribType?) and output a value from 0 to 3 accordingly, so
if (uv is point) x=0
if (uv is vertex) x=1
if (uv is primitive) x=2
if (uv is global) x=3
Attrib Promote
Original class switch = x
Could you guide me in the right direction?
Check what type the original uv attribute is (hou.attribType?) and output a value from 0 to 3 accordingly, so
if (uv is point) x=0
if (uv is vertex) x=1
if (uv is primitive) x=2
if (uv is global) x=3
Attrib Promote
Original class switch = x
Could you guide me in the right direction?
- tamte
- Member
- 8839 posts
- Joined: 7月 2007
- Offline
you can just use hscript functions like
haspointattrib()
hasprimattrib()
hasvertexattrib()
hasdetailattrib()
to test if such attrib exists and switch accordingly
so the expression in Original Class parameter of Attrib Promote will look like:
{
string geo = opinputpath(“.”,0);
string attrib = chs(“inname”);
return if(hasdetailattrib(geo, attrib), 0, if(hasprimattrib(geo, attrib), 1, if(haspointattrib(geo, attrib), 2, 3)));
}
or VEX has the same functions as well if you need to determine that in VEX/VOPs
haspointattrib()
hasprimattrib()
hasvertexattrib()
hasdetailattrib()
to test if such attrib exists and switch accordingly
so the expression in Original Class parameter of Attrib Promote will look like:
{
string geo = opinputpath(“.”,0);
string attrib = chs(“inname”);
return if(hasdetailattrib(geo, attrib), 0, if(hasprimattrib(geo, attrib), 1, if(haspointattrib(geo, attrib), 2, 3)));
}
or VEX has the same functions as well if you need to determine that in VEX/VOPs
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Filip Tarczewski
- Member
- 38 posts
- Joined: 2月 2014
- Offline
- Filip Tarczewski
- Member
- 38 posts
- Joined: 2月 2014
- Offline
Thanks! This works great in Attribute Promote, and I'm sure it will in other SOPs.
How could I do the same for Bind VOP to include all the possible input types?
Should I use dataType(self) or optionType(self)?
Is there a more generalized method to check for input type in the context of the node receiving the data?
How could I do the same for Bind VOP to include all the possible input types?
Should I use dataType(self) or optionType(self)?
Is there a more generalized method to check for input type in the context of the node receiving the data?
-
- Quick Links