Hi! I did something similar in C++ before, and it was pretty fast:
MSelectionList clusterSelList; clusterSelList.add(clusterName+".weightList[0].weights"); MPlug clusterPlug; status = clusterSelList.getPlug(0, clusterPlug); if (!status){ MGlobal::displayError("Failed to get cluster plug!"); return status;} MItMeshVertex vtxIter(meshPath); vtxIter.reset(); for (; !vtxIter.isDone(); vtxIter.next()){ int vtxIndex = vtxIter.index(); double w = phiNew(vtxIndex); status = clusterPlug.elementByLogicalIndex(vtxIndex).setFloat(w); if (!status){ MGlobal::displayError("Failed to set cluster plug!"); return status;} phiNewDoubleArray.append(w); } I also remember prototyping this with the Python API 2.0, and it was pretty fast as well. The above code should be straightforward to convert to the Python API. Let me know if you run into any trouble. On Friday, April 4, 2025 at 9:58:29 PM UTC+3:30 jakeh wrote: > Hey all, > > Reviving an old thread here.. but was there any more information on this > problem? > I'm encountering exactly the same issue in Maya 2024/2025. > > Thanks, > Jake > > On Friday, 10 March 2023 at 23:25:48 UTC mattschiller wrote: > >> I am seeing extreme slow downs when getting/setting weights using point >> indexes in Maya 2023. Especially on getting, 100x slow downs. Using iomode >> improves setting weight speeds to close to 2022 speeds but does not help >> getting. Using open maya gets around this problem in 2023 but open maya and >> setAttr, used in this way, was the same speed in 2022 and below. >> >> In this example, getting the weights takes in the hundredths of second in >> 2022 and 3-5 seconds in 2023. Any one have a clue? Affects all updates of >> 2023. >> >> import maya.cmds as mc >> import time >> >> mc.dgcontrol(iomode=True) >> >> # Build a 30K point plane and cluster >> geo = mc.polyPlane(sx=100, sy=300)[0] >> cluster = mc.cluster(geo)[0] >> >> # Weights >> pnt_count = mc.polyEvaluate(geo, v=1) >> weight_attr = f"{cluster}.wl[0].w[0:{pnt_count-1}]" >> >> # Get weights >> start_time = time.time() >> weight_array = mc.getAttr(weight_attr) >> print('GET Weights Time', time.time() - start_time) >> >> # Set weights >> start_time = time.time() >> mc.setAttr(weight_attr, *weight_array) >> print('SET Weights Time', time.time() - start_time) >> >> mc.dgcontrol(iomode=False) >> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/python_inside_maya/8faece0b-22fc-4e72-9777-bd6537aab1ffn%40googlegroups.com.