Showing posts with label alembic. Show all posts
Showing posts with label alembic. Show all posts

Tuesday, 31 January 2023

exporting custom attributes in Alembic to Blender

We use the setattribtypeinfo function to force an attribute to be a color type. Just like Cd usually is.

This will probably streamlined and not necessary in future versions of Blender, but it seems like it is still necessary atm (Jan 2023)

using a point wrangle, set to detail (so it only runs once)

 setattribtypeinfo(0,"point","attributename","color");


here I'm forcing an attribute called attributename to be recognised as a color type & not just 3 floats.
I'm using the rop_alembic output to write the abc file.

Wednesday, 12 October 2022

exporting alembics or fbx from houdini with transforms

 Didn't realise this...and wasted about half an hour figuring it out..
If you, for example, are using a FETCH node or a rivet and need to export an object with the transforms you can a) use the bake animation ROP (must be used in ROP context!) b) click File>export as FBX or Alembic.

For the latter to work, you must place your stuff into a SUBNETWORK, or it will not export correctly. VERY ANNOYING. It's a bit like putting things into a group before exporting an alembic in Maya, just much less obvious.

Thursday, 1 April 2021

attaching nulls to parts of a moving/deforming object. rivet.

At SOP level, select 3 points of the geo you need to attach a rivet to, this is to calculate rotation (if your object/mesh-area is rotating/deforming)

Make a group with these points, call it something like "pivot_group".

 Go up to Object Level and make a Rivet node.
Here, specify the SOP eg - /obj/geo1/object_merge1

and the pivot_group in the Point Group dialog box.


You can now parent a NULL or something else to the rivet. Something I noticed, was the rotation of the null can be a bit offset, and I've been manually adjusting the rotation...

If you're exporting a null for Flame, you might be better off parenting a camera object, as the alembic export seems to ignore the null. Maya will import a null, although it will show up as an invisible point, so again you're probably better off using a camera for this too.

I've been exporting the null using the File-Export-Alembic tool..

Thursday, 22 March 2018

alembic rotation transform

matrix m = primintrinsic(0,'packedfulltransform',@ptnum);@orient = quaternion(matrix3(m)); 


Stole this from odforce. I'm unsure whether it's meant to be in a point or primitive wrangle (and then promoted to the other). I managed to get it working in just a point wrangle..This helps you get rotational values from an alembic'd object (v. handy!)

Thursday, 23 November 2017

multiple colour sets on alembics, for Maya

This probably contradicts something I've written before, but you CAN export multiple colour sets in Houdini, for alembicking. The key is in the attribute creation. Make sure you use an explicit attribute create node, specify a float, of colour type. Oh and make sure it's on the vertices, because Maya. It will now show up along trusty ol' Cd in Maya's Color Set Manager.

Wednesday, 27 September 2017

writing alembics for maya - path attribute

Covered this in an older post, but this is for more straightforward cases when you want to define a group and shape node name for Maya purposes. We do this to avoid multiple shape names in Maya (eg. lots of pSphereShape1's or multiple Houdini Merge listings ; Alembic will take whatever the penultimate node to your ROP-alembic is called!)

In a primitive wrangle, this bit of code will create two text entry boxes, so you can input a group name and a shape name. If you were to call the group "squareGrp" and the name "square", then the resultant hierarchy would be "squareGrp/square/squareShape" in Maya.


string group = chs("MayaGroup");
string name = chs("Name");

group += chs("groupSuffix");
name += chs("geoSuffix");

s@path = group + '/' + name + '/' + name + 'Shape';


Remember to tick the "build hierarchy" box in the ROP-Alembic node & also to tick "use path".

Monday, 22 May 2017

voronoi fracture woes & exporting alembics to maya

Voronoi fracturing is often used to create destruction fx. It also creates a lot of dirty geometry, which leads to pain when exporting your geometry to Maya -

"UVs aren't per-vertex or per-polygon per-vertex, skipping"

 This also plays havok with motion blur and any other vertex attributes you might have in play.

Using a For-Each loop, or For-Each subnetwork (if using the subnetwork, attach a Connectivity SOP first, with a "class" attribute, so the For-Each knows what pieces to run over. You type "class" into the Attriubute field of the ForEach Subnetwork parameter box) use Clean SOPs to fix any nasty geo that might have been generated. You'll want to tick most of the boxes - your mileage may vary with the Non-Manifold option.

This probably won't fix the problem still - the fracturing process can make a lot of stray edges - 2 point primitives, which don't play nice.

drop down a Primitive Wrangle and use this code-
i@vertnum = primvertexcount(0,@primnum);

It creates a variable called vertnum that counts how many vertices you have in each primitive.

Follow this wrangle with a blast that has
@vertnum==2
in it's Group box. This will kill any stray edges & hopefully fixes everything!

Saturday, 3 December 2016

Attribute Reorient & giving animated geo new normals for fur

Sometimes you want to reorient your normals on an object. However when you do it & it turns out that your object is animated, the new normals might not behave as expected. The normals are probably "swimming" and not following the verts/points as you'd expect.
This is because you generally want your animation done AFTER the modelling process and your new normals don't know anything about the transforms that have happened before. Simply timeshifting and attribute interpolating doesn't seem to work.

Fortunately there's a node called Attribute Reorient. It will reorient more than just normals, but so far this is the use I've had for it.

Oh - my problem was having a pre animated alembic. I wanted to alter the normals for fur direction purposes, but the pre-animation was making the normals & thus also the fur behaviour freak out. By using the Attribute Reorient to essentially force new normals onto the animated geo I sorted out my problem! WINNER.
*note* seems like it looks for the vectors in the points section..so make sure your stuff is there!

Friday, 14 October 2016

Exporting simple multiple objects from Houdini to Maya

Assuming... you've duplicated objects around, animated them etc... AND the objects are single mesh things. Eg. a Sphere, a torus.... Not a multi-object thing.

Create a "connectivity" node and set the connectivity type to Primitive. This should be connected to the group of objects you're exporting.

This creates a Primitive attribute which assigns an integer value, based on the object's "shell".
eg. the primitives in Cube 1 might have a value of 0, Cube3 might have a value of 4 or whatever..

Connect a Primitive Wrangle and put in:

s@path = 'fish_GRP/fish_' + itoa(i@class) + '_GEO/fish_'+ itoa(i@class)+'_GEOShape';

where the path attribute created is making a group called "fish_GRP" and objects called "fish_1_GEO" and their respective Maya shape nodes called "fish_1_GEOShape".

It seems necessary to build the complete hierarchy for Maya, otherwise the individual shape nodes are not so easily accessible..

Finally, using a ROP_Alembic node, output your file, making sure that you have
"Build Hierarchy from Attribute" ticked ON, and set to "path".
The other bits are left as default...

Thursday, 6 October 2016

Importing an Alembic Camera from Maya

Create an alembic archive and bring the .abc file in that way.
If you need to scale it to account for Maya's scene scale, make a Null node, scale it as you will & plug the Alembic Archive beneath it.
If you mess about with any frame-time-offsets, be sure to click the Push Parameters to Children button.