Skip to content
Snippets Groups Projects
Commit a27aea01 authored by Constantin Rahn's avatar Constantin Rahn
Browse files

Comments for METAS (Blobs) only if METAS are in the scene

parent b33047a3
No related branches found
No related tags found
No related merge requests found
...@@ -179,7 +179,7 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -179,7 +179,7 @@ def write_pov(filename, scene=None, info_callback=None):
return TabStr return TabStr
Tab = setTab(scene.pov_indentation_character, scene.pov_indentation_spaces) Tab = setTab(scene.pov_indentation_character, scene.pov_indentation_spaces)
def tabWrite(str_o): def tabWrite(str_o):
global TabLevel global TabLevel
brackets = str_o.count('{') - str_o.count('}') brackets = str_o.count('{') - str_o.count('}')
...@@ -580,7 +580,9 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -580,7 +580,9 @@ def write_pov(filename, scene=None, info_callback=None):
def exportMeta(metas): def exportMeta(metas):
# TODO - blenders 'motherball' naming is not supported. # TODO - blenders 'motherball' naming is not supported.
if scene.pov_comments_enable and len(metas)>= 1: file.write('//--Blob objects--\n\n')
for ob in metas: for ob in metas:
meta = ob.data meta = ob.data
importance=ob.pov_importance_value importance=ob.pov_importance_value
...@@ -645,7 +647,7 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -645,7 +647,7 @@ def write_pov(filename, scene=None, info_callback=None):
tabWrite('}\n') #End of Metaball block tabWrite('}\n') #End of Metaball block
# tabWrite('}\n') if scene.pov_comments_enable and len(metas)>= 1: file.write('\n')
objectNames = {} objectNames = {}
DEF_OBJ_NAME = 'Default' DEF_OBJ_NAME = 'Default'
...@@ -1346,13 +1348,12 @@ def write_pov(filename, scene=None, info_callback=None): ...@@ -1346,13 +1348,12 @@ def write_pov(filename, scene=None, info_callback=None):
for material in bpy.data.materials: for material in bpy.data.materials:
if material.users > 0: if material.users > 0:
writeMaterial(material) writeMaterial(material)
if comments: file.write('\n') if comments: file.write('\n')
if comments: file.write('//--Meta objects--\n\n') # <- How can this be written only if the scene contains META?
# if comments: file.write('//--Blob objects--\n\n')
exportMeta([l for l in sel if l.type == 'META']) exportMeta([l for l in sel if l.type == 'META'])
# if comments: file.write('\n')
if comments: file.write('\n') # <- How can this be written only if the scene contains META?
if comments: file.write('//--Mesh objecs--\n') if comments: file.write('//--Mesh objecs--\n')
exportMeshs(scene, sel) exportMeshs(scene, sel)
...@@ -1419,7 +1420,7 @@ def write_pov_ini(filename_ini, filename_pov, filename_image): ...@@ -1419,7 +1420,7 @@ def write_pov_ini(filename_ini, filename_pov, filename_image):
class PovrayRender(bpy.types.RenderEngine): class PovrayRender(bpy.types.RenderEngine):
bl_idname = 'POVRAY_RENDER' bl_idname = 'POVRAY_RENDER'
bl_label = 'POV-Ray 3.7' bl_label = 'POV-Ray 3.7'
DELAY = 0.05 DELAY = 0.1
def _export(self, scene): def _export(self, scene):
import tempfile import tempfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment