Vector, float or int fields of vert object are exported as point cloud attributes with the same identifiers as field names. cmds.pol圜olorSet(createTrue,colorSet'perInst',perInstanceTrue. cmds.pol圜olorSet( queryTrue, currentColorSetTrue ) To create a per-instance color set family with one set member per selected instance. cmds.pol圜olorSet(currentColorSetTrue, colorSet 'color2' ) To query the current color set. Noise texture used as driver for instances scale Python examples import maya.cmds as cmds To set the current color set to be 'color2'. OutPoints = p // scale field is exported as an array Vector p.noise // Now per-point texture values are accessible by this field vector p.scale = p.noise* 3 // Use texture to drive instances scale To access texture values, declare vector field of vert object with same identifier as input array: vert p = inPoints Values are exported to output array under noise identifier: Input to mgAutomata node comes from mgSampler node, which computes texture values for given set of points. If connection made to inPoints contains array of integers named prop, then in order to access those values declare int field of vert variable named prop and perform input operation. The same approach applies to array attributes (inPoints, outPoints). If mesh connected to inMesh attribute of mgAutomata node has vertex color set named colorSet, then in order to access per-vertex colors within a script, declare vector field with the same identifier as a color-set name: vert v = inMesh Įvery vector field of vert variable that is outputted to outMesh attribute is converted to a color set as well: vert p = inMesh Communication with Maya environment is achieved through node attributes:ĭata input from Maya scene to mgAutomata is performed through attributes visible in script scope, under the same identifier as long name of node attribute: vert v = inMesh Ĭomputation results are exposed through node attributes in the same manner: outMesh = v Īs input and output operations of numeric data are straightforward, there are some custom rules for point and mesh data. Communication with Maya environment is achieved through node attributes. Computations of new values are performed within mgAutomata node. 1 for the example network.MGL operates on a point data like position, normal vector, scale or user defined properties. import maya.cmds as mc import pprint sel mc.ls (selectionTrue) for x in sel: mc.select (x, replaceTrue) colorlist mc. Then connect the mentalrayVertexColors node to any shader. You should see a colorSet1… just select it, click “Update” and you should have the property you’re looking for. If you don’t see a lorName property on your mesh, try selecting the mesh, then go to Polygons > Colors > Color Set Editor. In mental ray, you’d create a mentalrayVertexColors node, and connect –> mentalrayVertexColors.cpvSets. If you were to select some vertices and look at their properties in the Component Editor, you should see values attached to the “red” “green” and “blue” vertex attributes.Īll that’s left to do at this point is to connect this color data to a texture that can read it. If you have more than one point attribute exporting from Houdini, you may want to check the script editor to make sure you know which index of AlembicNode.prop you are supposed to be connecting.įinally, make a new mesh node and connect arrayToPointColor.outGeometry –> newMesh.inMesh. Create the arrayToPointColor node, and feed it your geometry (mesh.worldMesh –> arrayToPointColor.inGeometry) and then feed it your data array from the AlembicNode (AlembicNode.prop –> arrayToPointColor.inRgbaPP). There is a node called “arrayToPointColor” that will read an array of data and apply it to the point color of the mesh it’s connected to. The Alembic node, though, still contains that data, as the 0th index of the array “prop.” Now all you have to do is get that data from the Alembic node onto the vertex color somehow… Maya is creating this “Cd” attribute on the mesh, but it has no idea what to do with the data so it throws an error. Error: output_AlembicNode.prop -> subnet1.Cd connection not made // Data types of source and destination are not compatible. That’s when I checked out the script editor in Maya a little more closely and saw this: // Error: line 0: Connection not made: 'output_AlembicNode.prop' -> 'subnet1.Cd'. I tried renaming the Cd point attribute in Houdini to all kinds of things in the hopes that Maya would recognize the data, but Maya wasn’t having any of it. The Alembic node makes that a fairly painless process now that Houdini and Maya both support Alembic import/export, although it turns out that getting any data other than point positions and normals is kind of a hassle. I’m working on a project right now that involves exporting cached geometry from Houdini to Maya.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |