Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
MapMetadata{
	"geo1version":  IntMetadata(2)
	MapMetadata{
		"children": MapMedata
              "fooNode1": MapMetadata
                          "geo": MeshMetadata(), //This is the render/preview geo geo

		"cloth": MeshMetadata(), //If the mesh is a cloth mesh then fill this entry instead the geo

		"jointIndices": (optional)
		ArrayMetadata[
                          "cloth" BoolMeatadata // set to true if this is a cloth mesh
                          "material": MapMetadata
                                           "color": Vector3Metadata // Color used for preview without the textures by the skin mode (optional)
                                           "diffuseTexture": ImageMetadata // Texture used for preview by the skin mode (optional)
                          "attributes": MapMetadata //Custom data. This data is written on the mesh sent to the renderer. You can use these attributes to drive shader attributes from he mesh. The mesh attribute on the arnold/rman/vray mesh will use the atoms_ prefix. (optional)
                                           "atoms": MapMetadata
                                                       "foo_Attr1":...
                                                       "foo_Attr2":...
                                           "arnold": MapMetadata
                                                       "ai...":...
											"rman": MapMetadata
                                                       "...":...
											"vray": MapMetadata
                                                       "...":...
                                           ....
                        "primVars": MapMetadata:
                                           "myVar": MapMetadata
                                                       "interpolation": StringMetadata (constant/uniform/vertex/faceVarying).
                                                       "data: Metadata
                                           "arnold": MapMetadata
                                                       "ai...":...
                                           ....
                          "matrix": MatrixMetadata
                          "wolrdMatrix": MatrixMetadata
                          "translation": Vector3Metadata
                          "rotation": Vector3Metadata
						  "rotationOrder": IntMetadata
                          "scale": Vector3Metadata
						  "pivot": Vector3Metadata
                          "sets": StringArrayMetadata
                          "jointIndices": ArrayMetadata // skin joint ids per vertex, this must have the same length of the points array
								IntArrayMetadata(), // array of joint (influence) indices for the current vertex
								IntArrayMetadata(),
								...
		],

		
                          "jointWeights": (optional) 		ArrayMetadata[ // skin joint weights per vertex, this must have the same length of the points array
								DoubleArrayMetadata(), // array of joint (influence) weight for the current vertex
								DoubleArrayMetadata(),
								...
		],

		
                          "blendShapes": ArrayMetadata // Blend shapes data (optional)
		ArrayMetadata[
							MapMetadata{
										"id":IntMetadata(), // index of the current blend shape, this index is used at render/preview time to get the target weight from the agent metadata
										"name":StringMetadata(), // name of the target
										"P":Vector3ArrayMetadata(),
										"N":Vector3ArrayMetadata()
					},
				MapMetadata{
										"id":IntMetadata(),

										"name":StringMetadata(),

										"P":Vector3ArrayMetadata(),
										"N":Vector3ArrayMetadata()
			},
						...
		],

		"atoms":
		MapMetadata{ //Custom data. This data is written on the mesh sent to the renderer. You can use these attributes to drive shader attributes from he mesh. The mesh attribute on the arnold/rman/vray mesh will use the atoms_ prefix. (optional)
			"fooattr":DobuleMetadata(),
			"fooattr1":StringMetadata(),
			...
		},
		"arnold":
		MapMetadata{ // These attributes are converted to arnold polymesh node attributes (optional)
			"fooattr":DobuleMetadata(),
			"fooattr1":StringMetadata(),
			...
		},
		"rman":
		MapMetadata{ // These attributes are converted to rman mesh node attributes (optional)
			"fooattr":DobuleMetadata(),
			"fooattr1":StringMetadata(),
			...
		},
		"vray":
		MapMetadata{ // These attributes are converted to vray mesh node attributes (optional)
			"fooattr":DobuleMetadata(),
			"fooattr1":StringMetadata(),
			...
		}

		"xgen_Pref":Vector3ArrayMetadata(), // xgen pref point attribute (optional)
		"__Pref":Vector3ArrayMetadata(), // renderman pref point attribute (optional)
		"__WPref":Vector3ArrayMetadata(), // renderman wpref point attribute (optional)
		"__Nref":Vector3ArrayMetadata(), // renderman nref point attribute (optional)
		"__WNref":Vector3ArrayMetadata(), // renderman nwref point attribute (optional)


		"color":Vector3Metadata(), // Color used for preview without the textures by the skin mode (optional)
		"colorTexture":ImageMetadata(), // Texture used for preview by the skin mode (optional)
		"specularColor":Vector3Metadata(), // Specular color used for preview without the textures by the skin mode (optional)
		"specularColorTexture":ImageMetadata(), // Specular texture used for preview by the skin mode (optional)
	},

	"geo2":
	MapMetadata{...},
		
	"geo3":
	MapMetadata{...},

	...
}
                          "children": MapMetadata
                                         "fooChildNode1": MapMetadata
                                                       "geo": MeshMetadata
                                                       ...
                                         "fooChildNode2": MapMetadata
                                                       "geo": MeshMetadata
                                                       ...



To register the new loader to atoms:

Code Block
languagecpp
extern "C"
{
	ATOMSPLUGIN_EXPORT bool initializePlugin()
	{
		MeshLoaderFactory& factory = MeshLoaderFactory::instance();
		factory.registerMeshLoader(FooMeshLoader::staticTypeStr, &FooMeshLoader::creator);
	}
}


Compile

...

the

...

plugin

...

Windows:

In visual studio create a dll projects, add the atoms, tbb and openexr includes and add

BUILD_ATOMSPLUGIN,WIN,_CRT_SECURE_NO_WARNINGS,_CRT_NONSTDC_NO_DEPRECATE,FBXSDK_SHARED

to the preprocessor definitions.Then create another target and link AtomsProcedural instead to link Atoms.


Linux:

Compile as a shared object adding the atoms, tbb and opendexr includes and BUILD_ATOMSPLUGIN to the preprocessor definitions.

Then create another target and link AtomsProcedural instead to link Atoms.


Use the plugin

Add to the ATOMS_PLUGINS_PATH environment variable , the folder where the library compiles against Atoms is located, while add to the ATOMS_PROCEDURAL_PLUGINS_PATH env variable the path where the library compiled against AtomsProcedural plugin is located.