MDGModifier or MDAGModifier based on node type?

132 views
Skip to first unread message

David Lantos

unread,
Aug 2, 2019, 1:15:58 AM8/2/19
to Python Programming for Autodesk Maya
Hi guys,

I'm creating a "createNode(nodeType)" wrapper around maya api 2.0

How can I decide based on node type which one I need to use, MDGModifier or MDAGModifier?

If I use MDAGModifier to create DG node it throws error. I didn't find function that tells me based on type is it DG type or DAG type?

David

Ravi Jagannadhan

unread,
Aug 2, 2019, 10:21:16 AM8/2/19
to python_in...@googlegroups.com
MDGModifier should create DAG nodes right? A DAG node is a DG node, but not all DG nodes are DAG nodes.

Ravi

"There are no dumb questions" - Carl Sagan.
--
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/af2db504-f848-46d4-adda-76645ac382bf%40googlegroups.com.

David Lantos

unread,
Aug 2, 2019, 2:32:03 PM8/2/19
to Python Programming for Autodesk Maya
Obviously I tried to create a dg node with DAGModifier but it throws error ("Invalid node type"). Which makes sense to me since maya api it's really low level stuff so it tries to create the dag node part but the type doesn't allow it.


2019. augusztus 2., péntek 7:21:16 UTC-7 időpontban Ravi Jagannadhan a következőt írta:
MDGModifier should create DAG nodes right? A DAG node is a DG node, but not all DG nodes are DAG nodes.

Ravi

"There are no dumb questions" - Carl Sagan.

On Aug 1, 2019, at 22:15, David Lantos <dlan...@gmail.com> wrote:

Hi guys,

I'm creating a "createNode(nodeType)" wrapper around maya api 2.0

How can I decide based on node type which one I need to use, MDGModifier or MDAGModifier?

If I use MDAGModifier to create DG node it throws error. I didn't find function that tells me based on type is it DG type or DAG type?

David

--
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.

David Lantos

unread,
Aug 2, 2019, 2:36:38 PM8/2/19
to Python Programming for Autodesk Maya
Coding wise: With MDGModifier you can't create DAG node since it's a base class of MDAGModifier. With higher level you might can create lower level stuff.


2019. augusztus 2., péntek 7:21:16 UTC-7 időpontban Ravi Jagannadhan a következőt írta:
MDGModifier should create DAG nodes right? A DAG node is a DG node, but not all DG nodes are DAG nodes.

Ravi

"There are no dumb questions" - Carl Sagan.

On Aug 1, 2019, at 22:15, David Lantos <dlan...@gmail.com> wrote:

Hi guys,

I'm creating a "createNode(nodeType)" wrapper around maya api 2.0

How can I decide based on node type which one I need to use, MDGModifier or MDAGModifier?

If I use MDAGModifier to create DG node it throws error. I didn't find function that tells me based on type is it DG type or DAG type?

David

--
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.

Marcus Ottosson

unread,
Aug 5, 2019, 2:59:31 PM8/5/19
to python_in...@googlegroups.com

I’ve also hit this issue; as far as I know, there’s no way to query the type of node without first creating it. :( I initially resorted to something along the lines of..

try:
  mod = MDGModifier()
  mod.createNode("transform")  # Fail
except:
  mod = MDagModifier()
  mod.createNode("transform")  # Success

But my particular case was performance sensitive and had many hundreds of calls, so this didn’t sit right. I eventually resorted to calling the appropriate modifier based on the node I was making. If anyone knows otherwise, I would also very much like to know!


On Fri, 2 Aug 2019 at 19:36, David Lantos <dlan...@gmail.com> wrote:
Coding wise: With MDGModifier you can't create DAG node since it's a base class of MDAGModifier. With higher level you might can create lower level stuff.

2019. augusztus 2., péntek 7:21:16 UTC-7 időpontban Ravi Jagannadhan a következőt írta:
MDGModifier should create DAG nodes right? A DAG node is a DG node, but not all DG nodes are DAG nodes.

Ravi

"There are no dumb questions" - Carl Sagan.

On Aug 1, 2019, at 22:15, David Lantos <dlan...@gmail.com> wrote:

Hi guys,

I'm creating a "createNode(nodeType)" wrapper around maya api 2.0

How can I decide based on node type which one I need to use, MDGModifier or MDAGModifier?

If I use MDAGModifier to create DG node it throws error. I didn't find function that tells me based on type is it DG type or DAG type?

David

--
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.

--
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/2f72eec9-c79a-4dd1-ae11-34d4767d1bc7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages