Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsupported type on cloned attribute #80

Closed
p0las opened this issue May 28, 2024 · 3 comments
Closed

unsupported type on cloned attribute #80

p0las opened this issue May 28, 2024 · 3 comments

Comments

@p0las
Copy link

p0las commented May 28, 2024

Am I doing it wrong? In this case I cannot copy the attribute.

        import cmdx
        cmds.file(new=True, force=True)
        src_node, src_node_shape = cmds.polyCube()
        dst_node, dst_node_shape = cmds.polyCube()
        attr_name = "test"
        cmds.addAttr(src_node, ln=attr_name, dt="string")

        s = cmdx.encode(src_node)

        print(s[attr_name].type())  # -> kTypedAttribute
        attr2 = s[attr_name].clone(attr_name)
        print(attr2.type())  # -> 4 ?

        d = cmdx.encode(dst_node)
        d.add_attr(attr2)

for some reason, the cloned attribute type is not supported when I add it to the destination node:
TypeError: Unsupported Python type '<class 'OpenMaya.MObject'>'

@mottosso
Copy link
Owner

Hm, unclear. Does it work with any other data type? Does this example work for you?

@p0las
Copy link
Author

p0las commented May 28, 2024

It works in many other cases. I just found this one that broke in our code. I will double check if we use the latest cmdx. we might be behind.

@p0las
Copy link
Author

p0las commented May 28, 2024

tested in the latest release and it works fine. sorry for the false report mate.

@p0las p0las closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants