Commit dd10b2cb authored by MURRAY David's avatar MURRAY David

added option to disable export camera

parent b6a0ee28
Pipeline #107415 skipped with stage
......@@ -52,6 +52,10 @@ def export():
use_ply = False
if bpy.data.scenes[0].use_ply:
use_ply = True
export_cam = False
if bpy.data.scenes[0].export_camera:
export_cam = True
mrf_filename = libblender2msf.getMrfFilenameFromBlender()
camera_filename = mrf_filename[:-3]+"mcf"
......@@ -59,7 +63,7 @@ def export():
blender_file_name = os.path.splitext(blender_file_name)[0]
obj_sub_directory_name = blender_file_name+"_assets"
libblender2msf.export(mrf_filename,camera_filename,obj_sub_directory_name,use_ply,no_mesh_export)
libblender2msf.export(mrf_filename,camera_filename,obj_sub_directory_name,export_cam,use_ply,no_mesh_export)
if bpy.data.scenes[0].export_animation_camera:
libblender2msf.export_camera_animation(camera_filename)
......@@ -139,7 +143,8 @@ class MrfControlPannel(bpy.types.Panel):
box = layout.box()
box.label(text='Export')
box.prop(context.scene, 'export_animation_camera')
box.prop(context.scene, 'export_camera')
box.prop(context.scene, 'export_animation_camera')
box.prop(context.scene, 'fast_export')
box.prop(context.scene, 'use_ply')
#box.prop(context.scene, 'use_stl')
......@@ -202,6 +207,10 @@ class ExportAndRender(bpy.types.Operator):
# REGISTERING
def register():
bpy.types.Scene.export_camera = bpy.props.BoolProperty(
name= 'Export camera',
default=False
)
bpy.types.Scene.export_animation_camera = bpy.props.BoolProperty(
name= 'Export camera anim.',
default=False
......
......@@ -721,7 +721,7 @@ def export_lights(mrf_filename,obj_sub_directory_name):
print("END EXPORTING LIGHTS ------------\n"+blend_file_path+"\n---------------------------")
def export(mrf_filename,camera_filename,obj_sub_directory_name,use_ply,no_mesh_export=False):
def export(mrf_filename,camera_filename,obj_sub_directory_name,export_cam,use_ply,no_mesh_export=False):
MRF_DIR = os.environ.get('MRF_DIR')
......@@ -769,7 +769,8 @@ def export(mrf_filename,camera_filename,obj_sub_directory_name,use_ply,no_mesh_e
indent_xml(root)
tree.write(mrf_filename)
export_camera(camera_filename)
if(export_cam):
export_camera(camera_filename)
......
......@@ -723,7 +723,7 @@ def export_lights(mrf_filename,obj_sub_directory_name):
print("END EXPORTING LIGHTS ------------\n"+blend_file_path+"\n---------------------------")
def export(mrf_filename,camera_filename,obj_sub_directory_name,use_ply,no_mesh_export=False):
def export(mrf_filename,camera_filename,obj_sub_directory_name,export_cam,use_ply,no_mesh_export=False):
MRF_DIR = os.environ.get('MRF_DIR')
......@@ -770,8 +770,8 @@ def export(mrf_filename,camera_filename,obj_sub_directory_name,use_ply,no_mesh_e
#indent and save scene
indent_xml(root)
tree.write(mrf_filename)
export_camera(camera_filename)
if(export_cam):
export_camera(camera_filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment