Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Outputting "instancing data" from Bifrost compatible with the regular Maya instancer node

20 REPLIES 20
Reply
Message 1 of 21
jimmi.gravesen
2695 Views, 20 Replies

Outputting "instancing data" from Bifrost compatible with the regular Maya instancer node

Hi there.

 

Is there(or if not could there) any way to somehow construct a Bifrost output which is compatible with the, "inputPoints" plug on the good old Maya "instancer" node(used for nParticle instancing and MASH)?

(seemingly an named array of position, orientation, id and age data)

Maya has not been happy with my inital attempts, so I figured I would ask more knowlegable people if they had any ideas 🙂

 

At the moment its not possible to supply "custom shape nodes" to the Bifrost instancing, and the only way to instance out "assets" is if you use Arnold and the "render archive instancing", which makes a lot of sense as I imagine it being quite complicated.

 

Being able to output data to be used by the "instancer" node could support quite a few cases out there.

It would make it possible to use Bifrost to create instances of "standin/proxy/procedual" nodes for renderers other than Arnold, together with other 3rd party alembic/USD based solutions, as they often have support for that particular node.

(especially nifty if the old instancer node would support "custom draw calls" for the viewport, but thats an issue for another day, I guess for now placerholder geo could be used inside Bifrost if needed).

 

At least as a temporay solution until a more "bifrost integrated" approach is created I hope it makes sense?.

 

Jimmi

 

 

 

Tags (2)
Labels (1)
20 REPLIES 20
Message 2 of 21

Hi Jimmi,

 

The unfortunate short answer is that it's not currently possible. 

 

We'll consider this to see if it's a low hanging fruit. I suspect that the best way to integrate it would be make the Bifrost points type translatable to Maya - with position, orientation, scale, etc. That way you could create a Bifrost point cloud using particles or scattering or whatever, and then use the Maya instancer with it. It would not support everything Bifrost instances do however. 

 

Thanks for the suggestion,

Jonah

Jonah Friedman
Bifrost Product Manager
Message 3 of 21

Thanks for you reply Jonah.

 

I had my suspisions that it wasnt currently possible, but you never know, much is happening with Bifrost these days 🙂

 

A generic solution for returning point/vector, float/double and int arrays would be lovely.

We need more than just points as we would also like to handle ID assignments and perhaps also "age" inside Bifrost.

Would also make it easier to pipe Bifrost awesomeness into other more "traditional maya" solutions.

 

The instancer node's "GenericArray" type plug is a bit of a funky one, but I guess its Maya's answer to a named array. So if its the official way of handling that in Maya then I guess supporting array of array outputs from Biforst would be generic enough.

If its a bit to "special" then at least with the individual array outputs we could create a little node outside bifrost to combine them ( though, out of the box is always better 🙂 )

I was considering if I could hack the data into a "mesh" in bifrost, output it and then though another node in Maya extract it and recombine it into instancer compatible data, but that is just dirty and nasty.

 

There is so much that can be done in Bifrost for scattering that it having it work with existing solutions would immidiately open up for a tonne of usage scenarios for us. An fully integrated solution would off cource allow for much more control and would be much simpler but I assume its a more ticky task that will take some time.

 

As powerful and cool as Bifrost is now with regards to instancing, its unfortunately serverly limited(for us) as we cant hook it up with our "assets", which in our case is handled though 3rd party plugin nodes (Multiverse).

 

I have seen a few other people mentioning it here and there for similar situations(vray Proxy/scene nodes) and currently Bifrost also wont work with the upcoming ADSK maya-usd plugin nodes either(Alembics seems to be the goto for Bifrost so I guess integrated USD support is not around the corner?).

 

Instancer node "support" would enable that strait away, as many renderers and systems have support for MASH and particle instancing.

 

Hope it turns out to be one of the lovely low hanging fruits, for us at least it would be a great intermediate solution 🙂

 

Thanks,
Jimmi

 

 

Message 4 of 21

I was playing around a bit with Bifrost and figured that I would do a quick "hack" in order to if I could get instancing info out of Bifrost into a Maya instancer node.

 

Worked out fine, and this screenshot is 3Delight NSI rendering Multiverse nodes though the Maya instancer, with Bifrost handling the instacing data and drawing preview geo in the viewport.

 

bifrost_instancer_fun.PNG

 

Array outputs from Bifrost is put into those "array-plugs" which are a bit of a pain. The amount of connections needed when doing large amounts of instancing is a bit silly not to mention the scenario of changing instance counts being impossible.

"bifrostGeo" can be output as Mayamesh though the converter node and I figured that it be somewhat more efficient.

 

In my test above, I connect in preview geometry for our assets and use bifrost to create instacing data and to display it in the VP.

Inside Bifrost I pack that data into a mesh struture(position->VertexPoints, ID->U(v), orientation->vertex_color, scale->normals(with a multiplier as they get normalized) while keeping it a "valid mesh") which I then pass out into Maya converting it to a mesh though the BifrostGeoToMaya node.
I then wrote a little Maya node to extract the data from an MFnMesh input and output the "genericArray" that the MayaInstancer requires.
That is then connected to an instancer node together with the "asset objects" corresponding to the preview geos used.
Now fully compatible with our current pipeline and can also be rendered with most things out there.

 

This was a little "I wonder if its possible" thing, but going though a Mesh is obviously not the ideal scenario 🙂

 

Being able to just output Bifrost (Point,Int,Vector,Float)-arrays into M(Point,Int,Vector,Float)Array plugs would make things like that MUCH easier(and efficient).

 

@jonah.friedman , any conclusions to weather or not there are some low hanging fruits on this front?

 

Thanks,
Jimmi

 

Message 5 of 21

Jimmi that is really cool.

I hope we dont have todo that in the future.

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 6 of 21

Ya, me neither 🙂

 

Getting full on generic instacing in Bifrost that is widely supported by renderers and 3rd party plugins seems to be a bit out into the future(and a tricky one at that).

 

Hopefully my little experiement shows that a more near term solution using the MayaInstancer would be a useful thing for many.

Now we just need an easier way to get that type of data out of bifrost as the Mesh is obviously not ideal 🙂

 

Bifrost is extremely useful and I find myself wanting to use it for more and more things as I go along.

But very often "getting it out of Bifrost" becomes the primary opstacle 🙂

Message 7 of 21

Hi Jimmy,

 

Really cool experiment! 

 

Sorry, no results yet. I can think of two possible avenues to go to support this. 

 

We could allow translating the points geometry using the bifrostGeoToMaya node, with all the properties set up to use with the Maya instancer. Alternatively, we could support the mArrays as you suggest. 

 

Could I see what your graph looks like in the Maya node editor? 

Jonah Friedman
Bifrost Product Manager
Message 8 of 21

Thanks Jonah.

 

Here is the node editor graph (did a slight cleanup of things after posting my initial attempt, but concept is the same and cleaner)

bifrost_instancer_graph.PNG

 

Translating "points" geometry would by far be the most userfriendly for people. Then they avoid having to write the node that creates the mayainstancer data and to do the data wrangling inside bifrost.

 

Personally I would really love to have the mArrays available also. I've got a few other cases where Im using Bifrost for generating some data I need outside Bifrost.

At the moment I'm passing that data out by combining values into a string and then outputting that. Its simple, but slow and doesnt scale.

I will have to rely on the current "array outputs" once I run stuff on full production stuff, which is fine but not ideal.

Message 9 of 21

Jimmi are you instancing USD files?

Or why are those nodes called UsdImporter?

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 10 of 21

We are using a 3rd party plugin setup called "Multiverse".

https://j-cube.jp/solutions/multiverse/

 

Which uses USD as its underlying structure.

 

Its the foundation of our pipeline and bridges out to the renderers(in this case for us, 3Delight NSI, but it supports a few others as well), and as you can see its also able to bring USD objects into Maya(which we need until USD is integrated into Bifrost).

 

When building up our instancing asset we render directly the MayaInstancer with NSI, where the MultiverseNodes(loading our full assets) are the instancing "objects" into the node.

Once its done, we publish the "asset"(a forrest would be a case) by exporting the MayaInstancer node to USD via Multiverse. It becomes a USD point-instancer of our full USD compounds (so the full assets).

The published USD file (loaded though multiverse again) is then used in our lighting scenes.

 

USD support in Bifrost would also at some point probably resolve some of these "in-out" issues, but for now other intermediate solutions would be great.

Message 11 of 21
sepu6
in reply to: jimmi.gravesen

Cool Experiment Jimmi. We have the same feeling we want to use it more but since is BF just work with Arnold as this moment we can't really use it, as you said an intermediate solution would be awesome! Until we get a proper SDK 

Message 12 of 21

Nice! I did more less the same thing but with particles, I wrote an arrayMapper Node to take the pointPosition array from Bifrost.

Your system seems more easy and faster.

 

https://forums.autodesk.com/t5/bifrost-forum/set-instance-geometry-and-bifrostgeotomaya/m-p/9517468/...

Message 13 of 21

Hey @jimmi.gravesen any chance I could have a look at the custom node you wrote? It's fallen on my plate to write something similar and I am a rank amateur when it comes to C++
Message 14 of 21
bugsdabunny
in reply to: forrest.brent

I would also love to have Bifrost be able to output instance data

Message 15 of 21
Anonymous
in reply to: jimmi.gravesen

There is a write to pdc file format. Since I couldn't find what this actually does, I hoped it can export particles in maya particles file format.
With heavy experimenting couldn't get it to work at all.
What is that bifrost pdc file format meant to do at this stage ? Who can import this except bifrost itself ?
I would say that it is priority to make bifrost talk back to maya. Even caching if that's easiest and it should be.
What's wrong with nParticles format ?
Or talk to MASH.
Why ? Because not everyone has time to write compounds and graphs at this stage, and more importantly,
to be user friendly.

Message 16 of 21
bugsdabunny
in reply to: Anonymous

I don't know the answer to your pdc format question but you can hook up bifrost output to nParticles https://forums.autodesk.com/t5/bifrost-forum/set-instance-geometry-and-bifrostgeotomaya/m-p/10447566...

Message 17 of 21

Hey there.
For some reason I completely missed your message here, Im really sorry about that.
Did you manage to write up something yourself? If not let me know, and I can try to dig up the plugin code and the bifrost graph stuff for creating the dummy mesh.

After I did my little experiement here we decided to fully skip bifrost for the asset distribution as it was annoying and somewhat slow getting things out this way.

I was hoping to take up this again for our next project, but I can see that there has been no progress and its only Arnold people who can easily bennefit from Bifrost.
But as far as I can see, things are still as before.
Direct output to instancer compatible data would be awesome.
Getting mArray outputs would also be lovely for a more generic capability.

 

@jonah.friedman Any potential news on this front?

Message 18 of 21

I hope USD is goin to fix this. If Bifrost is able to ouput USD data its easier for other render engines to pick it up.

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 19 of 21

Thats true. A USD setup would allow for quite a few nice things on this front.

Though, in my specific case it will still not quite do the trick.
The "nodes" I want "instanced" are not "compatible" with Bifrost data.
In my little hack, placeholder geo is used for Bifrost, but the actual instanced nodes needs to be handled outside Bifrost.
The export to USD PointInstancer definitions will most likely still have to be done externally due to its "custom" nature (or at least I would have to modify the usd output coming from Bifrost).

If bifrost could take connections to custom maya nodes and use their draw calls in the instances then that would simplify a few things at least, but my guess is that would not be on the priority list for quite some time yet.
Lets see what a potential USD implementation would bring us.

That being said, I would still like Bifrost to be able to output "data" in a bit more generic fasion as mentioned in this thread so that it can easily be used together with "other things" in Maya (custom plugins, etc).
Message 20 of 21

The maya Alembic importer now import particles. I've exported a scatter point to alembic and reimported inside maya and i have particles(legacy). You can use instancer  and it works, but i'm not able to do a rotation or a scale. For example, i get an attribute called point_scale that seem not work. I cannot test with an alembic created with Houdini or other softwares to verify if that is a bifrost problem in export or is the alembic in maya that have problem. Someone can test?

it might be an option.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report