diff --git a/io_mesh_qfmdl_blubs/__init__.py b/io_mesh_qfmdl_blubs/__init__.py index 29795ae..3e8b741 100644 --- a/io_mesh_qfmdl_blubs/__init__.py +++ b/io_mesh_qfmdl_blubs/__init__.py @@ -179,6 +179,11 @@ class QFMDLSettings(bpy.types.PropertyGroup): items=EFFECTS, name="Effects", description="Particle trail effects") + custom_flags : StringProperty( + name="Flags", + description="Int representing effect bitflags to write. If specified, Effects / Rotate flag values are ignored.", + default="" + ) #doesn't work :( #script = PointerProperty( @@ -283,6 +288,11 @@ class ExportMDL6(bpy.types.Operator, ExportHelper): items=EFFECTS, name="Effects", description="Particle trail effects") + custom_flags : StringProperty( + name="Flags", + description="Int representing effect bitflags to write. If specified, Effects / Rotate flag values are ignored.", + default="" + ) xform : BoolProperty( name="Auto transform", description="Auto-apply location/rotation/scale when exporting", @@ -362,6 +372,7 @@ class OBJECT_PT_MDLPanel(bpy.types.Panel): layout.prop(obj.qfmdl, "synctype") layout.prop(obj.qfmdl, "rotate") layout.prop(obj.qfmdl, "effects") + layout.prop(obj.qfmdl, "custom_flags") # layout.prop(obj.qfmdl, "script") layout.prop(obj.qfmdl, "xform") layout.prop(obj.qfmdl, "md16") diff --git a/io_mesh_qfmdl_blubs/export_mdl.py b/io_mesh_qfmdl_blubs/export_mdl.py index bdf3565..5df6163 100644 --- a/io_mesh_qfmdl_blubs/export_mdl.py +++ b/io_mesh_qfmdl_blubs/export_mdl.py @@ -245,6 +245,7 @@ def get_properties( synctype, rotate, effects, + custom_flags, xform, md16, mdl_first_frame, @@ -257,6 +258,15 @@ def get_properties( mdl.synctype = MDL.SYNCTYPE[synctype] mdl.flags = ((rotate and MDL.EF_ROTATE or 0) | MDL.EFFECTS[effects]) + + # If custom_flags specified, try parsing as int + # If int is successfully parsed, replace flags / effects with it. + try: + custom_flags = int(custom_flags) + mdl.flags = custom_flags + except: + pass + if md16: mdl.ident = "MD16" @@ -358,6 +368,7 @@ def export_mdl( synctype = SYNCTYPE[1], rotate = False, effects = EFFECTS[1], + custom_flags='', xform = True, md16 = False, mdl_first_frame=0, @@ -386,6 +397,7 @@ def export_mdl( synctype, rotate, effects, + custom_flags, xform, md16, mdl_first_frame,