Hi,
I have a list that I want to update when objects have been added or deleted from the Maya scene.
Is there some kind of global event or perhaps an Outliner event that fires when a change like this happens?
I am working in PyMel. Thank you! :)
--
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,Take a look at scriptJobs. There are events for when DAG nodes are created, and when nodes are deleted. scriptJob is effectively a high level wrapper around MMessage callbacks.Justin
On Mon, Oct 10, 2016 at 9:33 AM Kevin C. Burke <kevin...@gmail.com> wrote:
--Hi,
I have a list that I want to update when objects have been added or deleted from the Maya scene.
Is there some kind of global event or perhaps an Outliner event that fires when a change like this happens?
I am working in PyMel. Thank you! :)
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.
Hi Justin,Thanks a lot for the quick reply!!! I found the event "DagObjectCreated" for when an object is created; am I missing the equivalent for when they are removed?
Thank you!
On Sunday, October 9, 2016 at 1:41:59 PM UTC-7, Justin Israel wrote:Hi,Take a look at scriptJobs. There are events for when DAG nodes are created, and when nodes are deleted. scriptJob is effectively a high level wrapper around MMessage callbacks.Justin
On Mon, Oct 10, 2016 at 9:33 AM Kevin C. Burke <kevin...@gmail.com> wrote:
Hi,
I have a list that I want to update when objects have been added or deleted from the Maya scene.
Is there some kind of global event or perhaps an Outliner event that fires when a change like this happens?
I am working in PyMel. Thank you! :)
--
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/86bb5514-2390-4a7d-b54a-bfe1c3f56e58%40googlegroups.com.
cmds.scriptJob(nodeDeleted=["pCube1",myFunction])
On Mon, Oct 10, 2016 at 9:48 AM Kevin C. Burke <kevin...@gmail.com> wrote:Hi Justin,Thanks a lot for the quick reply!!! I found the event "DagObjectCreated" for when an object is created; am I missing the equivalent for when they are removed?
Thank you!
On Sunday, October 9, 2016 at 1:41:59 PM UTC-7, Justin Israel wrote:Hi,Take a look at scriptJobs. There are events for when DAG nodes are created, and when nodes are deleted. scriptJob is effectively a high level wrapper around MMessage callbacks.Justin
On Mon, Oct 10, 2016 at 9:33 AM Kevin C. Burke <kevin...@gmail.com> wrote:
Hi,
I have a list that I want to update when objects have been added or deleted from the Maya scene.
Is there some kind of global event or perhaps an Outliner event that fires when a change like this happens?
I am working in PyMel. Thank you! :)
--
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%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.
Thanks again for the reply! You've been very helpful.I have a follow-up question...DagObjectCreated will fire when any object is created. Am I correct that I'd need to specify a node for nodeDeleted to fire? e.g.
cmds.scriptJob(nodeDeleted=["pCube1",myFunction])I only ask because it seems very resource-intensive to add a scriptJob to every object in the scene to detect a node deletion.
import maya.OpenMaya as om
def node_added(node, *args):
print "added!", node
def node_removed(node, *args):
print "removed!", node
add_id = om.MDGMessage.addNodeAddedCallback(node_added)
rem_id = om.MDGMessage.addNodeRemovedCallback(node_removed)
Thanks!
On Sunday, October 9, 2016 at 1:54:05 PM UTC-7, Justin Israel wrote:
On Mon, Oct 10, 2016 at 9:48 AM Kevin C. Burke <kevin...@gmail.com> wrote:Hi Justin,Thanks a lot for the quick reply!!! I found the event "DagObjectCreated" for when an object is created; am I missing the equivalent for when they are removed?
Thank you!
On Sunday, October 9, 2016 at 1:41:59 PM UTC-7, Justin Israel wrote:Hi,Take a look at scriptJobs. There are events for when DAG nodes are created, and when nodes are deleted. scriptJob is effectively a high level wrapper around MMessage callbacks.Justin
On Mon, Oct 10, 2016 at 9:33 AM Kevin C. Burke <kevin...@gmail.com> wrote:
Hi,
I have a list that I want to update when objects have been added or deleted from the Maya scene.
Is there some kind of global event or perhaps an Outliner event that fires when a change like this happens?
I am working in PyMel. Thank you! :)
--
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/86bb5514-2390-4a7d-b54a-bfe1c3f56e58%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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/34397c23-08a8-4c86-8106-ff7fb3672fb7%40googlegroups.com.
Justin
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%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/86bb5514-2390-4a7d-b54a-bfe1c3f56e58%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.
This is exactly what I needed, Justin, thank you so much!
Justin
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/86bb5514-2390-4a7d-b54a-bfe1c3f56e58%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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/34397c23-08a8-4c86-8106-ff7fb3672fb7%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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1184b5e1-d9f1-42f0-bef6-8bcfc29b533a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3WA2DNs84JGNg2GCSFFz-WN1nBOvyFjgCO8bdNx2XX_A%40mail.gmail.com.
Justin
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/6a3f27b3-02fa-450e-83cf-69c7f200d45c%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/86bb5514-2390-4a7d-b54a-bfe1c3f56e58%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/34397c23-08a8-4c86-8106-ff7fb3672fb7%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/1184b5e1-d9f1-42f0-bef6-8bcfc29b533a%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.