<s> import math <EOL> from maya import OpenMayaMPx <EOL> from nodefactory_final import ( create_node , NT_DEPENDSNODE , <EOL> float_input , float_output ) <EOL> _deregister_funcs = [ ] <EOL> def make_transformer ( mathfunc ) : <EOL> def inner ( input , scale , frames ) : <EOL> angle = <NUM_LIT> * ( input / frames ) <EOL> return mathfunc ( angle ) * scale <EOL> return inner <EOL> sin = make_transformer ( math . sin ) <EOL> cosine = make_transformer ( math . cos ) <EOL> def register_circler ( plugin ) : <EOL> inputnames = [ '<STR_LIT:input>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> reg , dereg = create_node ( <EOL> NT_DEPENDSNODE , '<STR_LIT>' , <NUM_LIT> , <EOL> [ <EOL> float_input ( '<STR_LIT:input>' , '<STR_LIT>' ) , <EOL> float_input ( '<STR_LIT>' , '<STR_LIT>' , default = <NUM_LIT> ) , <EOL> float_input ( '<STR_LIT>' , '<STR_LIT>' , default = <NUM_LIT> ) , <EOL> float_output ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> affectors = inputnames , <EOL> transformer = sin ) , <EOL> float_output ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> affectors = inputnames , <EOL> transformer = cosine ) , <EOL> ] ) <EOL> reg ( plugin ) <EOL> _deregister_funcs . append ( dereg ) <EOL> def _toplugin ( mobject ) : <EOL> return OpenMayaMPx . MFnPlugin ( <EOL> mobject , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def initializePlugin ( mobject ) : <EOL> plugin = _toplugin ( mobject ) <EOL> register_circler ( plugin ) <EOL> def uninitializePlugin ( mobject ) : <EOL> plugin = _toplugin ( mobject ) <EOL> for func in _deregister_funcs : <EOL> func ( plugin ) </s>
