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

Avoid unnecessary setAttr-commands in Tracer #36

Open
mischakolbe opened this issue Jul 1, 2018 · 0 comments
Open

Avoid unnecessary setAttr-commands in Tracer #36

mischakolbe opened this issue Jul 1, 2018 · 0 comments
Assignees

Comments

@mischakolbe
Copy link
Owner

Currently

with noca.Tracer(pprint_trace=True):
    b.tx = noca.Op.set_range(a.tx)

results in

var1 = cmds.createNode('setRange', name='nc_SET_RANGE_translateX_0_1_0_1_setRange')
cmds.connectAttr('A.translateX', var1 + '.valueX', force=True)
cmds.setAttr(var1 + '.minX', 0)
cmds.setAttr(var1 + '.maxX', 1)
cmds.setAttr(var1 + '.oldMinX', 0)
cmds.setAttr(var1 + '.oldMaxX', 1)
cmds.connectAttr(var1 + '.outValueX', 'B.translateX', force=True)

If min/max/oldMin/oldMax values are not different to default values they should not be traced:

var1 = cmds.createNode('setRange', name='nc_SET_RANGE_translateX_0_1_0_1_setRange')
cmds.connectAttr('A.translateX', var1 + '.valueX', force=True)
cmds.connectAttr(var1 + '.outValueX', 'B.translateX', force=True)
@mischakolbe mischakolbe self-assigned this Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant