Value = cmds.pol圜olorPerVertex(vertex, q = 1, r = 1) # query valueĬmds.pol圜olorSet(colorSet = "tolerance", currentColorSet = 1) # set destination color setĬmds.pol圜olorPerVertex(vertex, r = value) # apply value Vertex = mesh + ".vtx" # build a vertex string, eg mesh.vtxĬmds.pol圜olorSet(colorSet = "shading", currentColorSet = 1) # set source color set If not "tolerance" in cmds.pol圜olorSet(q = 1, allColorSets = 1): # make color set if it doesn't existĬmds.pol圜olorSet(colorSet = "tolerance", create = 1) VtxCount = cmds.polyEvaluate(mesh, vertex = 1) Here is the code: import maya.cmds as cmds I’m interested to hear how I should be doing this where memory usage is concerned, since it will make good reference in the future. 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. So (as in most cases in Maya), multiple methods to achieve a similar effect, depends on your exact needs and preferences how to handle it.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. Or if you create multiple texture tiles and use those as UDIMs, you can randomise the UV tile per instance (with the color node). Or you can use a texture in the base color weight slot and assign the aiUserDataColor directly to the base color. What I wrote earlier: use the aiUserDataColor as input to a texture, you can even do this multiple times and user other color manipulation nodes or texture nodes to change the color and effect. Though I think there are different methods to get a similar result as you are looking for. The color node will never give you more than one color per instance. Once we reach the reproMesh node, this color attribute is written as color per vertex information to the vertices of the repro mesh. The color node creates one color (based on the settings it can be randomised per instance in hue, saturation and value) and passes this color on to the MASH points. The way you expect the color node to work is not how it works as I understand it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |