APEX Trials - Rubix Cube

   2932   27   4
User Avatar
Member
606 posts
Joined: July 2013
Offline
So, following the APEX Docs, I manually created a APEX graph and got a Cube to display in the viewport (yipee!).

So, my next challenge is something very familiar, that has plagued Riggers for years - that freakin dynamic parenting Rubix's cube problem!

After reading thru all the Apex nodes - I do see some nodes around Skeleton and Skel.SetParent - which sounds like what I'd need here.

So, let me keep going in the Docs to setup some Skel + Geo + Controls, and maybe I can get this done myself, without asking for help from the Community/SideFX.

I will share my learning/progress in this thread if anyone wants to sub.
Edited by TwinSnakes007 - Dec. 5, 2023 11:23:48
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
606 posts
Joined: July 2013
Offline
Is there anyway to read intrinsics yet?

I'm trying to read the bounds attribute of a sop:box as a float array, and I cant grab it at all.

I tried:

geo:arrayattrib<detail, float>
geo:detailattribute<float array>

Any alternative to know the size of something in worldspace?
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
606 posts
Joined: July 2013
Offline
Looks like there's a bug with setting uniform scale on sop:<nodes>, I promoted scale as a float parameter and its not evaluating at all it seems.

I bounced Houdini and reloaded the file to be sure it wasnt a session issue.
Edited by TwinSnakes007 - Dec. 5, 2023 13:50:53

Attachments:
Rubix_Cube.hiplc (593.0 KB)

Houdini Indie
Karma/Redshift 3D
User Avatar
Member
274 posts
Joined: March 2011
Online
TwinSnakes007
Is there anyway to read intrinsics yet?

I'm trying to read the bounds attribute of a sop:box as a float array, and I cant grab it at all.

I tried:

geo:arrayattrib<detail, float>
geo:detailattribute<float array>

Any alternative to know the size of something in worldspace?
TwinSnakes007
Is there anyway to read intrinsics yet?

I'm trying to read the bounds attribute of a sop:box as a float array, and I cant grab it at all.

I tried:

geo:arrayattrib<detail, float>

It doesn't seem to work. If we're able to run vex code on the geometry, we would be able to do that with vex, but unfortunately I haven't found a way to do that.
geo:detailattribute<float array>

Any alternative to know the size of something in worldspace?
User Avatar
Member
274 posts
Joined: March 2011
Online
I found a way to do that, but is not optimal. Hope SESI will add more nodes to the geo section. But you can use the attrib vop inside apex. Attrib vop can run a vex code, so you would need to set the vex code to read the intrinsic and then write onto some other attrib you can read later, using the geo nodes.
User Avatar
Member
606 posts
Joined: July 2013
Offline
guilhermecasagrandi
I found a way to do that, but is not optimal. Hope SESI will add more nodes to the geo section. But you can use the attrib vop inside apex. Attrib vop can run a vex code, so you would need to set the vex code to read the intrinsic and then write onto some other attrib you can read later, using the geo nodes.

Thanks for tracking that down. I guess its still very early days in APEX land.
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
215 posts
Joined: June 2023
Offline
It's a bit absurd there is no an official way to combine VEX (arguably the most important, unique and powerful feature in Houdini SOP) and APEX now.

sop::attribvop works, but it's clearly not "the official way". Look at the UI... or the lack of UI. vexsnippet is a single line. bindclass is an integer slider. Have fun writing any non-trivial logic with it. Or perhaps one can use sop::invoke, introducing at least a hidden dependency and two compile block nodes...
Edited by kodra - Dec. 5, 2023 14:59:48
User Avatar
Member
606 posts
Joined: July 2013
Offline
Well, I did it this way on purpose, just to try and force myself to learn more about "what" APEX is...so, there's that.

But, I can see value here - especially for "procedural" control(s) - where you want to position the control as an offset from the Geometry (based on world space bounds, etc.)
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
606 posts
Joined: July 2013
Offline
Okay, so, making some progress - so, I'm going to prototype this in SOPs and then try and make it procedural in APEX (which seems like a much easier way to setup custom graphs - just referencing working SOP nodes).
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
606 posts
Joined: July 2013
Offline
I've looked at the entire H20 Hive, the H20 APEX documentation, manually created some APEX Graphs, and did some thought reflection...

..and I dont think this is possible - in my mind, what would be needed is, a Viewer State proximal parenting feature based on the active control.

In View State, click to activate control - that activation "triggers" a world space bounding box selection of Objects that are parented to the activated control (only while this control is activated).

It seems like, "something" like this should be possible, with a few additional pieces from SideFX, because, H20 already has some Viewer State workflow(s).
Edited by TwinSnakes007 - Dec. 11, 2023 12:02:12
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
7773 posts
Joined: July 2005
Offline
Please submit an RFE for the VEX snippet stuff. Thanks!
Edited by edward - Dec. 14, 2023 11:09:07
User Avatar
Member
222 posts
Joined: March 2023
Offline
What you're describing could only ever be achieved through video game logic, even if you could set the parent on the fly upon selection, that parenting will only exist for the duration of the selection, what happen once you're done with your control ? the parenting will fall apart and all of your previous animation will fail. how would you also handle case where a section of the cube didn't fully rotate 90° ?

trying to make a 'rubix cube' rig is simply not possible outside of the context of a simulation, first of all, real rubik cube are a physic collision problem, they hold in place together through friction and pressure, it simply not possible to represent that through bone and constraint.

the way you could achieve that is by mixing static animation and simulatin : reading the animation of controller that represent each axis and row of the rubik cube (so around 9 control) those controller are basically parented to the core of the rubikcube and would move with it.

the second part is the simulation : if you can read the delta of the animation of each control, using a vex code for example, you can trigger the selection of the corresponding list of box that should be moving at that moment and rotate them around the currently active control, you could use physic or not, however, your system need to be aware that thing can FAIL : if the controller didn't fully rotate by 90°, any futur movement will fail.
because it a simulation, any change will trigger a complete resimulation of the entire animation.

I'd like to believe apex will allow this kind of behavior to happen whittin a graph, after all there seem to be a simulation system, but no documentation as of today.
Head of Pipeline @ LightVFX
User Avatar
Member
7773 posts
Joined: July 2005
Offline
I'd temper that people have been doing Rubik's cubes in SOPs for probably 20+ years now. I'd find that odforce thread except it seems down for me now. I haven't looked but https://www.sidefx.com/learn/collections/rubiks-cube/ [www.sidefx.com] has a nice tutorial that may (or may not) be useful. For simulation, we don't really need it to be within the APEX graph as long as something outside feeds the output of an APEX graph back in as an input.
Edited by edward - Dec. 14, 2023 11:16:25
User Avatar
Member
606 posts
Joined: July 2013
Offline
I dont think the question was, at least from my perspective, can Houdini do a Rubix rig - my question was, "how" to do a Rubix rig using APEX ( even though APEX is a more generalized graph framework, its focus, for now, is rigging ).

There's probably several ways to do this is SOPs - but the challenge is, APEX - since APEX is Houdini's attempt at a procedural rigging framework.

My suggestion of a Viewer State proximal based parenting, is only one APEX idea of how to solve this - it seems like the easiest to knowledge transfer to others ( so they can support and expand to their needs ).

I will log an RFE - and certainly welcome other APEX based ideas for a Rubix rig.
Edited by TwinSnakes007 - Dec. 14, 2023 12:33:16
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
606 posts
Joined: July 2013
Offline
RFE: https://www.sidefx.com/bugs/#/bug/133777 [www.sidefx.com] created
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
7773 posts
Joined: July 2005
Offline
Oh, I had meant an RFE for VEX not as a general thing to do rubix cube
User Avatar
Member
179 posts
Joined: Jan. 2014
Offline
We need a RUBIX cube rig as a default primitive!
I contribute to the beauty of this world
User Avatar
Member
606 posts
Joined: July 2013
Offline
edward
Oh, I had meant an RFE for VEX not as a general thing to do rubix cube

I'm not sure, no, I'm 100% sure I dont follow you at all...

....we can do Rubix logic in Vex already, so "what" would this RFE be requesting?

....a VEX way to do a bounding box selection so that the transform intrinsic's can be modified?
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
215 posts
Joined: June 2023
Offline
He meant a more direct way to call VEX in APEX, not relying on sop::attribvop.

I've submitted a RFE.
User Avatar
Member
7773 posts
Joined: July 2005
Offline
Sorry, yes, that's what I meant. Thanks, Kodra!
  • Quick Links