Example #1
0
def xxxx(self, context):
    id_data = self.id_data
    p = self.path_from_id()
    p = p[:p.find(".channels")]
    driver_gui = self.id_data.path_resolve(p)
    idx = int(driver_gui.name[3:])
    dm = context.driver_manager
    ed = dm.find(idx)
    if ed is not None:
        sp = context.scene.speaker
        a = getAction(sp)
        a = bpy.data.actions.get(driver_gui.action)
        if a is None:
            return None
        cn = a["channel_name"]
        cn = driver_gui.channel

        if not self.value:
            bpy.ops.dm.remove_driver_var(varname=self.name, dindex=ed.index) #REFACTO
        else:
            channel_list = [ch.name for ch in driver_gui.channels if
                            ch.value and ch.name.startswith(cn)]
            main(driver_gui, context, ed, sp, a, channel_list)

    return None
Example #2
0
def xxxx(self, context):
    id_data = self.id_data
    p = self.path_from_id()
    p = p[:p.find(".channels")]
    driver_gui = self.id_data.path_resolve(p)
    idx = int(driver_gui.name[3:])
    dm = context.driver_manager
    ed = dm.find(idx)
    if ed is not None:
        sp = context.scene.speaker
        a = getAction(sp)
        a = bpy.data.actions.get(driver_gui.action)
        if a is None:
            return None
        cn = a["channel_name"]
        cn = driver_gui.channel

        if not self.value:
            bpy.ops.dm.remove_driver_var(varname=self.name,
                                         dindex=ed.index)  #REFACTO
        else:
            channel_list = [
                ch.name for ch in driver_gui.channels
                if ch.value and ch.name.startswith(cn)
            ]
            main(driver_gui, context, ed, sp, a, channel_list)

    return None
Example #3
0
def wonk(self, context):
    dm = context.driver_manager
    sp = context.scene.speaker
    a = getAction(sp)  # REFACTO
    a = bpy.data.actions.get(self.action)
    if dm is None or sp is None or a is None:
        return None
    p = self.path_from_id()
    '''
    print(p) #REFACTO
    p = p[:p.find(".channels")]
    print(p)
    gui = self.id_data.path_resolve(p)
    if gui is None:
        print("NO GUI")
        return None

    '''
    gui = self
    idx = int(self.name.split("_")[1])
    #ed = dm.find(dm.filter_dic[gui.collection][gui.object][str(gui.array_index)])
    d = dm.find(idx)
    ed = self
    if ed is None:
        return None
    if d._setting_channels:
        return None
    #cn = a['channel_name']
    cn = self.channel
    if self.rna_type.identifier.startswith('SoundDriverChannel'):
        pass
    elif self.rna_type.identifier.startswith('GUIDriver'):
        channel_list = [
            ch.name for ch in ed.channels
            if ch.value and ch.name.startswith(cn)
        ]
        main(self, context, d, sp, a, channel_list)
        # do amplify things etc
        pass
Example #4
0
def wonk(self, context):
    dm = context.driver_manager
    sp = context.scene.speaker
    a = getAction(sp) # REFACTO
    a = bpy.data.actions.get(self.action)
    if dm is None or sp is None or a is None:
        return None
    p = self.path_from_id()
    '''
    print(p) #REFACTO
    p = p[:p.find(".channels")]
    print(p)
    gui = self.id_data.path_resolve(p)
    if gui is None:
        print("NO GUI")
        return None

    '''
    gui = self
    idx = int(self.name.split("_")[1])
    #ed = dm.find(dm.filter_dic[gui.collection][gui.object][str(gui.array_index)])
    d = dm.find(idx)
    ed = self
    if ed is None:
        return None
    if d._setting_channels:
        return None
    #cn = a['channel_name']
    cn = self.channel
    if self.rna_type.identifier.startswith('SoundDriverChannel'):
        pass
    elif self.rna_type.identifier.startswith('GUIDriver'):
        channel_list = [ch.name for ch in ed.channels if
                        ch.value and ch.name.startswith(cn)]
        main(self, context, d, sp, a, channel_list)
        # do amplify things etc
        pass