Hi brains trust,
In the past I would use the bounding box expression ($BBY*2-1) * sin a lot in a point sop. what's the equivalent of the expression in vex , for use in vexpressions.
Rob
Vex Bounding box ?
13418 8 3- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- tamte
- Member
- 8592 posts
- Joined: July 2007
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
@P = (relbbox(1,@P)*2-1) * sin(@Frame);
or for a more long winded version:
vector pos2 = @opinput1_P; // fetch second input position to variable pos2
@P = (relbbox(1,pos2)*2-1) * sin(@Frame);
Modern method to reference second input is documented in the last paragraph for the help on the Attribute Wrangle VOP.
@opinput0_P fetches first input or just us @P
@opinput1_P fetches second input P
…
There should be no need to use the point() function to fetch second, third and fourth input attributes.
relbbox(0,@P) fetches bbox position from first input
relbbox(1,@P) fetches bbox position from second input
…
All the vex functions that take a file as an argument, you can use the direct integer index to the input of the current SOP.
or for a more long winded version:
vector pos2 = @opinput1_P; // fetch second input position to variable pos2
@P = (relbbox(1,pos2)*2-1) * sin(@Frame);
Modern method to reference second input is documented in the last paragraph for the help on the Attribute Wrangle VOP.
@opinput0_P fetches first input or just us @P
@opinput1_P fetches second input P
…
There should be no need to use the point() function to fetch second, third and fourth input attributes.
relbbox(0,@P) fetches bbox position from first input
relbbox(1,@P) fetches bbox position from second input
…
All the vex functions that take a file as an argument, you can use the direct integer index to the input of the current SOP.
There's at least one school like the old school!
- bonsak
- Member
- 459 posts
- Joined: Oct. 2011
- Offline
- animatrix_
- Member
- 4528 posts
- Joined: Feb. 2012
- Offline
jeff
@P = (relbbox(1,@P)*2-1) * sin(@Frame);
or for a more long winded version:
vector pos2 = @opinput1_P; // fetch second input position to variable pos2
@P = (relbbox(1,pos2)*2-1) * sin(@Frame);
Modern method to reference second input is documented in the last paragraph for the help on the Attribute Wrangle VOP.
@opinput0_P fetches first input or just us @P
@opinput1_P fetches second input P
…
There should be no need to use the point() function to fetch second, third and fourth input attributes.
relbbox(0,@P) fetches bbox position from first input
relbbox(1,@P) fetches bbox position from second input
…
All the vex functions that take a file as an argument, you can use the direct integer index to the input of the current SOP.
I was expecting the opinput_attrib binding to be much faster than using point/prim functions but unfortunately it's the other way around . Using point/prim functions to get attributes from other inputs is faster. So I wouldn't use the opinput syntax if the performance is critical. Otherwise they would be nicer to use.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- tamte
- Member
- 8592 posts
- Joined: July 2007
- Offline
pusat
…
I was expecting the opinput_attrib binding to be much faster than using point/prim functions but unfortunately it's the other way around . Using point/prim functions to get attributes from other inputs is faster. So I wouldn't use the opinput syntax if the performance is critical. Otherwise they would be nicer to use.
- in my tests @opinput_ binding is the same or maybe a bit faster than point() for matching by ptnum
- but be careful since if you have id attribute present on your geo, it's binding by id by default, which you can control in Bindings Tab/ Attribute To Match in which case it's speedwise comparable to findattribvalue() workflow
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- animatrix_
- Member
- 4528 posts
- Joined: Feb. 2012
- Offline
tamtepusat
…
I was expecting the opinput_attrib binding to be much faster than using point/prim functions but unfortunately it's the other way around . Using point/prim functions to get attributes from other inputs is faster. So I wouldn't use the opinput syntax if the performance is critical. Otherwise they would be nicer to use.
- in my tests @opinput_ binding is the same or maybe a bit faster than point() for matching by ptnum
- but be careful since if you have id attribute present on your geo, it's binding by id by default, which you can control in Bindings Tab/ Attribute To Match in which case it's speedwise comparable to findattribvalue() workflow
Thanks I will check the file I sent to SESI. They also saw the same behaviour. Otherwise I was anxious to update all of my VEX code to use opinput.
Though the recent addition of auto type recognition for the known attributes also prevents me from doing this as I don't want to type prefixes for known types as we don't use the latest Houdini 15 build here.
For H16 hopefully all will be well.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
-
- Quick Links