You cant attach anything to a vertex without loosing GPU parallel functionality. Maya sends calculation data to display the geometry to the GPU. GPU then sends it to your monitor. When you attach anything to a piece of geo, it has to be calculated in the CPU. When this happens, Maya automatically disables GPU functionaliity. This might be what is going on with your rigs
On Sun, May 20, 2018, 7:51 AM Daniele Dolci <[email protected]> wrote: > Hi, > > I built a rig whose speed is between 40 and 50 fps in playback. When I > started to use follicles, even by using a low res driver, the speed goes > down dramatically(to 10-15 fps in playback). Therefore I decided to give it > a try to build my own node to create some kind of vertex constraint. The > idea is to take in a mesh, the index of the vertex to attach the object to, > and outputing the world position of the vertex. > > Unfortunately what I made is even slower than maya's follicles, I was > wondering if there is something obviously wrong I am doing or if that > depends on the fact I used python rather than c++. I attach below the > compute method of the deformer. If anyone could help to optimize it to > speed it up would be great! > > def compute(self, plug, data): > input_geometry = data.inputValue(Vertstraint.input_mesh).asMesh() > > fn_input_geometry = OpenMaya.MFnMesh(input_geometry) > index = data.inputValue(Vertstraint.vertex).asFloat() > > vertex_position = OpenMaya.MPoint() > fn_input_geometry.getPoint(int(index), vertex_position, > OpenMaya.MSpace.kWorld) > > output = data.outputValue(Vertstraint.world_position) > result = OpenMaya.MFloatVector(vertex_position.x, > vertex_position.y, vertex_position.z) > output.setMFloatVector(result) > > data.setClean(plug) > > > Cheers, > Daniele > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/67132225-b25f-4d24-a343-c14e41abcd1a%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/67132225-b25f-4d24-a343-c14e41abcd1a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJAkR62PMLoTRd8bvqzbDdRxiJk%2BZb7ffczdo8_tRLBxCyX1wg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
