Bifrost scattering positions

Bifrost scattering positions

InvisioMedia
Contributor Contributor
2,484 Views
10 Replies
Message 1 of 11

Bifrost scattering positions

InvisioMedia
Contributor
Contributor

Hi,

 

  is it possible to scatter pre-defined models to pre-defined positions in Bifrost from json data?  It is important for me to be able to scatter items with ID's with specific matrices, i.e. object_A needs to go on specific points, etc.

 

  At the moment I am using Ian Waters' workflow in MASH. 

http://ianwaters.co.uk/wp/mash/setting-mash-point-positions-with-json/

It also has the advantage that you can edit the items after the fact as well, but I am thinking Bifrost could be a more powerful solution for this?  

 

Thanks for your help!

 

 

0 Likes
2,485 Views
10 Replies
Replies (10)
Message 2 of 11

syracoj
Autodesk
Autodesk

not sure. 

 

you could wrap up in a compound a system that scatters points (on a read-in alembic) and distributes objects (also alembics) based off of ID's using instances. If you export that compound it will be exported as a json file. Perhaps this will offer a recipe you could use to edit the json to extend the graph. I'll have to try it myself to look at the data you get in the json. It may not work for what you need.

 

another thing that could provide some insight is when you create a graph if you select the nodes in the graph and do cntrl + c to copy you can past in a text editor and it will give you a type of markup of that graph. Perhaps this could be useful.

 

 

 

0 Likes
Message 3 of 11

InvisioMedia
Contributor
Contributor

Hi Syracoj, thanks for your answer and help.

  The json data needs to be used as an input rather than an output.  The json files are stored on the network and contain scattering positions of various scenes and instance systems.

 

  I think it could be a great idea to add a node that can read external custom data like this.  The problem with alembic objects in maya is that it's not super easy to read custom attributes coming from (or to) the outside world (other dcc's).  Therefore, it can be hard to store things like which id goes on which point in an imported alembic file - and it will not be easily editable.

 

  Having a node that can store arbitrary data (lists, arrays, multiple vector information, etc) would be very powerful, and you could then easily build it with python like you do with MASH.

 

 

0 Likes
Message 4 of 11

syracoj
Autodesk
Autodesk

AFAIK we don't currently have any input capabilities like that yet.

0 Likes
Message 5 of 11

syracoj
Autodesk
Autodesk

could you upload a sample of the json data with position data so I could take a look and try something?

Message 6 of 11

InvisioMedia
Contributor
Contributor

To bring it to the most simple form, it would be like this - an asset and an xform

 

[
	{
		"asset": "BoxA",
		"xform": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0]
	},
	{
		"asset": "BoxA",
		"xform": [0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0]
	},
	{
		"asset": "SphereA",
		"xform": [5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0]
	},
	{
		"asset": "SphereA",
		"xform": [5.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0]
	}
]

However, for the sake of making it as powerful as possible, the best solution I think (for the future) should be a Bifrost node that can hold custom data, and accessible with python and other bifrost nodes.  So for example, it could store anything that would be accessible in the graph in the form of attribute / property, just like an excel sheet would do.

 

Thank you!!  : )

 

 

 

 

 

 

0 Likes
Message 7 of 11

InvisioMedia
Contributor
Contributor

A good idea in this case would be to replace SphereA

"asset": "SphereA"

 by a full maya dag path, but really the idea is just to feed predefined data in the bifrost graph that is not a maya object in the scene, but more abstract information (with python for example).  

0 Likes
Message 8 of 11

syracoj
Autodesk
Autodesk

I will forward this forum discussion to design for further analysis and consideration.

0 Likes
Message 9 of 11

InvisioMedia
Contributor
Contributor

Thank you

 

 

 

0 Likes
Message 10 of 11

syracoj
Autodesk
Autodesk

we do have schemas that are json based. I wonder if it would be possible to build a custom schema that could handle this for you.

 

to give you a peak of the schemas look in the bifrost install directory under:

C:\Program Files\Autodesk\Bifrost\Maya20##\bifrostVersion\bifrost\resources\bif\schema

In this ^ dir there are json files that describe certain schemas (point.json for example)

 

in bifrost there is a node called create_object_from_schema where one can input a schema (on disk) into the nodes input path and construct a bifrost object from it.

 

If this doesn't work, perhaps future work for the functionality you need could be done here around schemas. Or perhaps design will come up with a better solution (as they often do).

 

just something I wanted to run by you anyways to let you know it's there.

Message 11 of 11

InvisioMedia
Contributor
Contributor

Oh..!  Yes exactly, very interesting!  It's not complicated for me to change the json data encoded form, I will look into this.  Thanks again!

0 Likes