Enabling/Disabling bind export in point VOP

   3243   4   0
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
I have a VOP network that has a bind export. Sometimes I want to export the attribute, and sometimes I don't, (using a toggle). I can't see any way to do this… I tried an elaborate if statement in the callback with opwire and unwires, but it doesn't work, (although it works in the textport).

I'm petty sure this is possible, I just don't remember how.
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
On the outside of the vop node you can specify which attributes are exported. Default is all (*). You could probably make some kind of switch here. Here i have excluded an attribute called “debug”:



-b
Edited by bonsak - Dec. 13, 2018 16:14:31

Attachments:
export.png (5.0 KB)

http://www.racecar.no [www.racecar.no]
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
Yup that worked.

I'm putting the workflow here for posterity's sake.

  1. In the hscript callback of the button:
    opdef:.?flip `ch("exportN")`
    
  2. In the node tab I added the node I will be modifying the the “editable nodes” parm
  3. In the “extra files” tab I added a new hscript section called “flip”
  4. The code for that is:
    if ($arg1 == "1") then
        opparm ./rotate_normals vex_outputmask ("*")
    else
        opparm ./rotate_normals vex_outputmask ("* ^up")
    endif
    
Be careful with that if statement above. If you don't put the “1” in quotes, it will probably break, (treat it as an integer instead of a string).



Edited by mrCatfish - Dec. 14, 2018 10:41:00

Attachments:
Selection_001.png (25.5 KB)
Selection_002.png (11.3 KB)
Selection_003.png (25.2 KB)

Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
8534 posts
Joined: July 2007
Offline
rather than making editable nodes and callbacks which will make your HDA very unflexible especially during updating or if you want to animate your toggle

you can directly reference your toggle value in the Export Parameters parm like this"

`ifs(ch("exportN"),"N","")` `ifs(ch("exportup"),"up","")`
attached example

Attachments:
toggle_exports.hip (76.4 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
10 posts
Joined: Oct. 2010
Offline
tamte
rather than making editable nodes and callbacks which will make your HDA very unflexible especially during updating or if you want to animate your toggle

you can directly reference your toggle value in the Export Parameters parm like this"

`ifs(ch("exportN"),"N","")` `ifs(ch("exportup"),"up","")`
attached example

Thank you Tomas, I always had a hard time to selectively export attributes from VOPs. Very useful trick.
  • Quick Links