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)--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/67132225-b25f-4d24-a343-c14e41abcd1a%40googlegroups.com.
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c2506d6f-a248-4d5e-8f26-8b3f2b814912%40googlegroups.com.
Hi,The reason why Python nodes are going to slow down your rig is because they are "untrusted".Meaning no other nodes will be evaluated while an instance of this node is evaluated.So even if your Python code is well optimized it will slow down significantly your rig because every node has to wait for the Python node to evaluate before they can compute again.This is happening because of the Global Interpeter Lock.
You can read more about this in the Using Parallel MayaCheers
On 20 May 2018 at 18:08, Daniele Dolci <daniele...@gmail.com> wrote:
Hi,
THanks for the reply. I am actually not querying all the vertices but only one vertex. Also, I am not using an high res mesh to do this but I have a low res driver with very few vertices, that is why I think i am doing something wrong in my code.
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c2506d6f-a248-4d5e-8f26-8b3f2b814912%40googlegroups.com.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CANC2f3QQL1dKrs86B_DG8os6ipMHkMrpXaqJ6qqHvaz2tJFYwg%40mail.gmail.com.
On Mon, May 21, 2018, 4:16 AM Fuzes Marcell <fuzes....@gmail.com> wrote:Hi,The reason why Python nodes are going to slow down your rig is because they are "untrusted".Meaning no other nodes will be evaluated while an instance of this node is evaluated.So even if your Python code is well optimized it will slow down significantly your rig because every node has to wait for the Python node to evaluate before they can compute again.This is happening because of the Global Interpeter Lock.Is that really the case for all nodes or just for nodes implemented in Python? If it really is because of the GIL then I would think C++ nodes could continue to evaluate in Parallel.
Cheers,
Daniele
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0046a4ef-22d8-4962-a3a8-badc640cb5aa%40googlegroups.com.
If you’d rather use an existing node to solve your problem, try selecting a vertex and hit Particles -> Emit from Object. It will create, amongst other things, a geoConnector which will provide you with the vertex position in worldspace. You can delete the other nodes and, optionally, recreate the node and its connections via Python if you’d rather skip the delete step.
I believe every node has to wait for the Python node.But Raffaele has two great videos about Maya evaluation in which he also talks about why Python nodes should be avoided.This is the time stamp where he specifically talks about Python nodesThese are the two videos in which he explains the Maya graph evaluation.I highly recommend these videos as I think he does a good job at explaining everything!Hope this helps!Cheers
On 20 May 2018 at 23:27, Daniele Dolci <daniele...@gmail.com> wrote:
For me it is not really clear indeed. Although I will try to rewrite it in c++.
In the meanwhile if you find anything useful please keep me posted.
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 python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0046a4ef-22d8-4962-a3a8-badc640cb5aa%40googlegroups.com.
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CANC2f3QwAX892asdAfCdf%3DC-K5Tr1eu%2BbAkw0VC9fZU5bfVx_Q%40mail.gmail.com.
I know Raffaele videos, already watched them, I don't remember the part about python nodes though. Will watch again.
Is the geo connector faster than follicle?
Cheers,
Daniele
Is the geo connector faster than follicle?
You tell me!
Per discussion above, from 2016-on, they’ve confirmed (and I’ve seen first hand) they drop the evaluation graph back to a single thread during evaluation (which you can confirm for yourself by profiling the evaluation of your rig)
Any idea whether the MAYA_RETAIN_PYTHON_GIL has any effect on this?
Having been in touch with the Autodesk devs directly, I no longer use any Python-base scripted-plugin-based nodes since Maya 2015 (Maya 2016 introduced the multithreaded evaluation graph): Per discussion above, from 2016-on, they've confirmed (and I've seen first hand) they drop the evaluation graph back to a single thread during evaluation (which you can confirm for yourself by profiling the evaluation of your rig), based on Python's GIL : I still make scripted plugin based commands, they're fine. But if you want a performant plugin-based node, you needs to be making it via the c++'s.BTW, this makes me personally sad since I love Python, but I completely understand the reason behind it: Python as Maya implements it simply isn't multithreaded.
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ce992caf-1964-4e7d-a96d-b126c8e5a923%40googlegroups.com.
Having been in touch with the Autodesk devs directly, I no longer use any Python-base scripted-plugin-based nodes since Maya 2015 (Maya 2016 introduced the multithreaded evaluation graph): Per discussion above, from 2016-on, they've confirmed (and I've seen first hand) they drop the evaluation graph back to a single thread during evaluation (which you can confirm for yourself by profiling the evaluation of your rig), based on Python's GIL : I still make scripted plugin based commands, they're fine. But if you want a performant plugin-based node, you needs to be making it via the c++'s.BTW, this makes me personally sad since I love Python, but I completely understand the reason behind it: Python as Maya implements it simply isn't multithreaded.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ce992caf-1964-4e7d-a96d-b126c8e5a923%40googlegroups.com.
On Mon, May 21, 2018, 4:48 PM AK Eric <war...@sbcglobal.net> wrote:Having been in touch with the Autodesk devs directly, I no longer use any Python-base scripted-plugin-based nodes since Maya 2015 (Maya 2016 introduced the multithreaded evaluation graph): Per discussion above, from 2016-on, they've confirmed (and I've seen first hand) they drop the evaluation graph back to a single thread during evaluation (which you can confirm for yourself by profiling the evaluation of your rig), based on Python's GIL : I still make scripted plugin based commands, they're fine. But if you want a performant plugin-based node, you needs to be making it via the c++'s.BTW, this makes me personally sad since I love Python, but I completely understand the reason behind it: Python as Maya implements it simply isn't multithreaded.Python as CPython implements it simply isn't multithreaded ;-)
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/67132225-b25f-4d24-a343-c14e41abcd1a%40googlegroups.com.
Hi,
Hi,This is why I created a low res driver and I have hidden it from the viewport. if both the low res driver and the controls are hidden, only the high res mesh will be evaluated.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a1d5775a-371b-4a22-bf0e-e9be837eef42%40googlegroups.com.