Example #1
0
def complete_parameter_dict(obj, dict):
    d = dict

    if isinstance( obj, anim.Animation ) or isinstance( obj, controller.Controller ) or \
           (isinstance(obj,type) and issubclass(obj,controller.Controller)):
        if 't' not in dict:
            d = dict.copy()
            d['t'] = 0.0

    elif isinstance(obj, tuple):  # GL diagram
        d = dict
        for i in obj[1]:
            if i[0] not in d:
                if d is dict:
                    d = dict.copy()
                d[i[0]] = i[-1]

    elif callable(obj):  # regular diagram
        d = dict
        for i in parameters.analyze_diagram_parameters(obj):
            if i[0] not in d:
                if d is dict:
                    d = dict.copy()
                d[i[0]] = i[-1]

    else:
        raise ValueError, ('complete_parameter_dict on object', obj)

    return d
Example #2
0
def complete_parameter_dict( obj, dict ):
    d = dict
    
    if isinstance( obj, anim.Animation ) or isinstance( obj, controller.Controller ) or \
           (isinstance(obj,type) and issubclass(obj,controller.Controller)):
        if 't' not in dict:
            d = dict.copy()
            d['t'] = 0.0
        
    elif isinstance( obj, tuple ):     # GL diagram
        d = dict
        for i in obj[1]:
            if i[0] not in d:
                if d is dict:
                    d = dict.copy()
                d[i[0]] = i[-1]
        
    elif callable( obj ):              # regular diagram
        d = dict
        for i in parameters.analyze_diagram_parameters(obj):
            if i[0] not in d:
                if d is dict:
                    d = dict.copy()
                d[i[0]] = i[-1]

    else:
        raise ValueError, ('complete_parameter_dict on object', obj)

    return d
Example #3
0
def get_object_params( obj ):
    if isinstance( obj, anim.Animation ):
        return [('t', parameters.SCALAR, 0.0)]

    elif isinstance( obj, controller.Controller ) or (isinstance(obj,type) and issubclass(obj,controller.Controller)):
        return [('t', parameters.SCALAR, 0.0)]

    elif isinstance( obj, tuple ):
        return [i[:3] for i in obj[1]]
    
    elif callable( obj ):
        return parameters.analyze_diagram_parameters( obj )

    else:
        raise ValueError, ('get_object_params on object', obj)
Example #4
0
def get_object_params(obj):
    if isinstance(obj, anim.Animation):
        return [('t', parameters.SCALAR, 0.0)]

    elif isinstance(obj, controller.Controller) or (isinstance(
            obj, type) and issubclass(obj, controller.Controller)):
        return [('t', parameters.SCALAR, 0.0)]

    elif isinstance(obj, tuple):
        return [i[:3] for i in obj[1]]

    elif callable(obj):
        return parameters.analyze_diagram_parameters(obj)

    else:
        raise ValueError, ('get_object_params on object', obj)