I still know very little about VEX, and for now i would like to learn more about how i can manipulate the Frame channel to control an Alembic animation.
In my specific case, i have created an umbrella that goes from open (Frame 2) to closed (Frame 120), and would like to figure out how i can make the frames play backwards. Is there a function in VEX that can help me accomplish that whilst giving me a level of control on when to trigger it, and the range of frames i want to use? For instance, i would like the umbrella to open and close very fast to shake the rain off of it.
Any help is appreciated!
Noob question: Manipulating Alembic Frame channel
2504 10 1-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
-
- toadstorm
- Member
- 359 posts
- Joined: April 2017
- Offline
Packed Alembic primitives in Houdini have what's called a “primitive intrinsic” attribute called “abcframe” that you can set in VEX in order to change the timing. Confusingly, “abcframe” is in seconds, not frames. To set the timing:
where n is the time in seconds that you want to set each primitive to. You can change “set” to “add” or “multiply” or a few other things too; check the help on setprimintrinsic() for details.
setprimintrinsic(0, "abcframe", @elemnum, n, "set");
where n is the time in seconds that you want to set each primitive to. You can change “set” to “add” or “multiply” or a few other things too; check the help on setprimintrinsic() for details.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
-
- toadstorm
- Member
- 359 posts
- Joined: April 2017
- Offline
Sorry, I should have emphasized that this is VEX, not an expression. You can leave the Alembic SOP alone. You want to drop down a point or primitive wrangle, then use that code to modify the timings.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
So, i've created a primitive wrangle, and pasted in, and now i'm getting these errors. It seems that @elemnum appears to be an undeclared variable:
setprimintrinsic(0, "abcframe", @elemnum, 4, "set");
Error Invalid source /obj/umbrella_export/attribwrangle1/attribvop1 Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Error in VOP 'snippet1'. Warning: Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Error: Vex error: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50) Failed to resolve VEX code op:/obj/umbrella_export/attribwrangle1/attribvop1 Unable to load shader 'op:/obj/umbrella_export/attribwrangle1/attribvop1'. Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Error in VOP 'snippet1'. Warning Errors or warnings encountered during VEX compile: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50). Warning Vex error: /obj/umbrella_export/attribwrangle1/attribvop1/snippet1: Reference to undefined variable: _bound_elemnum (1,37:50) Failed to resolve VEX code op:/obj/umbrella_export/attribwrangle1/attribvop1 Unable to load shader 'op:/obj/umbrella_export/attribwrangle1/attribvop1' Warning Reference to undefined variable: _bound_elemnum (1,27:40)
-
- toadstorm
- Member
- 359 posts
- Joined: April 2017
- Offline
check this file out.
if you want easier control, you can also download MOPs and use MOPs Set Sequence Time to drive packed Alembics or disk sequences.
if you want easier control, you can also download MOPs and use MOPs Set Sequence Time to drive packed Alembics or disk sequences.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
Progress!
I was able to run the VEX from your file into my wrangle, and now i'm able to delay or shorten my Alembic by changing the second value of fit01().
Now i guess i have to figure out how to reverse the direction of the frames. I've been theorizing that i could perhaps create an array, and somehow play it in reverse using the reverse function, but since frames are stored as seconds of time, maybe there is another way?
I was able to run the VEX from your file into my wrangle, and now i'm able to delay or shorten my Alembic by changing the second value of fit01().
Now i guess i have to figure out how to reverse the direction of the frames. I've been theorizing that i could perhaps create an array, and somehow play it in reverse using the reverse function, but since frames are stored as seconds of time, maybe there is another way?
-
- fabiobasile
- Member
- 28 posts
- Joined: May 2020
- Offline
Probably not as elegant a solution as i was hoping, i ultimately resorted to dropping a re-time node, and keyframing the top start and end frame channels to key in the exact moment i want the animation to occur, and then keyframe the frame rate to control the speed.
It's a bit convoluted and not as straightforward as i was hoping, but it's a means to an end until i learn a bit more about what i can do with VEX.
It's a bit convoluted and not as straightforward as i was hoping, but it's a means to an end until i learn a bit more about what i can do with VEX.
-
- Quick Links