Noob question: Manipulating Alembic Frame channel

   2504   10   1
User Avatar
Member
28 posts
Joined: May 2020
Offline
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!
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
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:

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]
User Avatar
Member
28 posts
Joined: May 2020
Offline
Thanks!
Sounds like a step in the right direction.
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
Member
28 posts
Joined: May 2020
Offline
When i try to add the expression
setprimintrinsic(0, "abcframe", @elemnum, 4, "set");
in the Frame channel, I get a syntax error:
Error:       Unable to evaluate expression (Syntax error (/obj/umbrella_export/alembic1/frame)).
Not sure what i'm doing wrong… :/
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
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]
User Avatar
Member
28 posts
Joined: May 2020
Offline
Got it thanks, still lots to learn!
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
Member
28 posts
Joined: May 2020
Offline
So, i've created a primitive wrangle, and pasted
setprimintrinsic(0, "abcframe", @elemnum, 4, "set");
in, and now i'm getting these errors. It seems that @elemnum appears to be an undeclared variable:

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) 

Attachments:
Capture.JPG (260.2 KB)

Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
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.

Attachments:
time_offset_abc.hiplc (299.6 KB)

MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
28 posts
Joined: May 2020
Offline
Update:

Within the wrangle, i clicked on the Bindings tab and then checked “Update normals if displaced”, which got rid of the error altogether. Alas, my alembic umbrella is still completely unresponsive (it works fine when i let it run with $F in the Frame channel)
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
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?
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
User Avatar
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.
Fabio Basile - 3D Artist

https://www.behance.net/fabiobasile [www.behance.net]
  • Quick Links