Skip to content

Commit

Permalink
0.96
Browse files Browse the repository at this point in the history
  • Loading branch information
lifelandman committed Jul 14, 2024
1 parent 51fba6b commit d9983c8
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 9 deletions.
5 changes: 3 additions & 2 deletions omUlete main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
bl_info = {
"name": "omUlete",
"author": "Jackson \"Lifeland\" S.",
"version": (0, 95),
"version": (0, 96),
"blender": (3, 5, 0),
"description": "",
"warning": "",
Expand All @@ -12,8 +12,9 @@

import bpy
from . import omuExport
from . import quickprops

modules = [omuExport]
modules = [omuExport, quickprops]

def register():

Expand Down
12 changes: 6 additions & 6 deletions omUlete main/omuExport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion omUlete main/props.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,10 @@ def writeTube(obj):
'collisionsphere':writeSphere,
'collisioninvsphere':writeInvSphere,
'collisiontube':writeTube,
}
}

#This is for quickProps.
colPropList = ("level",
"keep",
"event",
"intangible")
53 changes: 53 additions & 0 deletions omUlete main/quickprops.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit d9983c8

Please sign in to comment.