mirror of
https://github.com/nzp-team/tools.git
synced 2024-11-26 22:11:25 +00:00
Add "Flags" export field for custom effect flags
This commit is contained in:
parent
9b8f9b8077
commit
aefe4d56d5
2 changed files with 23 additions and 0 deletions
|
@ -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")
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue