Conversation
|
This is still somewhat fragile; the user can still.. mod.disconnect(a, b)Which would try and disconnect both source and destination connections to both a and b, even if no connections exists. If that's the case, Maya will happily carry on. Until you undo, which is when it'll tell you "hey, something you did at some point in the past was wrong, so now I will throw an exception. Happy hunting." We can address this by testing that an attribute is actually connected before attempting to disconnect it.. but that's somewhat of a rabbit hole. As what really matters is what is connected upon calling So I'm leaving that as-is for now. Hasn't been a problem so far. |
|
Took another crack at this, and oh man. tm = cmdx.createNode("transform")
tm["tx"] << tm["ty"]
with cmdx.DagModifier() as mod:
mod.disconnect(tm["ty"], tm["tx"])
# OKExcept, it's not OK. Maya cares deeply about the order in which you specift the disconnect. Here, it'll try and disconnect |
This fixes #45
I've also moved the
MYPYstatement to below the import statements to make linters happy; but I wonder whether this breaks things for you @benblo?