Skip to content

Commit

Permalink
fix merge of rig tools
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Nov 12, 2023
1 parent ddb1c9e commit efe055a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
23 changes: 2 additions & 21 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
from plugin.modules_import.operators import ImportBanis, ImportManis, ImportMatcol, ImportFgm, ImportMS2, ImportSPL, \
ImportVoxelskirt, ImportMS2FromBrowser, ImportFGMFromBrowser
from plugin.modules_export.operators import ExportMS2, ExportSPL, ExportManis, ExportBanis
from plugin.utils.operators import CreateFins, CreateLods, VcolToHair, HairToVcol, TransferHairCombing, AddHair
from plugin.utils.operators import CreateFins, CreateLods, VcolToHair, HairToVcol, TransferHairCombing, AddHair, \
GenerateRigEdit, ConvertScaleToLoc
from plugin.utils.properties import CobraSceneSettings, CobraMeshSettings, CobraCollisionSettings


Expand Down Expand Up @@ -116,26 +117,6 @@ def execute(self, context):
return {'FINISHED'}


class GenerateRigEdit(bpy.types.Operator):
"""Generate rig edit nodes for all posed bones"""
bl_idname = "pose.generate_rig_edit"
bl_label = "Generate Rig Edit from Pose"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
return handle_errors(self, shell.generate_rig_edit, {})


class ConvertScaleToLoc(bpy.types.Operator):
"""Convert pose mode scale transforms into location transforms"""
bl_idname = "pose.convert_scale_to_loc"
bl_label = "Convert scale to location"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
return handle_errors(self, shell.convert_scale_to_loc, {})


class MESH_PT_CobraTools(bpy.types.Panel):
"""Creates a Panel in the scene context of the properties editor"""
bl_label = "Cobra Mesh Tools"
Expand Down
22 changes: 22 additions & 0 deletions plugin/utils/operators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import bpy
import bpy.types

from plugin.utils import shell
from plugin.utils.hair import comb_to_vcol, transfer_hair_combing, vcol_to_comb
from plugin.utils.matrix_util import handle_errors
Expand Down Expand Up @@ -62,3 +64,23 @@ class AddHair(bpy.types.Operator):

def execute(self, context):
return handle_errors(self, shell.add_hair, {})


class GenerateRigEdit(bpy.types.Operator):
"""Generate rig edit nodes for all posed bones"""
bl_idname = "pose.generate_rig_edit"
bl_label = "Generate Rig Edit from Pose"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
return handle_errors(self, shell.generate_rig_edit, {})


class ConvertScaleToLoc(bpy.types.Operator):
"""Convert pose mode scale transforms into location transforms"""
bl_idname = "pose.convert_scale_to_loc"
bl_label = "Convert scale to location"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
return handle_errors(self, shell.convert_scale_to_loc, {})
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12d43006d - Sun Nov 12 17:20:20 2023 +0100
ddb1c9e0a - Sun Nov 12 19:58:51 2023 +0100

0 comments on commit efe055a

Please sign in to comment.