SOP -> Geo COMP -> SOP?

I am just curious…

does anyone know if there’s a way to treat a Geo COMP as a SOP? or really to do anything with a geo comp at all beyond adjusting the xform/pre-xform/copy/display paramaters?

for instance, determining the centroid of a geo comp?

the reason i ask, is that when i import FBX data for models, the different geometry groups are automatically divided into disparate geo comps, within a larger geo comp, and it doesn’t seem possible to do anything to the entire group. because the position of each comp is set using a chop, it’s not even really feasible to go into each geo comp and pull the individual sops out into a new context…

any ideas?

You could add a Null COMP as the parent to the group you want to move. The adjust the position of the Null COMP to translate the entire group. What other operations do you want to do to the group? There is not a simple way to determine the centroid of a Geo COMP yet. What are you attempting to do, maybe a we can help point you in the right direction with a bit more info.

this particular problem came up while building a demo app here…

we’d like to be able to build a system that can import FBX files, and then with a UI, be able to move a camera around between different geometry groups within the fbx.

say for instance we open up a city scene fbx, and we want to highlight certain structures. the camera lookat point and camera distance needs to adjust depending on the position and bounding box size of each geometry group. this could be calculated on the fly if everything was a sop, with bbox expressions, etc.

while not as practical, it would also be cool to be able to perform additional sop operations and deformations on an entire geo comp, like facet, carve, etc.

i totally get it if the internal pipeline just doesn’t work that way, but it would still be cool if there was a “brute force” operator that could retrieve collapsed world-space coordinates from a geo comp.

i can imagine that might be a powerful tool to provide additional effects and procedural geometry on top of complex geo comp chains.

it seems like a work around could simply be to provide an additional fbx import script that doesn’t use CHOPs and Geo COMPs to create a nested network, but instead uses Material SOPs and Merge SOPs to create a self-contained, 1-level-deep network… obviously this would not support imported animations and keyframes! (a reasonable trade-off).

if i had everything as a sop i could perform bbox operations on it. i can’t do this now because the fbx importer sets transforms on the geo comp itself, and not the sop.

The Object Merge SOP is a brute force way to do this. It’ll take into account the COMP transforms when merging the geometry.

i see now… that’s a cool operator. unfortunately though it only lets me merge individual sops (and the maximum is 10), and not entire geo comps.

Hey, you can use wildcards in there, you can even use nested wildcards to do multiple COMPs in a single line.

For example put down a Object Merge SOP, and next to it put down two Geometry COMPs. Change the Torus SOP in one of them to a Box SOP.

Now put / in the first parameter of the Object Merge SOP. Both SOPs are merged.
/ is ‘all nodes inside all COMPs at this level’.

You can do stuff like /geo/ also, which will grab all nodes in COMPs named geo, in any COMP at this level.

So something like container1/geo/torus will be grabbed, but not container1/button1/torus

lol…while you were writing that, i went off and wrote some tscripts to do some processing for me! i’ll post them anyway, i’m sure someone will find them useful… maybe?

hm maybe i’m doing something wrong, but this trick doesn’t appear to work on imported FBX models.

i’ve got a single GEO:Comp from the import, called “model”, with an object merge next to it.

i’ve tried setting the object merge SOP parameter to model//mesh, model//, //, etc… nothing seems to work.

the fbx i’m importing has several geo:comps inside of it, each with a unique name.

Sorry, I forgot to mention you need to specify a Transform Object to get everything transformed into the same space (I just put down a Geometry COMP). Otherwise the SOPs will just come in untransformed.

This seems unnecessary though… I’ll make the default Transform Object be … in future builds.

the SOPs aren’t coming in at all… the wildcard doesn’t seem to work for nested comps. here’s an example.
object_merge_issue.tox (574 Bytes)

Ah, apparently this feature was just added a few weeks ago. Sorry about that (I figured nobody had added features to this node in a while).
I’ll be in the next release, which we are working on getting out ASAP (at least in experimental form).