-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7bf8fa
commit 717ef47
Showing
7 changed files
with
210 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import bpy | ||
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 | ||
|
||
|
||
class CreateFins(bpy.types.Operator): | ||
"""Create fins for all objects with shells in this scene, and overwrite existing fin geometry""" | ||
bl_idname = "object.create_fins" | ||
bl_label = "Create Fins" | ||
bl_options = {'REGISTER', 'UNDO'} | ||
|
||
def execute(self, context): | ||
return handle_errors(self, shell.create_fins_wrapper, {}) | ||
|
||
|
||
class CreateLods(bpy.types.Operator): | ||
"""Create LODs for this scene""" | ||
bl_idname = "object.create_lods" | ||
bl_label = "Create LODs" | ||
bl_options = {'REGISTER', 'UNDO'} | ||
|
||
def execute(self, context): | ||
return handle_errors(self, shell.create_lods, {}) | ||
|
||
|
||
class VcolToHair(bpy.types.Operator): | ||
"""Convert vertex color layer to hair combing""" | ||
bl_idname = "object.vcol_to_comb" | ||
bl_label = "Vcol to Hair" | ||
bl_options = {'REGISTER', 'UNDO'} | ||
|
||
def execute(self, context): | ||
return handle_errors(self, vcol_to_comb, {}) | ||
|
||
|
||
class HairToVcol(bpy.types.Operator): | ||
"""Convert hair combing to vertex color layer""" | ||
bl_idname = "object.comb_to_vcol" | ||
bl_label = "Hair to Vcol" | ||
bl_options = {'REGISTER', 'UNDO'} | ||
|
||
def execute(self, context): | ||
return handle_errors(self, comb_to_vcol, {}) | ||
|
||
|
||
class TransferHairCombing(bpy.types.Operator): | ||
"""Transfer particle hair combing from one mesh to another""" | ||
bl_idname = "object.transfer_hair_combing" | ||
bl_label = "Transfer Combing" | ||
bl_options = {'REGISTER', 'UNDO'} | ||
|
||
def execute(self, context): | ||
return handle_errors(self, transfer_hair_combing, {}) | ||
|
||
|
||
class AddHair(bpy.types.Operator): | ||
"""Add hair setup to a mesh that didn't have it""" | ||
bl_idname = "object.add_hair" | ||
bl_label = "Add Hair" | ||
bl_options = {'REGISTER', 'UNDO'} | ||
|
||
def execute(self, context): | ||
return handle_errors(self, shell.add_hair, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import sys | ||
|
||
import bpy.props | ||
from bpy.props import IntProperty, EnumProperty | ||
from bpy.types import PropertyGroup | ||
|
||
from generated.formats.ms2.enums.MeshFormat import MeshFormat | ||
from generated.formats.ms2.enums.RigidBodyFlag import RigidBodyFlag | ||
|
||
|
||
class CobraSceneSettings(PropertyGroup): | ||
num_streams: IntProperty( | ||
name="External Streams", | ||
description="Number of lod levels stored in external .modelstream files", | ||
default=0, | ||
min=0, | ||
max=6 | ||
) | ||
version: IntProperty( | ||
name="MS2 Version", | ||
description="Version to use for export", | ||
default=50, | ||
min=0, | ||
max=100 | ||
) | ||
|
||
|
||
class CobraMeshSettings(PropertyGroup): | ||
mesh_format: EnumProperty( | ||
name='Mesh Format', | ||
description='Mesh format used for this mesh - JWE2 after Biosyn update', | ||
items=[("NONE", "None", "")] + [(item.name, item.name, "") for i, item in enumerate(MeshFormat)], | ||
# default = 'MO_SYS_FIXED', | ||
|
||
) | ||
|
||
|
||
class CobraCollisionSettings(PropertyGroup): | ||
air_resistance: bpy.props.FloatVectorProperty( | ||
name='Air Resistance', | ||
description="Air Resistance in 3D, relative to the joint's axes", | ||
default=(0.0, 0.0, 0.0), | ||
min=sys.float_info.min, | ||
max=sys.float_info.max, | ||
soft_min=sys.float_info.min, | ||
soft_max=sys.float_info.max, | ||
step=3, | ||
precision=2, | ||
subtype="XYZ") | ||
damping_3d: bpy.props.FloatVectorProperty( | ||
name='Damping', | ||
description='Damping in 3D', | ||
default=(0.0, 0.0, 0.0), | ||
min=sys.float_info.min, | ||
max=sys.float_info.max, | ||
soft_min=sys.float_info.min, | ||
soft_max=sys.float_info.max, | ||
step=1, | ||
precision=6) | ||
plasticity_min: bpy.props.FloatProperty(name="Plasticity Lower", subtype="ANGLE") | ||
plasticity_max: bpy.props.FloatProperty(name="Upper", subtype="ANGLE") | ||
flag: EnumProperty( | ||
name='Dynamics Flag', | ||
description='Current state of this rigidbody', | ||
items=[(item.name, item.name, "") for i, item in enumerate(RigidBodyFlag)], | ||
) |
Oops, something went wrong.