Jump to content
toadstorm

Houdini Alembic export to Maya, with instancing

Recommended Posts

I'm trying to export an ABC from Houdini with instancing enabled. I have a bunch of regular packed primitives with a Cd attribute on the points, and they're being written out to disk just fine. Instancing on the Alembic ROP makes these files very manageable.

However, when loading these in to Maya via the VRayMesh proxy loader, the Cd attribute isn't detected as a color set. Additionally, in Houdini, if I try to read this Alembic back in, the Cd attribute is gone, even after unpacking.

I'm using 16.5.439. Anyone have any ideas?

Share this post


Link to post
Share on other sites

if I colour points...didn't work...changed to vertex....worked..(no, didn't test with vray..just a straight abc import)

worked in Maya and also reading back in Houdini, I'm using Apprentice so cannot do an abc sequence....only 1 frame.

(for reading back into Houdini, colour point was enough to work....but not with Maya, Maya needs it on vertex)

InstanceColouredBoxes.jpg

Edited by Noobini

Share this post


Link to post
Share on other sites

Thanks for taking a look, but what I meant was getting per-instance attributes to export. In order for instancing to work for the Alembic export, I need to export packed geometry, but if I want those instances to have arbitrary attributes of their own (like @Cd), Houdini doesn't seem to be able to export them. I'm suspecting after looking at more of the Alembic specification that this sort of thing just isn't supported, though I wonder if someone's found a workaround?

Share this post


Link to post
Share on other sites

yes I 'pack and instance' on my copy...whether that satisfies your condition...I'm not sure

(also since using Apprentice, I can only rclick>save geo...1 frame...so it could be entirely different to an abc ROP ?)

Edited by Noobini

Share this post


Link to post
Share on other sites

Unfortunately not, since the attributes we're talking about would be baked into each instance before packing, which means each instance of a particular color would be unique. I was hoping for a similar workflow to adding a @Cd attribute to packed primitives post-packing and using that to vary copies. The end product is supposed to have hundreds of thousands of instances with many different colors applied, so assigning colors to copies pre-copy operation is not going to be efficient enough.

Share this post


Link to post
Share on other sites

I was playing around with trying to recreate the situation you have described. But I find that Houdini can't write an Alembic file that references instances. When I export the .abc file it is only 2K and unreadble...

Is there some other setup required to export and instance of a packed primitive animation?

ap_toads_instance_packed_problem.hiplc

Share this post


Link to post
Share on other sites

correct me if i'm wrong but i think alembic doesn't support anything else than polygonal geometry with standard attributes (like N, uv...). no instancing, no packed geo, no custom attributes, no anything. And I guess it doesn't really matter as other software packages wouldn't know how to read it anyways.

Share this post


Link to post
Share on other sites
24 minutes ago, davpe said:

correct me if i'm wrong but i think alembic doesn't support anything else than polygonal geometry with standard attributes (like N, uv...). no instancing, no packed geo, no custom attributes, no anything. And I guess it doesn't really matter as other software packages wouldn't know how to read it anyways.

Yeah, I guess I was misreading the flag "use instancing where possible." It's just data de-duplication in Alembic. So it looks like there's no easy solution to this problem.

Share this post


Link to post
Share on other sites

Maybe you can export a particle system into Maya, with the right attributes, and then use the instance tools in Maya to instance your geo (exported as obj, abc and whatnot) ?

Share this post


Link to post
Share on other sites

If you change the deployment from Instance to CopyToPoints the Alembic export node will write them out as individual meshes with the Cd attribute embedded. I don't have Maya but I can see that Blender can detect my @Cd colors when importing an Alembic cache. You do end up with a larger file this way, however.

 

  • Like 1

Share this post


Link to post
Share on other sites

@Atom, The confusingly-named "use instancing" option on the Alembic ROP can leverage packed primitives to keep the file size down. If I weren't using packed prims, getting color sets and other vertex data would be no big deal, but I'm dealing with a situation that involves hundreds of thousands, possibly millions of copies, so the resulting Alembic would end up way too heavy. 

@StepbyStepVFX I'd definitely do this if Maya's Alembic build supported particles, but as is typical with Maya they're years behind in their implementation. Unless they've updated something very recently, it's impossible to get particles into Maya via Alembic.

Share this post


Link to post
Share on other sites
16 hours ago, toadstorm said:

@StepbyStepVFX I'd definitely do this if Maya's Alembic build supported particles, but as is typical with Maya they're years behind in their implementation. Unless they've updated something very recently, it's impossible to get particles into Maya via Alembic.

Forget about importing the particles as Alembic : seems you can use the Houdini Engine, importing an HDA that contains a file SOP pointing toward a bgeo file that contains the particles.

From there, you can instance objects on your particles directly into Maya (it seems that importing that HDA through Houdini Engine creates a classic Nucleus particle system, from what I see on the video below) :

 

 

 

Edited by StepbyStepVFX

Share this post


Link to post
Share on other sites

Has anyone figured out any workarounds to get instanced packed pieces out to Alembic and into Maya?  It seems to have been a consistent problem for quite a while, and I've still not seen any decent ways of handling it.

In many cases these caches are being passed off to lighters that don't want to or can't mess with Houdini Engine, and I assume the cloud rendering services that lighters are likely to use won't support Engine either.  I suppose one could potentially get the points into Maya via Engine, then do an nCache and add instances to that, but that's a painfully awful workflow.  And that's without factoring in the headache of converting Houdini's per point matrix or orient to an Euler rotation that (I think) Maya expects, and comparing back and forth to make sure your instancing in Maya matches your instancing in Houdini.

I seem to remember there being a way to export point particles to Alembic if you add a particle system primitive in Houdini before exporting.  You can do this with an Add SOP with 'Add Particle System' turned on.  In the quick test I ran, the resulting alembic creates a Maya particle system on import, and seems to recognize all my custom attributes from Houdini, but doesn't seem to actually contain any points.  Maybe there's a simple step I'm missing to get that to work?

 

Also, if you really do need to build Euler rotations from a quaternion, you can try this painful bit of VEX code from my library of snippets.  In this case I was getting the rotation based on a normal vector direction, but you could directly use @orient instead of the dihedral thing.

vector4 q = dihedral( {0,1,0}, @N );

v@rot = {0,0,0} ;
@rot.x = degrees( atan2(2*(q.w*q.x+q.y*q.z), (1-2*(q.x*q.x+q.y*q.y))) ); 
@rot.y = degrees( asin(2*(q.w*q.y-q.z*q.y)) );
@rot.z = degrees( atan2(2*(q.w*q.z+q.x*q.y), (1-2*(q.y*q.y+q.z*q.z))) );

 

Share this post


Link to post
Share on other sites

From the Alembic 1.7.1 source code:

Quote

printWarning("Reading animated particle data not supported.");

I'm not sure if Autodesk itself uses the same original sources, but it seems so. So I fear there you will have no luck reading an animated sequence. We solved the problem (with Maya 2015) by building our own abc reader plugin which can be connected to a particle instancer what work quite well.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×