plain cmds, yeah I could do it with the API but it was just meant as a quick and dirty method, I’ve noticed I can do it inside of Maya by setting color set operation to ‘add’ instead of ‘over’, duplicating all 3 primary sets, and merging them with a new 4th set to get the same outcome without spending much time.(edit) Also: you’re just doing isolated ops on each vertex? Or does processing one vert involve asking questions of others? Code or at least pseudocode would make it much easier to diagnose. The way you do your loops will determine a lot about how much you have in memory at any given time and how long Python will wait before dropping things. If you are really running out of RAM that is the reason things go slow: you’re dropping out of electronic access times in real RAM into mechanical access times for VRAM. For scores of thousands of verts it will be slow and cmds vs api times will start to dominate. If you’re crawling at that size, it’s probably a frankenstein loop that’s generating unneeded work. How big is the mesh in question? For counts in the low thousands (1) and (2) should not matter.Are you thinking about how to manage your loops? If you are generating a lot of long lists – instead of, say, using generators – you’ll be fragmenting memory like crazy.Are you using API calls or just plain cmds? Usually for this kind of thing the API will be significantly faster than cmds.I’m very likely doing this wrong, but the point of this thread isn’t how to achieve what I’m doing, it’s very specifically the questions listed. It takes a very long time and my system barely survives. The description above iterated through each color set as well, I’ve modified it hoping it will aid performance. My script is very specific to what I’m currently working on and it uses hard-coded values to save time. Why does Maya use <20% of my CPU, or more specifically, what is the bottle neck here - I assume RAM speed?Why isn’t it releasing the memory as it goes through each loop, can I force this? What is being stored that has to be kept every iteration, other than the current index…? It shouldn’t use that much memory, right? As I’m posting this Maya is using > 6GB of RAM thats continuously being compressed just to keep it’s head above water. The shader I’m developing takes information from all four (RGBA) channels to use as information for the shader, such as how much shading occurs at each vertex or specularity, the channels aren’t related.įor the heavier meshes, while I do it, it will use my RAM well beyond capacity and windows compresses it as it goes and it takes forever. ![]() The reason for this is that… for one of those kinds of reasons that result in a slow head shake with averted eye contact, Maya can’t paint vertex colors per channel. Vector, float or int fields of vert object are exported as point cloud attributes with the same identifiers as field names.I’m performing a very heavy task that basically goes… for every mesh, for every color set (3 each) on each mesh, shove the specified channels into a new color set by iterating over every vertex in the mesh. Noise texture used as driver for instances scale 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. Computations of new values are performed within mgAutomata node. ![]() MGL operates on a point data like position, normal vector, scale or user defined properties.
0 Comments
Leave a Reply. |