示例#1
0
 def draw(self, context):
     if utils.isBase(context.object):
         layout = self.layout
         scn = context.scene
         #for fname in maketarget.TargetSubPaths:
         #    layout.prop(scn, "Mh%s" % fname)
         layout.prop(scn, "MhTargetPath")
         layout.operator("mh.batch_fix")
         layout.operator("mh.batch_render", text="Batch Render").opengl = False
         layout.operator("mh.batch_render", text="Batch OpenGL Render").opengl = True
示例#2
0
 def draw(self, context):
     if utils.isBase(context.object):
         layout = self.layout
         scn = context.scene
         #for fname in maketarget.TargetSubPaths:
         #    layout.prop(scn, "Mh%s" % fname)
         layout.prop(scn, "MhTargetPath")
         layout.operator("mh.batch_fix")
         layout.operator("mh.batch_render",
                         text="Batch Render").opengl = False
         layout.operator("mh.batch_render",
                         text="Batch OpenGL Render").opengl = True
示例#3
0
    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            rig = ob.parent
        else:
            rig = None
        scn = context.scene
        if not utils.drawConfirm(layout, scn):
            return

        if Thomas:
            layout.label("Pruning")
            row = layout.row()
            row.prop(ob, "MhPruneEnabled")
            row.prop(ob, "MhPruneWholeDir")
            row.prop(ob, "MhPruneRecursively")
            layout.operator("mh.prune_target_file")

        if not utils.isBaseOrTarget(ob):
            layout.operator("mh.import_base_obj")
            layout.operator("mh.import_base_mhclo")
            layout.operator("mh.make_base_obj")

        elif utils.isBase(ob):
            layout.label("Load Target")
            layout.operator("mh.new_target")
            layout.operator("mh.load_target")            
            layout.operator("mh.load_target_from_mesh")                        

        elif utils.isTarget(ob):
            if not ob.data.shape_keys:
                layout.label("Warning: Internal inconsistency")
                layout.operator("mh.fix_inconsistency")
                return
            layout.separator()
            box = layout.box()
            n = 0
            for skey in ob.data.shape_keys.key_blocks:
                if n == 0:
                    n += 1
                    continue
                row = box.row()
                if n == ob.active_shape_key_index:
                    icon='LAMP'
                else:
                    icon='X'
                row.label("", icon=icon)
                row.prop(skey, "value", text=skey.name)
                n += 1

            layout.label("Load Target")
            layout.operator("mh.new_target", text="New Secondary Target")
            layout.operator("mh.load_target", text="Load Secondary From File")            
            layout.operator("mh.load_target_from_mesh", text="Load Secondary From Mesh")    
            ext = os.path.splitext(ob.MhFilePath)[1]
            if ext == ".mhclo":
                layout.operator("mh.fit_target")

            layout.label("Discard And Apply Target")
            layout.operator("mh.discard_target")
            layout.operator("mh.discard_all_targets")
            layout.operator("mh.apply_targets")

            layout.label("Symmetry")
            row = layout.row()            
            row.operator("mh.symmetrize_target", text="Left->Right").action = "Left"
            row.operator("mh.symmetrize_target", text="Right->Left").action = "Right"
            if Thomas:
                row.operator("mh.symmetrize_target", text="Mirror").action = "Mirror"

            layout.label("Save Target")            
            layout.prop(ob, "SelectedOnly")
            layout.prop(ob, "MhZeroOtherTargets")
            if ob["FilePath"]:
                layout.operator("mh.save_target")           
            layout.operator("mh.saveas_target")       

            if not ob.MhDeleteHelpers:
                layout.label("Skirt Editing")
                layout.operator("mh.snap_waist")
                layout.operator("mh.straighten_skirt")            
                if ob.MhIrrelevantDeleted:
                    layout.separator()
                    layout.label("Only %s Affected" % ob.MhAffectOnly)
                else:
                    layout.label("Affect Only:")
                    layout.prop(ob, "MhAffectOnly", expand=True)
                    #layout.operator("mh.delete_irrelevant")  
                

        if rig and rig.type == 'ARMATURE':
            layout.separator()
            layout.label("Export/Import MHP")
            layout.operator("mh.saveas_mhp")
            layout.operator("mh.load_mhp")

            layout.separator()
            layout.label("Export/Import BVH")
            layout.prop(scn, "MhExportRotateMode")
            layout.operator("mh.saveas_bvh")
            layout.operator("mh.load_bvh")

            layout.separator()
            layout.label("Convert between rig weights")
            layout.prop(scn, "MhSourceRig")
            layout.prop(scn, "MhTargetRig")
            layout.prop(scn, "MhPoseTargetDir")            
            layout.operator("mh.convert_rig")
示例#4
0
    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            rig = ob.parent
        else:
            rig = None
        scn = context.scene
        if not utils.drawConfirm(layout, scn):
            return
            
        settings.drawDirectories(layout, scn)

        if False:
            layout.label("Pruning")
            row = layout.row()
            row.prop(ob, "MhPruneEnabled")
            row.prop(ob, "MhPruneWholeDir")
            row.prop(ob, "MhPruneRecursively")
            layout.operator("mh.prune_target_file")

        layout.label("Load materials from")
        layout.prop(scn, "MhLoadMaterial", expand=True)
        layout.separator()
        if utils.isBaseOrTarget(ob):
            layout.operator("mh.import_base_mhclo", text="Reimport Base Mhclo").delete = True
            layout.operator("mh.import_base_obj", text="Reimport Base Obj").delete = True
            #layout.operator("mh.delete_clothes")
            #layout.operator("mh.tights_only")
            layout.separator()
        else:
            layout.operator("mh.import_base_mhclo", text="Import Base Mhclo").delete = False
            layout.operator("mh.import_base_obj", text="Import Base Obj").delete = False
            if rig and rig.type == 'ARMATURE':
                layout.operator("mh.make_base_obj")

        if utils.isBase(ob):
            layout.operator("mh.new_target")
            layout.operator("mh.load_target")            
            layout.operator("mh.load_target_from_mesh")                        

        elif utils.isTarget(ob):
            if not ob.data.shape_keys:
                layout.label("Warning: Internal inconsistency")
                layout.operator("mh.fix_inconsistency")
                return
            layout.separator()
            layout.prop(ob, "show_only_shape_key")
            box = layout.box()
            n = 0
            for skey in ob.data.shape_keys.key_blocks:
                if n == 0:
                    n += 1
                    continue
                row = box.row()
                if n == ob.active_shape_key_index:
                    icon='LAMP'
                else:
                    icon='X'
                row.label("", icon=icon)
                row.prop(skey, "value", text=skey.name)
                n += 1

            layout.separator()
            layout.operator("mh.new_target", text="New Secondary Target")
            layout.operator("mh.load_target", text="Load Secondary From File")            
            layout.operator("mh.load_target_from_mesh", text="Load Secondary From Mesh")                        
            layout.operator("mh.fit_target")
            layout.separator()
            layout.operator("mh.discard_target")
            layout.operator("mh.discard_all_targets")
            layout.operator("mh.apply_targets")

            layout.separator()
            if ob.MhIrrelevantDeleted:
                layout.label("Only %s Affected" % ob.MhAffectOnly)
            else:
                layout.label("Affect Only:")
                layout.prop(ob, "MhAffectOnly", expand=True)
                layout.operator("mh.delete_irrelevant")  
            row = layout.row()
            row.prop(ob, "SelectedOnly")
            row.prop(ob, "MhZeroOtherTargets")
            if ob["FilePath"]:
                layout.operator("mh.save_target")           
            layout.operator("mh.saveas_target")       
            
            layout.separator()
            layout.label("Editing")
            layout.operator("mh.symmetrize_target", text="Symm Left->Right").action = "Left"
            layout.operator("mh.symmetrize_target", text="Symm Right->Left").action = "Right"
            layout.operator("mh.symmetrize_target", text="Mirror Target").action = "Mirror"
            if ob.MhAffectOnly == 'Skirt':
                layout.operator("mh.snap_waist")
                layout.operator("mh.straighten_skirt")
                
            layout.operator("mh.relax_selected")
            if ob.MhRelaxing:
                layout.prop(ob, "MhRelaxAmount")
                row = layout.row()
                row.prop(ob, "MhRelaxX")
                row.prop(ob, "MhRelaxY")
                row.prop(ob, "MhRelaxZ")
                layout.operator("mh.test_relax")
                layout.operator("mh.discard_relax")
                layout.operator("mh.commit_relax")
                layout.operator("mh.commit_and_relax_more")
                return

        if rig and rig.type == 'ARMATURE':
            layout.separator()
            layout.label("Export/Import MHP")
            layout.operator("mh.saveas_mhp")
            layout.operator("mh.load_mhp")

            layout.separator()
            layout.label("Export/Import BVH")
            layout.prop(scn, "MhExportRotateMode")
            layout.operator("mh.saveas_bvh")
            layout.operator("mh.load_bvh")

            layout.separator()
            layout.label("Convert between rig weights")
            layout.prop(scn, "MhSourceRig")
            layout.prop(scn, "MhTargetRig")
            layout.prop(scn, "MhPoseTargetDir")            
            layout.operator("mh.convert_rig")
示例#5
0
    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            rig = ob.parent
        else:
            rig = None
        scn = context.scene
        if not utils.drawConfirm(layout, scn):
            return

        settings.drawDirectories(layout, scn)

        if False:
            layout.label("Pruning")
            row = layout.row()
            row.prop(ob, "MhPruneEnabled")
            row.prop(ob, "MhPruneWholeDir")
            row.prop(ob, "MhPruneRecursively")
            layout.operator("mh.prune_target_file")

        layout.label("Load materials from")
        layout.prop(scn, "MhLoadMaterial", expand=True)
        layout.separator()
        if utils.isBaseOrTarget(ob):
            layout.operator("mh.import_base_mhclo",
                            text="Reimport Base Mhclo").delete = True
            layout.operator("mh.import_base_obj",
                            text="Reimport Base Obj").delete = True
            #layout.operator("mh.delete_clothes")
            #layout.operator("mh.tights_only")
            layout.separator()
        else:
            layout.operator("mh.import_base_mhclo",
                            text="Import Base Mhclo").delete = False
            layout.operator("mh.import_base_obj",
                            text="Import Base Obj").delete = False
            if rig and rig.type == 'ARMATURE':
                layout.operator("mh.make_base_obj")

        if utils.isBase(ob):
            layout.operator("mh.new_target")
            layout.operator("mh.load_target")
            layout.operator("mh.load_target_from_mesh")

        elif utils.isTarget(ob):
            if not ob.data.shape_keys:
                layout.label("Warning: Internal inconsistency")
                layout.operator("mh.fix_inconsistency")
                return
            layout.separator()
            layout.prop(ob, "show_only_shape_key")
            box = layout.box()
            n = 0
            for skey in ob.data.shape_keys.key_blocks:
                if n == 0:
                    n += 1
                    continue
                row = box.row()
                if n == ob.active_shape_key_index:
                    icon = 'LAMP'
                else:
                    icon = 'X'
                row.label("", icon=icon)
                row.prop(skey, "value", text=skey.name)
                n += 1

            layout.separator()
            layout.operator("mh.new_target", text="New Secondary Target")
            layout.operator("mh.load_target", text="Load Secondary From File")
            layout.operator("mh.load_target_from_mesh",
                            text="Load Secondary From Mesh")
            layout.operator("mh.fit_target")
            layout.separator()
            layout.operator("mh.discard_target")
            layout.operator("mh.discard_all_targets")
            layout.operator("mh.apply_targets")

            layout.separator()
            if ob.MhIrrelevantDeleted:
                layout.label("Only %s Affected" % ob.MhAffectOnly)
            else:
                layout.label("Affect Only:")
                layout.prop(ob, "MhAffectOnly", expand=True)
                layout.operator("mh.delete_irrelevant")
            row = layout.row()
            row.prop(ob, "SelectedOnly")
            row.prop(ob, "MhZeroOtherTargets")
            if ob["FilePath"]:
                layout.operator("mh.save_target")
            layout.operator("mh.saveas_target")

            layout.separator()
            layout.label("Editing")
            layout.operator("mh.symmetrize_target",
                            text="Symm Left->Right").action = "Left"
            layout.operator("mh.symmetrize_target",
                            text="Symm Right->Left").action = "Right"
            layout.operator("mh.symmetrize_target",
                            text="Mirror Target").action = "Mirror"
            if ob.MhAffectOnly == 'Skirt':
                layout.operator("mh.snap_waist")
                layout.operator("mh.straighten_skirt")

            layout.operator("mh.relax_selected")
            if ob.MhRelaxing:
                layout.prop(ob, "MhRelaxAmount")
                row = layout.row()
                row.prop(ob, "MhRelaxX")
                row.prop(ob, "MhRelaxY")
                row.prop(ob, "MhRelaxZ")
                layout.operator("mh.test_relax")
                layout.operator("mh.discard_relax")
                layout.operator("mh.commit_relax")
                layout.operator("mh.commit_and_relax_more")
                return

        if rig and rig.type == 'ARMATURE':
            layout.separator()
            layout.label("Export/Import MHP")
            layout.operator("mh.saveas_mhp")
            layout.operator("mh.load_mhp")

            layout.separator()
            layout.label("Export/Import BVH")
            layout.prop(scn, "MhExportRotateMode")
            layout.operator("mh.saveas_bvh")
            layout.operator("mh.load_bvh")

            layout.separator()
            layout.label("Convert between rig weights")
            layout.prop(scn, "MhSourceRig")
            layout.prop(scn, "MhTargetRig")
            layout.prop(scn, "MhPoseTargetDir")
            layout.operator("mh.convert_rig")
示例#6
0
    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            rig = ob.parent
        else:
            rig = None
        scn = context.scene
        if not utils.drawConfirm(layout, scn):
            return

        if Thomas:
            layout.label("Pruning")
            row = layout.row()
            row.prop(ob, "MhPruneEnabled")
            row.prop(ob, "MhPruneWholeDir")
            row.prop(ob, "MhPruneRecursively")
            layout.operator("mh.prune_target_file")

        if not utils.isBaseOrTarget(ob):
            layout.operator("mh.import_base_obj")
            layout.operator("mh.import_base_mhclo")
            layout.operator("mh.make_base_obj")

        elif utils.isBase(ob):
            layout.label("Load Target")
            layout.operator("mh.new_target")
            layout.operator("mh.load_target")
            layout.operator("mh.load_target_from_mesh")

        elif utils.isTarget(ob):
            if not ob.data.shape_keys:
                layout.label("Warning: Internal inconsistency")
                layout.operator("mh.fix_inconsistency")
                return
            layout.separator()
            box = layout.box()
            n = 0
            for skey in ob.data.shape_keys.key_blocks:
                if n == 0:
                    n += 1
                    continue
                row = box.row()
                if n == ob.active_shape_key_index:
                    icon = 'LAMP'
                else:
                    icon = 'X'
                row.label("", icon=icon)
                row.prop(skey, "value", text=skey.name)
                n += 1

            layout.label("Load Target")
            layout.operator("mh.new_target", text="New Secondary Target")
            layout.operator("mh.load_target", text="Load Secondary From File")
            layout.operator("mh.load_target_from_mesh",
                            text="Load Secondary From Mesh")
            ext = os.path.splitext(ob.MhFilePath)[1]
            if ext == ".mhclo":
                layout.operator("mh.fit_target")

            layout.label("Discard And Apply Target")
            layout.operator("mh.discard_target")
            layout.operator("mh.discard_all_targets")
            layout.operator("mh.apply_targets")

            layout.label("Symmetry")
            row = layout.row()
            row.operator("mh.symmetrize_target",
                         text="Left->Right").action = "Left"
            row.operator("mh.symmetrize_target",
                         text="Right->Left").action = "Right"
            if Thomas:
                row.operator("mh.symmetrize_target",
                             text="Mirror").action = "Mirror"

            layout.label("Save Target")
            layout.prop(ob, "SelectedOnly")
            layout.prop(ob, "MhZeroOtherTargets")
            if ob["FilePath"]:
                layout.operator("mh.save_target")
            layout.operator("mh.saveas_target")

            if not ob.MhDeleteHelpers:
                layout.label("Skirt Editing")
                layout.operator("mh.snap_waist")
                layout.operator("mh.straighten_skirt")
                if ob.MhIrrelevantDeleted:
                    layout.separator()
                    layout.label("Only %s Affected" % ob.MhAffectOnly)
                else:
                    layout.label("Affect Only:")
                    layout.prop(ob, "MhAffectOnly", expand=True)
                    #layout.operator("mh.delete_irrelevant")

        if rig and rig.type == 'ARMATURE':
            layout.separator()
            layout.label("Export/Import MHP")
            layout.operator("mh.saveas_mhp")
            layout.operator("mh.load_mhp")

            layout.separator()
            layout.label("Export/Import BVH")
            layout.prop(scn, "MhExportRotateMode")
            layout.operator("mh.saveas_bvh")
            layout.operator("mh.load_bvh")

            layout.separator()
            layout.label("Convert between rig weights")
            layout.prop(scn, "MhSourceRig")
            layout.prop(scn, "MhTargetRig")
            layout.prop(scn, "MhPoseTargetDir")
            layout.operator("mh.convert_rig")
示例#7
0
    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            rig = ob.parent
        else:
            rig = None
        scn = context.scene
        if not utils.drawConfirm(layout, scn):
            return
        settings.drawDirectories(layout, scn)

        layout.label("Load materials from")
        layout.prop(scn, "MhLoadMaterial", expand=True)
        layout.separator()
        if utils.isBaseOrTarget(ob):
            layout.operator("mh.import_base_mhclo", text="Reimport Base Mhclo").delete = True
            layout.operator("mh.import_base_obj", text="Reimport Base Obj").delete = True
            layout.operator("mh.delete_clothes")
            layout.separator()
        else:
            layout.operator("mh.import_base_mhclo", text="Import Base Mhclo").delete = False
            layout.operator("mh.import_base_obj", text="Import Base Obj").delete = False
            if rig and rig.type == "ARMATURE":
                layout.operator("mh.make_base_obj")
        if utils.isBase(ob):
            layout.operator("mh.new_target")
            layout.operator("mh.load_target")
            layout.operator("mh.load_target_from_mesh")
        elif utils.isTarget(ob):
            if not ob.data.shape_keys:
                layout.label("Warning: Internal inconsistency")
                layout.operator("mh.fix_inconsistency")
                return
            layout.separator()
            layout.prop(ob, "show_only_shape_key")
            box = layout.box()
            n = 0
            for skey in ob.data.shape_keys.key_blocks:
                if n == 0:
                    n += 1
                    continue
                row = box.row()
                if n == ob.active_shape_key_index:
                    icon = "LAMP"
                else:
                    icon = "X"
                row.label("", icon=icon)
                row.prop(skey, "value", text=skey.name)
                n += 1
            layout.separator()
            layout.operator("mh.new_target", text="New Secondary Target")
            layout.operator("mh.load_target", text="Load Secondary From File")
            layout.operator("mh.load_target_from_mesh", text="Load Secondary From Mesh")
            layout.operator("mh.fit_target")
            layout.operator("mh.symmetrize_target", text="Symm Left->Right").left2right = False
            layout.operator("mh.symmetrize_target", text="Symm Right->Left").left2right = True
            # layout.separator()
            # layout.prop(scn, '["Relax"]')
            # layout.operator("mh.relax_target")
            layout.separator()
            layout.operator("mh.discard_target")
            layout.operator("mh.discard_all_targets")
            layout.separator()
            layout.operator("mh.apply_targets")
            layout.separator()
            layout.prop(ob, '["SelectedOnly"]')
            if ob["FilePath"]:
                layout.operator("mh.save_target")
            layout.operator("mh.saveas_target")

        if rig and rig.type == "ARMATURE":
            layout.separator()
            layout.operator("mh.saveas_bvh")
            layout.operator("mh.load_bvh")