From d9983c8a4b05e3390130c060aa035fc79fcddb7f Mon Sep 17 00:00:00 2001 From: lifelandman Date: Sun, 14 Jul 2024 14:35:07 -0600 Subject: [PATCH] 0.96 --- omUlete main/__init__.py | 5 ++-- omUlete main/omuExport.py | 12 ++++----- omUlete main/props.py | 8 +++++- omUlete main/quickprops.py | 53 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 omUlete main/quickprops.py diff --git a/omUlete main/__init__.py b/omUlete main/__init__.py index cf5d9be..51f3483 100644 --- a/omUlete main/__init__.py +++ b/omUlete main/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "omUlete", "author": "Jackson \"Lifeland\" S.", - "version": (0, 95), + "version": (0, 96), "blender": (3, 5, 0), "description": "", "warning": "", @@ -12,8 +12,9 @@ import bpy from . import omuExport +from . import quickprops -modules = [omuExport] +modules = [omuExport, quickprops] def register(): diff --git a/omUlete main/omuExport.py b/omUlete main/omuExport.py index 03d8384..541e141 100644 --- a/omUlete main/omuExport.py +++ b/omUlete main/omuExport.py @@ -53,19 +53,19 @@ class export_egg(Operator, ExportHelper): ) all_or_selected: BoolProperty( - name="Export only selected objects and children", + name="Selected Only (and children)", description="If this is set to true, then only the objects currently selected and their children will be exported.", default=False, ) skip_UUV: BoolProperty(#skip unneeded UVs - name="skip exporting UVs for mesh with no texture", + name="Skip UVs for meshes with no texture", description="If this is set to true, then uvs will not be exported unless the relevant mesh has a texture applied. \nIn egg files, a vert cannot use two uv coords at once, so we generate multiple vertecies corisponding to each uv coordinate.", default=True, ) expt_animations: BoolProperty( - name="Export Armatures and Animations", + name="Armatures and Animations", description="If this is set to true, then the armature will be exported. (animation export is not yet implemented.)\nthis will be ignored if no armatures are detected in the selected objects.", default=False, ) @@ -96,12 +96,12 @@ def draw(self, context):#Organise and beutify the options box = self.layout.box() row = box.row() - row.label(text= "basic options") - row = box.row() - row.prop(context.active_operator, "imageDir") + row.label(text= "Export Options") row = box.row() row.prop(context.active_operator, "all_or_selected") row = box.row() + row.prop(context.active_operator, "imageDir") + row = box.row() row.prop(context.active_operator, "skip_UUV") ##Create a box for animation stuff diff --git a/omUlete main/props.py b/omUlete main/props.py index 64e3892..c52e387 100644 --- a/omUlete main/props.py +++ b/omUlete main/props.py @@ -67,4 +67,10 @@ def writeTube(obj): 'collisionsphere':writeSphere, 'collisioninvsphere':writeInvSphere, 'collisiontube':writeTube, - } \ No newline at end of file + } + +#This is for quickProps. +colPropList = ("level", + "keep", + "event", + "intangible") \ No newline at end of file diff --git a/omUlete main/quickprops.py b/omUlete main/quickprops.py new file mode 100644 index 0000000..ee20f26 --- /dev/null +++ b/omUlete main/quickprops.py @@ -0,0 +1,53 @@ +import bpy +from bpy.types import Operator +from bpy.props import StringProperty + +class makeButtonOperator(Operator): + """Add a custom property""" + bl_idname = "omulete.add_quick_property" + bl_label = "omUleteQuickProperty" + + propToAdd: StringProperty(default = "") + + def execute(self, context): + context.object[self.propToAdd] = True + return {'FINISHED'} + +from .props import propDict, colPropList +class quickPropsPanel(bpy.types.Panel): + """Creates a Panel in the Object properties window""" + bl_label = "OmUlete quick properties" + bl_idname = "OBJECT_PT_omuquickprops" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "object" + + def draw(self, context): + layout = self.layout + + row = layout.row() + row.label(text="Add Property:") + for prop in propDict: + row = layout.row() + row.operator(makeButtonOperator.bl_idname, text = prop).propToAdd = prop + + row = layout.row() + row.label(text="Additional collision props", icon='MATCUBE') + for prop in colPropList: + row = layout.row() + row.operator(makeButtonOperator.bl_idname, text = prop).propToAdd = prop + + + +def register(): + bpy.utils.register_class(quickPropsPanel) + bpy.utils.register_class(makeButtonOperator) + + +def unregister(): + bpy.utils.unregister_class(quickPropsPanel) + bpy.utils.unregister_class(makeButtonOperator) + + +if __name__ == "__main__": + register()