convert a string back to a pymel class

159 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Totally Zen

ungelesen,
16.07.2021, 19:40:4416.07.21
an Python Programming for Autodesk Maya
I've
animal_RIG_A001_v001:body_Fur01Shape
Which is of type : <class 'pymel.core.nodetypes.PgYetiMaya'>
I converted it to a string and it looked like this:
'animal_RIG_A001_v001:body_Fur01Shape' type 'str'

Now I need to get this string and go back to the type:
<class 'pymel.core.nodetypes.PgYetiMaya'>


How do I make it come back after I made it to a string?

Neil Roche

ungelesen,
17.09.2021, 05:07:3917.09.21
an Python Programming for Autodesk Maya
You should just pass it back into a PyNode which should instance it back to a class.

import pymel.core as pm

my_class_node = pm.PyNode('animal_RIG_A001_v001:body_Fur01Shape')

Marcelo Vieira

ungelesen,
28.09.2021, 15:52:4628.09.21
an Python Programming for Autodesk Maya
Humm!!!!
I didn't mess with this code anymore, but I'll leave it down and thank you very much, Neil Roche! 
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten