Newer
Older
Bastien Montagne
committed
self.layout.prop(cam.pov, "dof_enable", text="")
def draw(self, context):
layout = self.layout
cam = context.camera
Bastien Montagne
committed
layout.active = cam.pov.dof_enable
Bastien Montagne
committed
layout.prop(cam.pov, "dof_aperture")
Campbell Barton
committed
Bastien Montagne
committed
col.prop(cam.pov, "dof_samples_min")
col.prop(cam.pov, "dof_variance")
Bastien Montagne
committed
col.prop(cam.pov, "dof_samples_max")
col.prop(cam.pov, "dof_confidence")
Maurice Raybaud
committed
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
class CAMERA_PT_povray_cam_nor(CameraDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Perturbation"
COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw_header(self, context):
cam = context.camera
self.layout.prop(cam.pov, "normal_enable", text="")
def draw(self, context):
layout = self.layout
cam = context.camera
layout.active = cam.pov.normal_enable
layout.prop(cam.pov,"normal_patterns")
layout.prop(cam.pov,"cam_normal")
layout.prop(cam.pov,"turbulence")
layout.prop(cam.pov,"scale")
Maurice Raybaud
committed
class CAMERA_PT_povray_replacement_text(CameraDataButtonsPanel, bpy.types.Panel):
bl_label = "Custom POV Code"
Campbell Barton
committed
COMPAT_ENGINES = {'POVRAY_RENDER'}
Maurice Raybaud
committed
def draw(self, context):
layout = self.layout
cam = context.camera
Maurice Raybaud
committed
col.label(text="Replace properties with:")
Bastien Montagne
committed
col.prop(cam.pov, "replacement_text", text="")
Maurice Raybaud
committed
Maurice Raybaud
committed
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
###############################################################################
# Text Povray Settings
###############################################################################
class TEXT_OT_povray_insert(bpy.types.Operator):
"""Tooltip"""
bl_idname = "text.povray_insert"
bl_label = "Insert"
filepath = bpy.props.StringProperty(name="Filepath", subtype='FILE_PATH')
@classmethod
def poll(cls, context):
# context.area.type == 'TEXT_EDITOR'
return bpy.ops.text.insert.poll()
def execute(self, context):
if self.filepath and isfile(self.filepath):
file = open(self.filepath, "r")
bpy.ops.text.insert(text=file.read())
# places the cursor at the end without scrolling -.-
# context.space_data.text.write(file.read())
file.close()
return {'FINISHED'}
def validinsert(ext):
Maurice Raybaud
committed
class TEXT_MT_insert(bpy.types.Menu):
bl_label = "Insert"
bl_idname = "TEXT_MT_insert"
def draw(self, context):
pov_documents = locate_docpath()
prop = self.layout.operator("wm.path_open", text="Open folder", icon='FILE_FOLDER')
prop.filepath = pov_documents
self.layout.separator()
Maurice Raybaud
committed
list=[]
for root,dirs,files in os.walk(pov_documents):
list.append(root)
print(list)
self.path_menu(list,
"text.povray_insert",
#{"internal": True},
filter_ext= validinsert
)
Maurice Raybaud
committed
class TEXT_PT_povray_custom_code(TextButtonsPanel, bpy.types.Panel):
Campbell Barton
committed
COMPAT_ENGINES = {'POVRAY_RENDER'}
Maurice Raybaud
committed
def draw(self, context):
layout = self.layout
Maurice Raybaud
committed
Maurice Raybaud
committed
pov_documents = locate_docpath()
Maurice Raybaud
committed
layout.label(text="Please configure ", icon="INFO")
layout.label(text="default pov include path ")
layout.label(text="in addon preferences")
#layout.separator()
layout.operator("wm.addon_userpref_show",
text="Go to Render: POV-Ray addon",
icon="PREFERENCES").module = "render_povray"
#layout.separator()
else:
#print(pov_documents)
layout.menu(TEXT_MT_insert.bl_idname)
Maurice Raybaud
committed
if text:
box = layout.box()
box.label('Source to render:', icon='RENDER_STILL')
row = box.row()
row.prop(text.pov, "custom_code",expand = True)
if text.pov.custom_code in {'3dview'}:
box.operator("render.render", icon='OUTLINER_DATA_POSE')
if text.pov.custom_code in {'text'}:
rtext = bpy.context.space_data.text
box.operator("text.run", icon='POSE_DATA')
#layout.prop(text.pov, "custom_code")
elif text.pov.custom_code in {'both'}:
box.operator("render.render", icon='POSE_HLT')
layout.label(text="Please specify declared", icon="INFO")
layout.label(text="items in properties ")
#layout.label(text="")
layout.label(text="replacement fields")
Maurice Raybaud
committed
###############################################
# Text editor templates from header menu
class TEXT_MT_templates_pov(bpy.types.Menu):
bl_label = "POV-Ray"
# We list templates on file evaluation, we can assume they are static data,
# and better avoid running this on every draw call.
import os
template_paths = [os.path.join(os.path.dirname(__file__), "templates_pov")]
def draw(self, context):
self.path_menu(
self.template_paths,
"text.open",
props_default={"internal": True},
)
def menu_func_templates(self, context):
# Do not depend on POV-Ray being active renderer here...
self.layout.menu("TEXT_MT_templates_pov")