Skip to content

Commit

Permalink
From Blender 2.8x+ on LAMPS are now called LIGHTS
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero committed Mar 11, 2024
1 parent e57c36d commit c743590
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion io_ogre/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'EXPORT_HIDDEN' : True,
#'EXPORT_USER' : True,
'FORCE_CAMERA' : True,
'FORCE_LAMPS' : True,
'FORCE_LIGHTS' : True,
'NODE_ANIMATION' : True,
#'NODE_KEYFRAMES' : False,

Expand Down
2 changes: 1 addition & 1 deletion io_ogre/ogre/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def dot_scene(path, scene_name=None):
if config.get("SELECTED_ONLY") and not ob.select_get():
if ob.type == 'CAMERA' and config.get("FORCE_CAMERA"):
pass
elif ob.type == 'LAMP' and config.get("FORCE_LAMPS"):
elif ob.type == 'LIGHT' and config.get("FORCE_LIGHTS"):
pass
else:
continue
Expand Down
2 changes: 1 addition & 1 deletion io_ogre/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def update_meshpreview_button_visibility(show):
if meshpreviewButtonDisplayed:
bpy.types.VIEW3D_PT_tools_active.remove(add_preview_button)
meshpreviewButtonDisplayed = False

elif not show and meshpreviewButtonDisplayed:
bpy.types.VIEW3D_PT_tools_active.remove(add_preview_button)
meshpreviewButtonDisplayed = False
Expand Down
18 changes: 9 additions & 9 deletions io_ogre/ui/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def draw(self, context):
# Options associated with each section
section_options = {
"General" : ["EX_SWAP_AXIS", "EX_V2_MESH_TOOL_VERSION", "EX_EXPORT_XML_DELETE"],
"Scene" : ["EX_SCENE", "EX_SELECTED_ONLY", "EX_EXPORT_HIDDEN", "EX_FORCE_CAMERA", "EX_FORCE_LAMPS", "EX_NODE_ANIMATION"],
"Scene" : ["EX_SCENE", "EX_SELECTED_ONLY", "EX_EXPORT_HIDDEN", "EX_FORCE_CAMERA", "EX_FORCE_LIGHTS", "EX_NODE_ANIMATION"],
"Materials" : ["EX_MATERIALS", "EX_SEPARATE_MATERIALS", "EX_COPY_SHADER_PROGRAMS", "EX_USE_FFP_PARAMETERS"],
"Textures" : ["EX_DDS_MIPS", "EX_FORCE_IMAGE_FORMAT"],
"Armature" : ["EX_ARMATURE_ANIMATION", "EX_SHARED_ARMATURE", "EX_ONLY_KEYFRAMES", "EX_ONLY_DEFORMABLE_BONES", "EX_ONLY_KEYFRAMED_BONES", "EX_OGRE_INHERIT_SCALE", "EX_TRIM_BONE_WEIGHTS"],
Expand Down Expand Up @@ -223,7 +223,7 @@ def execute(self, context):
if config.get('ENABLE_LOGGING') == True and file_handler != None:
for logger_name in logging.Logger.manager.loggerDict.keys():
logging.getLogger(logger_name).handlers.clear()

file_handler.flush()
file_handler.close()

Expand Down Expand Up @@ -277,12 +277,12 @@ def execute(self, context):
# default=config.get('EXPORT_USER')) = {}
EX_FORCE_CAMERA : BoolProperty(
name="Force Camera",
description="Export active camera",
description="Export active camera, even if not selected",
default=config.get('FORCE_CAMERA')) = {}
EX_FORCE_LAMPS : BoolProperty(
name="Force Lamps",
description="Export all Lamps",
default=config.get('FORCE_LAMPS')) = {}
EX_FORCE_LIGHTS : BoolProperty(
name="Force Lights",
description="Export all Lights, even if not selected",
default=config.get('FORCE_LIGHTS')) = {}
EX_NODE_ANIMATION : BoolProperty(
name="Export Node Animations",
description="Export Node Animations, these are animations of the objects properties like position, rotation and scale",
Expand All @@ -294,7 +294,7 @@ def execute(self, context):
#Don't select this option if you have any fine tuning of the F-Curves in Blender, since they won't get exported.
#NOTE: Node Animations based on the 'Follow Path' constraint will most likely fail with this option set to True.""",
# default=config.get('NODE_KEYFRAMES')) = {}

# Materials
EX_MATERIALS : BoolProperty(
name="Export Materials",
Expand Down Expand Up @@ -324,7 +324,7 @@ def execute(self, context):
name="Convert Images",
description="Convert all textures to selected image format",
default=config.get('FORCE_IMAGE_FORMAT')) = {}

# Armature
EX_ARMATURE_ANIMATION : BoolProperty(
name="Armature Animation",
Expand Down
5 changes: 3 additions & 2 deletions io_ogre/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,9 @@ def wordwrap( txt ):
def get_lights_by_type( T ):
r = []
for ob in bpy.context.scene.objects:
if ob.type=='LAMP':
if ob.data.type==T: r.append( ob )
if ob.type == 'LIGHT':
if ob.data.type == T:
r.append( ob )
return r

invalid_chars_in_name = '"<>\:' # "<> is xml prohibited, : is Ogre prohibited, \ is standard escape char
Expand Down

0 comments on commit c743590

Please sign in to comment.