Node tagging system

110 views
Skip to first unread message

Kenneth Ibrahim

unread,
Mar 29, 2018, 6:46:02 PM3/29/18
to python_in...@googlegroups.com
I'm wondering if anyone can offer any good methodologies for tagging nodes in Maya such that they can be identified and collected by said tags.

The simplest, most obvious method would be to add a string attribute and poll that but I'm thinking there may be other options people have used for good reason (blindData, metadata, etc.).

Looking forward to any suggestions.

--
"God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell

Ravi Jagannadhan

unread,
Mar 29, 2018, 6:47:37 PM3/29/18
to python_in...@googlegroups.com
Metadata, I think is the way to go. It was built for this.

--
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/CAP_aC5ZiBysX7Ytwvt5DRgDaukaHZZZmPNO6EV2VimhSKb%3D8Hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

justin hidair

unread,
Mar 29, 2018, 6:49:38 PM3/29/18
to python_in...@googlegroups.com

Is ‘ these ‘ nodes custom nodes from you or any node from maya ? if it’s the former you can create a dummy yet unique attribute to identify your nodes , if it’s the latter I don’t know maybe message connections mumble ?

 

Sent from Mail for Windows 10

--

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.

Mahmoodreza Aarabi

unread,
Mar 29, 2018, 6:59:39 PM3/29/18
to python_in...@googlegroups.com
There is not enough information about your case can you explain your situation more clearly?!

Because there are bunch of ways to do that


For more options, visit https://groups.google.com/d/optout.
--


Bests,
madoodia

Marcus Ottosson

unread,
Mar 30, 2018, 3:53:51 AM3/30/18
to python_in...@googlegroups.com

Here’s some that I’ve used for various circumstances.

  1. A string attribute, with optional content
    • The attribute name itself can be an identifier, such that you can leverage the wildcard of ls, e.g. cmds.ls("*.mySpecialIdentifier")
    • Or, the contents of the string can be an identifier, e.g. cmds.getAttr("someNode.id") == "mySpecialIdentifier". In this case, it’s a little harder to find/list all that match but can offer a little more generality. Roy over at Colorbleed once put together a fast equivalent of the wildcard approach but for the contents of strings here that mimic the interface for MongoDB queries, which has worked well. E.g. to return all nodes with a special identifier, lsattr("idAttribute", "uniqueIdentifier")
  2. An object set. An object set in Maya is the equivalent of a list in Python and can “contain” nodes by having nodes connected to it. Listing associated nodes is then made via cmds.sets("mySpecialNodes", query=True). An advantage of this is that you can get a visual indication of which nodes are included, along with being able to add elements of e.g. meshes that aren’t as good with metadata themselves. A disadvantage is the somewhat invisible behavior of duplicating member nodes and sometimes unhelpful case of having a lot of members.

Then there’s the somewhat new metadata, but I’ve never managed to penetrate the documentation enough to actually get this working predictably. It seems like a good fit though, especially as it can store metadata not only in nodes but in the scene itself.


On 29 March 2018 at 23:59, Mahmoodreza Aarabi <mado...@gmail.com> wrote:
There is not enough information about your case can you explain your situation more clearly?!

Because there are bunch of ways to do that
On Thu, Mar 29, 2018 at 3:49 PM justin hidair <justin...@gmail.com> wrote:

Is ‘ these ‘ nodes custom nodes from you or any node from maya ? if it’s the former you can create a dummy yet unique attribute to identify your nodes , if it’s the latter I don’t know maybe message connections mumble ?

 

Sent from Mail for Windows 10

 

From: Kenneth Ibrahim
Sent: Thursday, March 29, 2018 11:46 PM
To: python_inside_maya@googlegroups.com
Subject: [Maya-Python] Node tagging system

 

I'm wondering if anyone can offer any good methodologies for tagging nodes in Maya such that they can be identified and collected by said tags.

 

The simplest, most obvious method would be to add a string attribute and poll that but I'm thinking there may be other options people have used for good reason (blindData, metadata, etc.).

 

Looking forward to any suggestions.

 

--

"God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell

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

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


Bests,
madoodia

--
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/CADvbQwJgh-wPbg18R%3DA-kedSQ2eTpYwoGfToRVLVrYviaH6_QQ%40mail.gmail.com.

Kenneth Ibrahim

unread,
Mar 30, 2018, 1:41:17 PM3/30/18
to python_in...@googlegroups.com
Marcus: Thanks for the answers here! I'll look into the link you sent for Roy's implementation. I'll likely not use the object set approach.

Justin: This would be for non-proprietary nodes for the most part.

I was also wondering whether PyMEL offers anything beyond the cmds module that might be suitable for this.

On Fri, Mar 30, 2018 at 12:53 AM, Marcus Ottosson <konstr...@gmail.com> wrote:

Here’s some that I’ve used for various circumstances.

  1. A string attribute, with optional content
    • The attribute name itself can be an identifier, such that you can leverage the wildcard of ls, e.g. cmds.ls("*.mySpecialIdentifier")
    • Or, the contents of the string can be an identifier, e.g. cmds.getAttr("someNode.id") == "mySpecialIdentifier". In this case, it’s a little harder to find/list all that match but can offer a little more generality. Roy over at Colorbleed once put together a fast equivalent of the wildcard approach but for the contents of strings here that mimic the interface for MongoDB queries, which has worked well. E.g. to return all nodes with a special identifier, lsattr("idAttribute", "uniqueIdentifier")
  2. An object set. An object set in Maya is the equivalent of a list in Python and can “contain” nodes by having nodes connected to it. Listing associated nodes is then made via cmds.sets("mySpecialNodes", query=True). An advantage of this is that you can get a visual indication of which nodes are included, along with being able to add elements of e.g. meshes that aren’t as good with metadata themselves. A disadvantage is the somewhat invisible behavior of duplicating member nodes and sometimes unhelpful case of having a lot of members.

Then there’s the somewhat new metadata, but I’ve never managed to penetrate the documentation enough to actually get this working predictably. It seems like a good fit though, especially as it can store metadata not only in nodes but in the scene itself.

On 29 March 2018 at 23:59, Mahmoodreza Aarabi <mado...@gmail.com> wrote:
There is not enough information about your case can you explain your situation more clearly?!

Because there are bunch of ways to do that
On Thu, Mar 29, 2018 at 3:49 PM justin hidair <justin...@gmail.com> wrote:

Is ‘ these ‘ nodes custom nodes from you or any node from maya ? if it’s the former you can create a dummy yet unique attribute to identify your nodes , if it’s the latter I don’t know maybe message connections mumble ?

 

Sent from Mail for Windows 10

 

From: Kenneth Ibrahim
Sent: Thursday, March 29, 2018 11:46 PM
To: python_inside_maya@googlegroups.com
Subject: [Maya-Python] Node tagging system

 

I'm wondering if anyone can offer any good methodologies for tagging nodes in Maya such that they can be identified and collected by said tags.

 

The simplest, most obvious method would be to add a string attribute and poll that but I'm thinking there may be other options people have used for good reason (blindData, metadata, etc.).

 

Looking forward to any suggestions.

 

--

"God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell

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

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


Bests,
madoodia

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

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

For more options, visit https://groups.google.com/d/optout.



--

Kenneth Ibrahim

unread,
Mar 30, 2018, 1:42:41 PM3/30/18
to python_in...@googlegroups.com
I haven't looked into the metadata system yet either other than the overview but it does seem interesting, especially as you point out that it can be used for persistent data in the scene file as well.




--
"God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell

Ravi Jagannadhan

unread,
Mar 30, 2018, 1:44:09 PM3/30/18
to python_in...@googlegroups.com
Yeah, it's why that system was built.

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/CAP_aC5YTEGzgfJEU0qMJB8rQpV74OXhpBqSDthasLB6900H1cQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--

justin hidair

unread,
Mar 30, 2018, 1:49:50 PM3/30/18
to python_in...@googlegroups.com

Wow the set one is pretty cool never though of that , Maya uses sets on some of its node setup so it must be extra legit

 

Sent from Mail for Windows 10

 

From: Marcus Ottosson
Sent: Friday, March 30, 2018 8:53 AM
To: python_in...@googlegroups.com
Subject: Re: [Maya-Python] Node tagging system

 

Here’s some that I’ve used for various circumstances.

1.       A string attribute, with optional content

o    The attribute name itself can be an identifier, such that you can leverage the wildcard of ls, e.g. cmds.ls("*.mySpecialIdentifier")

o    Or, the contents of the string can be an identifier, e.g. cmds.getAttr("someNode.id") == "mySpecialIdentifier". In this case, it’s a little harder to find/list all that match but can offer a little more generality. Roy over at Colorbleed once put together a fast equivalent of the wildcard approach but for the contents of strings here that mimic the interface for MongoDB queries, which has worked well. E.g. to return all nodes with a special identifier, lsattr("idAttribute", "uniqueIdentifier")

2.       An object set. An object set in Maya is the equivalent of a list in Python and can “contain” nodes by having nodes connected to it. Listing associated nodes is then made via cmds.sets("mySpecialNodes", query=True). An advantage of this is that you can get a visual indication of which nodes are included, along with being able to add elements of e.g. meshes that aren’t as good with metadata themselves. A disadvantage is the somewhat invisible behavior of duplicating member nodes and sometimes unhelpful case of having a lot of members.

Then there’s the somewhat new metadata, but I’ve never managed to penetrate the documentation enough to actually get this working predictably. It seems like a good fit though, especially as it can store metadata not only in nodes but in the scene itself.

On 29 March 2018 at 23:59, Mahmoodreza Aarabi <mado...@gmail.com> wrote:

There is not enough information about your case can you explain your situation more clearly?!

 

Because there are bunch of ways to do that

On Thu, Mar 29, 2018 at 3:49 PM justin hidair <justin...@gmail.com> wrote:

Is ‘ these ‘ nodes custom nodes from you or any node from maya ? if it’s the former you can create a dummy yet unique attribute to identify your nodes , if it’s the latter I don’t know maybe message connections mumble ?

 

Sent from Mail for Windows 10

 

From: Kenneth Ibrahim
Sent: Thursday, March 29, 2018 11:46 PM
To: python_in...@googlegroups.com
Subject: [Maya-Python] Node tagging system

 

I'm wondering if anyone can offer any good methodologies for tagging nodes in Maya such that they can be identified and collected by said tags.

 

The simplest, most obvious method would be to add a string attribute and poll that but I'm thinking there may be other options people have used for good reason (blindData, metadata, etc.).

 

Looking forward to any suggestions.

 

--

"God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell

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

--

 

Bests,

madoodia

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


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/CAFRtmOAG%2BoWa7Mtq99%2BXE836wHHpX3BVHyihRTOUtPiAe2jWgw%40mail.gmail.com.

Neil Roche

unread,
Apr 3, 2018, 10:25:35 AM4/3/18
to Python Programming for Autodesk Maya
You could look into creating virtual nodes,  it's a nice way to create your own nodes by sub-classing existing nodes in PyMel.

Kenneth Ibrahim

unread,
Apr 3, 2018, 10:48:39 AM4/3/18
to python_in...@googlegroups.com
I've done a bit of that in the past but definitely worth a revisit. Thx for the suggestion.

For now I've chosen to use a simple enum attribute on nodes with a suite of functions utilizing that.

On Tue, Apr 3, 2018 at 7:25 AM, Neil Roche <ne...@milk-vfx.com> wrote:
You could look into creating virtual nodes,  it's a nice way to create your own nodes by sub-classing existing nodes in PyMel.

--
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/14363738-2a4f-4646-b797-024c3c68ea10%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Mark Jackson

unread,
Apr 17, 2018, 1:29:19 PM4/17/18
to python_inside_maya
I keep meaning to dig into Maya's internal metadata implementation as I think there's definitely some scope there to extend the systems we use internally.

String attrs on nodes are great if you have robust code to search and filter them, or if you just want to marker a certain type of node as a controller for example.

If on the other hand you're trying to marker up a rigging system or anything of that nature then the best way we found is to build up an abstract layer over it using message wires and walking those connections. We have a full OpenSource api for this in the Red9 StudioPack that's being used in a lot of studios as their base api for dealing with rig nodes. In fact Brian Venisky from Avalanche went through it in his GDC talk this year. The best thing is that as part of the API there's a ton of custom handlers for dealing with the factory side of the system, that basically means that when the code hits a connected node it looks at a descriptor on that node and returns an instantiated python object of that class, so effectively you can walk a rig as class structures.

There's a series of demos on there from a talk I did at Develop a few years ago which might shed some light on the idea. It's nothing new I hasten to add, but it is now a very robust and mature implementation.


cheers

Mark


On 3 April 2018 at 15:48, Kenneth Ibrahim <kenib...@gmail.com> wrote:
I've done a bit of that in the past but definitely worth a revisit. Thx for the suggestion.

For now I've chosen to use a simple enum attribute on nodes with a suite of functions utilizing that.
On Tue, Apr 3, 2018 at 7:25 AM, Neil Roche <ne...@milk-vfx.com> wrote:
You could look into creating virtual nodes,  it's a nice way to create your own nodes by sub-classing existing nodes in PyMel.

--
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.
--
"God is a metaphor for a mystery that absolutely transcends all human categories of thought. It's as simple as that!" - Joseph Campbell

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

For more options, visit https://groups.google.com/d/optout.



--
-------------------------------------
Mark Jackson
CEO / Technical Director
red9consultancy.com
Reply all
Reply to author
Forward
0 new messages