Example #1
0
    def _maybe_draw_ui_for_voice_style(context: Context, layout: UILayout):
        seq: Optional[KiritanifyScriptSequence] = get_selected_script_sequence(
            context)
        if seq is None:
            return
        setting: KiritanifyScriptSequenceSetting = _script_setting(seq)

        _row = layout.row()
        _row.prop(setting, 'use_custom_voice_style', text='custom_voice')
        _row.operator(KIRITANIFY_OT_ResetVoiceStyle.bl_idname, text='Reset')
        if setting.use_custom_voice_style:
            _row = layout.row()
            _row.prop(setting.custom_voice_style, 'volume')
            _row.prop(setting.custom_voice_style, 'speed')
            _row.prop(setting.custom_voice_style, 'pitch')
            _row.prop(setting.custom_voice_style, 'intonation')
Example #2
0
    def execute(self, context):
        item = context.scene.jewelcraft.measurements.add()

        item.type = self.type

        if self.type == "RING_SIZE":
            if self.object_name:
                item.object = bpy.data.objects[self.object_name]
        else:
            if self.collection_name:
                item.collection = bpy.data.collections[self.collection_name]

        if self.type == "WEIGHT":
            materials = context.scene.jewelcraft.weighting_materials
            mat = materials.values()[int(self.material)]
            item.name = mat.name
            item.material_name = mat.name
            item.material_density = mat.density
        elif self.type == "DIMENSIONS":
            item.name = "{} {}".format(self.collection_name, _("Dimensions"))
            item.x = self.x
            item.y = self.y
            item.z = self.z
        elif self.type == "RING_SIZE":
            size_format = UILayout.enum_item_name(self, "ring_size",
                                                  self.ring_size)
            item.name = "{} ({})".format(_("Ring Size"), size_format)
            item.ring_size = self.ring_size
            item.axis = self.axis

        context.area.tag_redraw()

        return {"FINISHED"}
Example #3
0
    def _draw_ui_for_seq_settings(context: Context, layout: UILayout):
        seq: Optional[KiritanifyScriptSequence] = get_selected_script_sequence(
            context)
        if seq is None:
            return
        setting: KiritanifyScriptSequenceSetting = _script_setting(seq)

        layout.prop(setting, "text")
        layout.label(
            text=
            f"Chara: {get_character_from_channel(context, seq.channel).chara_name}"
        )

        row = layout.row()
        row.prop(setting, "gen_voice")
        if setting.gen_voice:
            row.prop(setting, "voice_seq_name", text="", emboss=False)
Example #4
0
 def _draw_ui_for_new_seq(context: Context, layout: UILayout):
     gs = _global_setting(context)
     # new sequence button per character
     if len(gs.characters) > 0:
         for chara in gs.characters:  # type: KiritanifyCharacterSetting
             _box = layout.box()
             _box.label(text=f'{chara.chara_name}')
             for seqs in split_per_num(chara.tachie_files(), 4):
                 _row = _box.row()
                 for e in seqs:  # type: Path
                     op: KIRITANIFY_OT_NewTachieSequences \
                       = _row.operator(
                       operator=KIRITANIFY_OT_NewTachieSequences.bl_idname,
                       text=f'{e.name}',
                     )
                     op.chara_name = chara.chara_name
                     op.image_path = str(e)
             layout.separator()
Example #5
0
 def draw_item(self, context, layout, data, item, icon, active_data,
               active_propname, index):
     rootmotion_icon = UILayout.enum_item_icon(item, 'rootmotion_type',
                                               item.rootmotion_type)
     layout.prop(data=item,
                 property='name',
                 emboss=False,
                 text="",
                 icon_value=rootmotion_icon)
Example #6
0
    def draw(self, context):
        d = self.get_driver()
        v0 = d.fcurve.driver.variables[0]
        layout = self.layout
        if d:
            scene = context.scene
            gui = d.driver_gui(scene)
            '''
            if gui is not None:
                self.layout.prop(gui, "gui_types",
                             text="",
                             expand=True,
                             icon_only=True)
            '''
            d.draw_slider(self.layout)
            #d.edit(self.layout, context)
            print("VARIABLE DIC", d.vd)
            target_dic, rubbish_vars = get_var_dic(d)
            row = layout.row(align=True)
            row.label("Variables")
            op = row.operator("driver.new_var_popup", text="", icon='ZOOMIN')
            op.dindex = d.index
            if target_dic:
                for targetname, data in target_dic.items():
                    if targetname == "None":
                        continue
                    variables = data["variables"]
                    layout.label(targetname, icon_value=data.get("icon"))
                    col = layout.column()
                    #col.scale_y = 0.4

                    for type, varnames in variables.items():
                        #print(name)
                        col.label(type)
                        for name in varnames:
                            var = d.fcurve.driver.variables.get(name)
                            draw_variable(d, var, col)
                        #var = variables.get(key)

            if rubbish_vars:
                col = layout.column()
                col.alert = True
                col.label("No Targets")
                types = rubbish_vars.get("variables")
                for type, vars in types.items():
                    col.label(UILayout.enum_item_name(v0, "type", type),
                              icon_value=enum_item_icon(v0, "type", type))
                    for var in vars:
                        var = d.fcurve.driver.variables.get(var)
                        draw_variable(d, var, col)

            self.check(context)
Example #7
0
 def _draw_ui_for_new_seq(context: Context, layout: UILayout):
     gs = _global_setting(context)
     # new sequence button per character
     if len(gs.characters) > 0:
         _box = layout.box()
         _row = _box.row()
         for chara in gs.characters:  # type: KiritanifyCharacterSetting
             op: KIRITANIFY_OT_NewScriptSequence \
               = _row.operator(
               operator=KIRITANIFY_OT_NewScriptSequence.bl_idname,
               text=f'{chara.chara_name}',
             )
             op.chara_name = chara.chara_name
Example #8
0
    def draw(self, context):
        d = self.get_driver()
        v0 = d.fcurve.driver.variables[0]
        layout = self.layout
        if d:        
            scene = context.scene    
            gui = d.driver_gui(scene)
            '''
            if gui is not None:
                self.layout.prop(gui, "gui_types",
                             text="",
                             expand=True,
                             icon_only=True)
            '''
            d.draw_slider(self.layout)
            #d.edit(self.layout, context)
            print("VARIABLE DIC", d.vd)
            target_dic, rubbish_vars = get_var_dic(d)
            row = layout.row(align=True)
            row.label("Variables")
            op = row.operator("driver.new_var_popup", text="", icon='ZOOMIN')
            op.dindex = d.index
            if target_dic:                
                for targetname, data in target_dic.items():
                    if targetname == "None":
                        continue
                    variables = data["variables"]
                    layout.label(targetname, icon_value=data.get("icon"))
                    col = layout.column()
                    #col.scale_y = 0.4
                    
                    for type, varnames in variables.items():
                        #print(name)
                        col.label(type)
                        for name in varnames:
                            var = d.fcurve.driver.variables.get(name)
                            draw_variable(d, var, col)
                        #var = variables.get(key)

            if rubbish_vars:
                col = layout.column()
                col.alert = True
                col.label("No Targets")
                types = rubbish_vars.get("variables")
                for type, vars in types.items():
                    col.label(UILayout.enum_item_name(v0, "type", type), icon_value=enum_item_icon(v0, "type", type))
                    for var in vars:
                        var = d.fcurve.driver.variables.get(var)
                        draw_variable(d, var, col)
                
            self.check(context)
Example #9
0
def id_data_enum_item(id_data):
    #identifier, number = id_data_uuid(id_data)
    number = id_data.as_pointer() % 0xFFFFFFFF
    identifier = str(id_data.as_pointer())
    return (identifier, id_data.name, "", UILayout.icon(id_data), number)
Example #10
0
def id_data_enum_item(id_data):
    #identifier, number = id_data_uuid(id_data)
    number = id_data.as_pointer() % 0xFFFFFFFF
    identifier = str(id_data.as_pointer())
    return (identifier, id_data.name, "", UILayout.icon(id_data), number)