Newer
Older
Bastien Montagne
committed
self.layout.prop(scene.pov, "media_enable", text="")
def draw(self, context):
layout = self.layout
scene = context.scene
Bastien Montagne
committed
layout.active = scene.pov.media_enable
col = layout.column()
col.prop(scene.pov, "media_scattering_type", text="")
col = layout.column()
col.prop(scene.pov, "media_samples", text="Samples")
col = split.column(align=True)
col.label(text="Scattering:")
col.prop(scene.pov, "media_diffusion_scale")
col.prop(scene.pov, "media_diffusion_color", text="")
col = split.column(align=True)
col.label(text="Absorption:")
col.prop(scene.pov, "media_absorption_scale")
col.prop(scene.pov, "media_absorption_color", text="")
if scene.pov.media_scattering_type == '5':
col = layout.column()
col.prop(scene.pov, "media_eccentricity", text="Eccentricity")
Maurice Raybaud
committed
##class RENDER_PT_povray_baking(RenderButtonsPanel, bpy.types.Panel):
## bl_label = "Baking"
## COMPAT_ENGINES = {'POVRAY_RENDER'}
##
## def draw_header(self, context):
## scene = context.scene
##
Bastien Montagne
committed
## self.layout.prop(scene.pov, "baking_enable", text="")
Maurice Raybaud
committed
##
## def draw(self, context):
## layout = self.layout
##
## scene = context.scene
## rd = scene.render
##
Bastien Montagne
committed
## layout.active = scene.pov.baking_enable
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
class MODIFIERS_PT_povray_modifiers(ModifierButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#def draw_header(self, context):
#scene = context.scene
#self.layout.prop(scene.pov, "boolean_mod", text="")
def draw(self, context):
scene = context.scene
layout = self.layout
ob = context.object
mod = ob.modifiers
col = layout.column()
# Find Boolean Modifiers for displaying CSG option
onceCSG = 0
for mod in ob.modifiers:
if onceCSG == 0:
if mod :
if mod.type == 'BOOLEAN':
col.prop(ob.pov, "boolean_mod")
onceCSG = 1
split = layout.split()
col = layout.column()
# Inside Vector for CSG
col.prop(ob.pov, "inside_vector")
class MATERIAL_MT_POV_sss_presets(bpy.types.Menu):
bl_label = "SSS Presets"
preset_subdir = "pov/material/sss"
preset_operator = "script.execute_preset"
draw = bpy.types.Menu.draw_preset
class AddPresetSSS(AddPresetBase, Operator):
'''Add an SSS Preset'''
bl_idname = "material.sss_preset_add"
bl_label = "Add SSS Preset"
preset_menu = "MATERIAL_MT_POV_sss_presets"
# variable used for all preset values
preset_defines = [
"material = bpy.context.material"
]
# properties to store in the preset
preset_values = [
"material.pov_subsurface_scattering.radius",
"material.pov_subsurface_scattering.color",
]
# where to store the preset
preset_subdir = "pov/material/sss"
class MATERIAL_PT_POV_sss(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Subsurface Scattering"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'POVRAY_RENDER'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return check_material(mat) and (mat.pov.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
mat = context.material #FORMERLY : #active_node_mat(context.material)
sss = mat.pov_subsurface_scattering
self.layout.active = (not mat.pov.use_shadeless)
self.layout.prop(sss, "use", text="")
def draw(self, context):
layout = self.layout
mat = context.material #FORMERLY : #active_node_mat(context.material)
sss = mat.pov_subsurface_scattering
layout.active = (sss.use) and (not mat.pov.use_shadeless)
row = layout.row().split()
sub = row.row(align=True).split(align=True, factor=0.75)
sub.menu(MATERIAL_MT_POV_sss_presets.__name__, text=MATERIAL_MT_POV_sss_presets.bl_label)
sub.operator(AddPresetSSS.bl_idname, text="", icon='ADD')
sub.operator(AddPresetSSS.bl_idname, text="", icon='REMOVE').remove_active = True
split = layout.split()
col = split.column()
col.prop(sss, "ior")
col.prop(sss, "scale")
col.prop(sss, "color", text="")
col.prop(sss, "radius", text="RGB Radius", expand=True)
col = split.column()
sub = col.column(align=True)
sub.label(text="Blend:")
sub.prop(sss, "color_factor", text="Color")
sub.prop(sss, "texture_factor", text="Texture")
sub.label(text="Scattering Weight:")
sub.prop(sss, "front")
sub.prop(sss, "back")
col.separator()
col.prop(sss, "error_threshold", text="Error")
class MATERIAL_PT_povray_activate_node(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Activate Node Settings"
bl_context = "material"
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'POVRAY_RENDER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
mat=context.material
ob = context.object
return mat and mat.pov.type == "SURFACE" and (engine in cls.COMPAT_ENGINES) and not (mat.pov.material_use_nodes or mat.use_nodes)
def draw(self, context):
layout = self.layout
# layout.operator("pov.material_use_nodes", icon='SOUND')#'NODETREE')
# the above replaced with a context hook below:
layout.operator("WM_OT_context_toggle", text="Use POV-Ray Nodes", icon='NODETREE').data_path = \
"material.pov.material_use_nodes"
class MATERIAL_PT_povray_active_node(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Active Node Settings"
bl_context = "material"
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'POVRAY_RENDER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
mat=context.material
ob = context.object
return mat and mat.pov.type == "SURFACE" and (engine in cls.COMPAT_ENGINES) and mat.pov.material_use_nodes
def draw(self, context):
layout = self.layout
mat = context.material
node_tree = mat.node_tree
if node_tree:
node = node_tree.nodes.active
if mat.use_nodes:
if node:
layout.prop(mat.pov,"material_active_node")
if node.bl_idname=="PovrayMaterialNode":
layout.context_pointer_set("node", node)
if hasattr(node, "draw_buttons_ext"):
node.draw_buttons_ext(context, layout)
elif hasattr(node, "draw_buttons"):
node.draw_buttons(context, layout)
value_inputs = [socket for socket in node.inputs if socket.enabled and not socket.is_linked]
if value_inputs:
layout.separator()
for socket in value_inputs:
row = layout.row()
socket.draw(context, row, node, socket.name)
else:
layout.context_pointer_set("node", node)
if hasattr(node, "draw_buttons_ext"):
node.draw_buttons_ext(context, layout)
elif hasattr(node, "draw_buttons"):
node.draw_buttons(context, layout)
value_inputs = [socket for socket in node.inputs if socket.enabled and not socket.is_linked]
if value_inputs:
layout.separator()
for socket in value_inputs:
row = layout.row()
socket.draw(context, row, node, socket.name)
else:
class MATERIAL_PT_POV_mirror(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Mirror"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'POVRAY_RENDER'}
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return check_material(mat) and (mat.pov.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
mat = context.material
raym = mat.pov_raytrace_mirror
self.layout.prop(raym, "use", text="")
def draw(self, context):
layout = self.layout
mat = context.material #Formerly : #mat = active_node_mat(context.material)
raym = mat.pov_raytrace_mirror
layout.active = raym.use
split = layout.split()
col = split.column()
col.prop(raym, "reflect_factor")
col.prop(raym, "mirror_color", text="")
col = split.column()
col.prop(raym, "fresnel")
sub = col.column()
sub.active = (raym.fresnel > 0.0)
sub.prop(raym, "fresnel_factor", text="Blend")
split = layout.split()
col = split.column()
col.separator()
col.prop(raym, "depth")
col.prop(raym, "distance", text="Max Dist")
col.separator()
sub.active = (raym.distance > 0.0)
sub.label(text="Fade To:")
sub.prop(raym, "fade_to", text="")
col = split.column()
col.label(text="Gloss:")
col.prop(raym, "gloss_factor", text="Amount")
sub = col.column()
sub.active = (raym.gloss_factor < 1.0)
sub.prop(raym, "gloss_threshold", text="Threshold")
sub.prop(raym, "gloss_samples", text="Samples")
sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
Maurice Raybaud
committed
class MATERIAL_PT_povray_reflection(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Reflection"
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
mat=context.material
ob = context.object
return mat and mat.pov.type == "SURFACE" and (engine in cls.COMPAT_ENGINES) and not (mat.pov.material_use_nodes or mat.use_nodes)
def draw(self, context):
layout = self.layout
Maurice Raybaud
committed
col = layout.column()
col.prop(mat.pov, "irid_enable")
if mat.pov.irid_enable:
Maurice Raybaud
committed
col.prop(mat.pov, "irid_amount", slider=True)
col.prop(mat.pov, "irid_thickness", slider=True)
col.prop(mat.pov, "irid_turbulence", slider=True)
Maurice Raybaud
committed
col.prop(mat.pov, "conserve_energy")
col2=col.split().column()
if not mat.pov_raytrace_mirror.use:
col2.label(text="Please Check Mirror settings :")
col2.active = mat.pov_raytrace_mirror.use
Maurice Raybaud
committed
col2.prop(mat.pov, "mirror_use_IOR")
if mat.pov.mirror_use_IOR:
col2.alignment = 'CENTER'
col2.label(text="The current Raytrace ")
col2.label(text="Transparency IOR is: " + str(mat.raytrace_transparency.ior))
Maurice Raybaud
committed
col2.prop(mat.pov, "mirror_metallic")
class MATERIAL_PT_povray_fade_color(MaterialButtonsPanel, bpy.types.Panel):
Maurice Raybaud
committed
bl_label = "POV-Ray Absorption"
COMPAT_ENGINES = {'POVRAY_RENDER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
mat=context.material
ob = context.object
return mat and mat.pov.type == "SURFACE" and (engine in cls.COMPAT_ENGINES) and not (mat.pov.material_use_nodes or mat.use_nodes)
def draw_header(self, context):
mat = context.material
Bastien Montagne
committed
self.layout.prop(mat.pov, "interior_fade_color", text="")
def draw(self, context):
layout = self.layout
mat = context.material
Maurice Raybaud
committed
# layout.active = mat.pov.interior_fade_color
if mat.pov.interior_fade_color != (0.0, 0.0, 0.0):
layout.label(text="Raytrace transparency")
layout.label(text="depth max Limit needs")
layout.label(text="to be non zero to fade")
Maurice Raybaud
committed
pass
class MATERIAL_PT_povray_caustics(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Caustics"
COMPAT_ENGINES = {'POVRAY_RENDER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
mat=context.material
ob = context.object
return mat and mat.pov.type == "SURFACE" and (engine in cls.COMPAT_ENGINES) and not (mat.pov.material_use_nodes or mat.use_nodes)
def draw_header(self, context):
mat = context.material
Maurice Raybaud
committed
if mat.pov.caustics_enable:
self.layout.prop(mat.pov, "caustics_enable", text="", icon="PMARKER_SEL" )
else:
self.layout.prop(mat.pov, "caustics_enable", text="", icon="PMARKER" )
def draw(self, context):
layout = self.layout
mat = context.material
Bastien Montagne
committed
layout.active = mat.pov.caustics_enable
Maurice Raybaud
committed
col = layout.column()
Bastien Montagne
committed
if mat.pov.caustics_enable:
Maurice Raybaud
committed
col.prop(mat.pov, "refraction_caustics")
if mat.pov.refraction_caustics:
col.prop(mat.pov, "refraction_type", text="")
Maurice Raybaud
committed
if mat.pov.refraction_type == "1":
col.prop(mat.pov, "fake_caustics_power", slider=True)
elif mat.pov.refraction_type == "2":
col.prop(mat.pov, "photons_dispersion", slider=True)
col.prop(mat.pov, "photons_dispersion_samples", slider=True)
Bastien Montagne
committed
col.prop(mat.pov, "photons_reflection")
Maurice Raybaud
committed
if not mat.pov.refraction_caustics and not mat.pov.photons_reflection:
col = layout.column()
col.alignment = 'CENTER'
col.label(text="Caustics override is on, ")
col.label(text="but you didn't chose any !")
Maurice Raybaud
committed
class MATERIAL_PT_povray_replacement_text(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Custom POV Code"
Campbell Barton
committed
COMPAT_ENGINES = {'POVRAY_RENDER'}
Maurice Raybaud
committed
Maurice Raybaud
committed
def draw(self, context):
layout = self.layout
mat = context.material
Maurice Raybaud
committed
col.label(text="Replace properties with:")
Bastien Montagne
committed
col.prop(mat.pov, "replacement_text", text="")
Maurice Raybaud
committed
class TEXTURE_PT_povray_type(TextureButtonsPanel, bpy.types.Panel):
bl_label = "POV-ray Textures"
COMPAT_ENGINES = {'POVRAY_RENDER'}
bl_options = {'HIDE_HEADER'}
Maurice Raybaud
committed
def draw(self, context):
layout = self.layout
tex = context.texture
split.label(text="POV:")
split.prop(tex.pov, "tex_pattern_type", text="")
class TEXTURE_PT_povray_preview(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Preview"
COMPAT_ENGINES = {'POVRAY_RENDER'}
bl_options = {'HIDE_HEADER'}
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
if not hasattr(context, "texture_slot"):
return False
tex=context.texture
mat=context.material
return (tex and (tex.pov.tex_pattern_type != 'emulator') and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
tex = context.texture
slot = getattr(context, "texture_slot", None)
idblock = context_tex_datablock(context)
layout = self.layout
# if idblock:
# layout.template_preview(tex, parent=idblock, slot=slot)
if tex.pov.tex_pattern_type != 'emulator':
layout.operator("tex.preview_update")
else:
layout.template_preview(tex, slot=slot)
class TEXTURE_PT_povray_parameters(TextureButtonsPanel, bpy.types.Panel):
bl_label = "POV-ray Pattern Options"
COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw(self, context):
mat = context.material
layout = self.layout
tex = context.texture
align=True
if tex is not None and tex.pov.tex_pattern_type != 'emulator':
if tex.pov.tex_pattern_type == 'agate':
layout.prop(tex.pov, "modifier_turbulence", text="Agate Turbulence")
if tex.pov.tex_pattern_type in {'spiral1', 'spiral2'}:
layout.prop(tex.pov, "modifier_numbers", text="Number of arms")
if tex.pov.tex_pattern_type == 'tiling':
layout.prop(tex.pov, "modifier_numbers", text="Pattern number")
if tex.pov.tex_pattern_type == 'magnet':
layout.prop(tex.pov, "magnet_style", text="Magnet style")
if tex.pov.tex_pattern_type == 'quilted':
row = layout.row(align=align)
row.prop(tex.pov, "modifier_control0", text="Control0")
row.prop(tex.pov, "modifier_control1", text="Control1")
if tex.pov.tex_pattern_type == 'brick':
col = layout.column(align=align)
row = col.row()
row.prop(tex.pov, "brick_size_x", text="Brick size X")
row.prop(tex.pov, "brick_size_y", text="Brick size Y")
row=col.row()
row.prop(tex.pov, "brick_size_z", text="Brick size Z")
row.prop(tex.pov, "brick_mortar", text="Brick mortar")
if tex.pov.tex_pattern_type in {'julia','mandel','magnet'}:
col = layout.column(align=align)
if tex.pov.tex_pattern_type == 'julia':
row = col.row()
row.prop(tex.pov, "julia_complex_1", text="Complex 1")
row.prop(tex.pov, "julia_complex_2", text="Complex 2")
if tex.pov.tex_pattern_type == 'magnet' and tex.pov.magnet_style == 'julia':
row = col.row()
row.prop(tex.pov, "julia_complex_1", text="Complex 1")
row.prop(tex.pov, "julia_complex_2", text="Complex 2")
row=col.row()
if tex.pov.tex_pattern_type in {'julia','mandel'}:
row.prop(tex.pov, "f_exponent", text="Exponent")
row.prop(tex.pov, "magnet_type", text="Type")
row.prop(tex.pov, "f_iter", text="Iterations")
row=col.row()
row.prop(tex.pov, "f_ior", text="Interior")
row.prop(tex.pov, "f_ior_fac", text="Factor I")
row=col.row()
row.prop(tex.pov, "f_eor", text="Exterior")
row.prop(tex.pov, "f_eor_fac", text="Factor E")
layout.label(text="Gradient orientation:")
column_flow = layout.column_flow(columns=3, align=True)
column_flow.prop(tex.pov, "grad_orient_x", text="X")
column_flow.prop(tex.pov, "grad_orient_y", text="Y")
column_flow.prop(tex.pov, "grad_orient_z", text="Z")
if tex.pov.tex_pattern_type == 'pavement':
layout.prop(tex.pov, "pave_sides", text="Pavement:number of sides")
col = layout.column(align=align)
column_flow = col.column_flow(columns=3, align=True)
column_flow.prop(tex.pov, "pave_tiles", text="Tiles")
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
if tex.pov.pave_sides == '4' and tex.pov.pave_tiles == 6:
column_flow.prop(tex.pov, "pave_pat_35", text="Pattern")
if tex.pov.pave_sides == '6' and tex.pov.pave_tiles == 5:
column_flow.prop(tex.pov, "pave_pat_22", text="Pattern")
if tex.pov.pave_sides == '4' and tex.pov.pave_tiles == 5:
column_flow.prop(tex.pov, "pave_pat_12", text="Pattern")
if tex.pov.pave_sides == '3' and tex.pov.pave_tiles == 6:
column_flow.prop(tex.pov, "pave_pat_12", text="Pattern")
if tex.pov.pave_sides == '6' and tex.pov.pave_tiles == 4:
column_flow.prop(tex.pov, "pave_pat_7", text="Pattern")
if tex.pov.pave_sides == '4' and tex.pov.pave_tiles == 4:
column_flow.prop(tex.pov, "pave_pat_5", text="Pattern")
if tex.pov.pave_sides == '3' and tex.pov.pave_tiles == 5:
column_flow.prop(tex.pov, "pave_pat_4", text="Pattern")
if tex.pov.pave_sides == '6' and tex.pov.pave_tiles == 3:
column_flow.prop(tex.pov, "pave_pat_3", text="Pattern")
if tex.pov.pave_sides == '3' and tex.pov.pave_tiles == 4:
column_flow.prop(tex.pov, "pave_pat_3", text="Pattern")
if tex.pov.pave_sides == '4' and tex.pov.pave_tiles == 3:
column_flow.prop(tex.pov, "pave_pat_2", text="Pattern")
if tex.pov.pave_sides == '6' and tex.pov.pave_tiles == 6:
column_flow.label(text="!!! 5 tiles!")
column_flow.prop(tex.pov, "pave_form", text="Form")
if tex.pov.tex_pattern_type == 'function':
layout.prop(tex.pov, "func_list", text="Functions")
if tex.pov.tex_pattern_type == 'function' and tex.pov.func_list != "NONE":
func = None
if tex.pov.func_list in {"f_noise3d", "f_ph", "f_r", "f_th"}:
func = 0
if tex.pov.func_list in {"f_comma","f_crossed_trough","f_cubic_saddle",
"f_cushion","f_devils_curve","f_enneper","f_glob",
"f_heart","f_hex_x","f_hex_y","f_hunt_surface",
"f_klein_bottle","f_kummer_surface_v1",
"f_lemniscate_of_gerono","f_mitre","f_nodal_cubic",
"f_noise_generator","f_odd","f_paraboloid","f_pillow",
"f_piriform","f_quantum","f_quartic_paraboloid",
"f_quartic_saddle","f_sphere","f_steiners_roman",
"f_torus_gumdrop","f_umbrella"}:
func = 1
if tex.pov.func_list in {"f_bicorn","f_bifolia","f_boy_surface","f_superellipsoid",
"f_torus"}:
func = 2
if tex.pov.func_list in {"f_ellipsoid","f_folium_surface","f_hyperbolic_torus",
"f_kampyle_of_eudoxus","f_parabolic_torus",
"f_quartic_cylinder","f_torus2"}:
func = 3
if tex.pov.func_list in {"f_blob2","f_cross_ellipsoids","f_flange_cover",
"f_isect_ellipsoids","f_kummer_surface_v2",
"f_ovals_of_cassini","f_rounded_box","f_spikes_2d",
"f_strophoid"}:
if tex.pov.func_list in {"f_algbr_cyl1","f_algbr_cyl2","f_algbr_cyl3",
"f_algbr_cyl4","f_blob","f_mesh1","f_poly4","f_spikes"}:
if tex.pov.func_list in {"f_devils_curve_2d","f_dupin_cyclid",
"f_folium_surface_2d","f_hetero_mf",
"f_kampyle_of_eudoxus_2d","f_lemniscate_of_gerono_2d",
"f_polytubes","f_ridge","f_ridged_mf","f_spiral",
"f_witch_of_agnesi"}:
func = 6
if tex.pov.func_list in {"f_helix1","f_helix2","f_piriform_2d","f_strophoid_2d"}:
func = 7
if tex.pov.func_list == "f_helical_torus":
func = 8
column_flow = layout.column_flow(columns=3, align=True)
column_flow.prop(tex.pov, "func_plus_x", text="")
column_flow.prop(tex.pov, "func_x", text="Value")
column_flow = layout.column_flow(columns=3, align=True)
column_flow.prop(tex.pov, "func_plus_y", text="")
column_flow.prop(tex.pov, "func_y", text="Value")
column_flow = layout.column_flow(columns=3, align=True)
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
column_flow.prop(tex.pov, "func_plus_z", text="")
column_flow.prop(tex.pov, "func_z", text="Value")
row=layout.row(align=align)
if func > 0:
row.prop(tex.pov, "func_P0", text="P0")
if func > 1:
row.prop(tex.pov, "func_P1", text="P1")
row=layout.row(align=align)
if func > 2:
row.prop(tex.pov, "func_P2", text="P2")
if func > 3:
row.prop(tex.pov, "func_P3", text="P3")
row=layout.row(align=align)
if func > 4:
row.prop(tex.pov, "func_P4", text="P4")
if func > 5:
row.prop(tex.pov, "func_P5", text="P5")
row=layout.row(align=align)
if func > 6:
row.prop(tex.pov, "func_P6", text="P6")
if func > 7:
row.prop(tex.pov, "func_P7", text="P7")
row=layout.row(align=align)
row.prop(tex.pov, "func_P8", text="P8")
row.prop(tex.pov, "func_P9", text="P9")
###################################################End Patterns############################
layout.prop(tex.pov, "warp_types", text="Warp types") #warp
if tex.pov.warp_types == "TOROIDAL":
layout.prop(tex.pov, "warp_tor_major_radius", text="Major radius")
if tex.pov.warp_types not in {"CUBIC","NONE"}:
layout.prop(tex.pov, "warp_orientation", text="Warp orientation")
col = layout.column(align=align)
row = col.row()
row.prop(tex.pov, "warp_dist_exp", text="Distance exponent")
row = col.row()
row.prop(tex.pov, "modifier_frequency", text="Frequency")
row.prop(tex.pov, "modifier_phase", text="Phase")
row=layout.row()
row.label(text="Offset:")
row.label(text="Scale:")
row.label(text="Rotate:")
row=col.row()
row.prop(tex.pov, "tex_mov_x", text="X")
row.prop(tex.pov, "tex_scale_x", text="X")
row.prop(tex.pov, "tex_rot_x", text="X")
row=col.row()
row.prop(tex.pov, "tex_mov_y", text="Y")
row.prop(tex.pov, "tex_scale_y", text="Y")
row.prop(tex.pov, "tex_rot_y", text="Y")
row=col.row()
row.prop(tex.pov, "tex_mov_z", text="Z")
row.prop(tex.pov, "tex_scale_z", text="Z")
row.prop(tex.pov, "tex_rot_z", text="Z")
row=layout.row()
row.label(text="Turbulence:")
row=col.row()
row.prop(tex.pov, "warp_turbulence_x", text="X")
row.prop(tex.pov, "modifier_octaves", text="Octaves")
row=col.row()
row.prop(tex.pov, "warp_turbulence_y", text="Y")
row.prop(tex.pov, "modifier_lambda", text="Lambda")
row=col.row()
row.prop(tex.pov, "warp_turbulence_z", text="Z")
row.prop(tex.pov, "modifier_omega", text="Omega")
class TEXTURE_PT_povray_tex_gamma(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Image Gamma"
COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw_header(self, context):
tex = context.texture
self.layout.prop(tex.pov, "tex_gamma_enable", text="", icon='SEQ_LUMA_WAVEFORM')
def draw(self, context):
layout = self.layout
tex = context.texture
Bastien Montagne
committed
layout.active = tex.pov.tex_gamma_enable
layout.prop(tex.pov, "tex_gamma_value", text="Gamma Value")
#commented out below UI for texture only custom code inside exported material:
# class TEXTURE_PT_povray_replacement_text(TextureButtonsPanel, bpy.types.Panel):
# bl_label = "Custom POV Code"
# COMPAT_ENGINES = {'POVRAY_RENDER'}
# def draw(self, context):
# layout = self.layout
Maurice Raybaud
committed
# tex = context.texture
Maurice Raybaud
committed
# col = layout.column()
# col.label(text="Replace properties with:")
# col.prop(tex.pov, "replacement_text", text="")
Maurice Raybaud
committed
class OBJECT_PT_povray_obj_parameters(ObjectButtonsPanel, bpy.types.Panel):
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
return (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
obj = context.object
split = layout.split()
col = split.column(align=True)
Bastien Montagne
committed
col.prop(obj.pov, "importance_value", text="Importance")
Bastien Montagne
committed
col.prop(obj.pov, "collect_photons", text="Receive Photon Caustics")
Maurice Raybaud
committed
if obj.pov.collect_photons:
col.prop(obj.pov, "spacing_multiplier", text="Photons Spacing Multiplier")
split = layout.split()
col = split.column()
col.prop(obj.pov,"hollow")
col.prop(obj.pov,"double_illuminate")
if obj.type == 'META' or obj.pov.curveshape == 'lathe':
#if obj.pov.curveshape == 'sor'
col.prop(obj.pov,"sturm")
col.prop(obj.pov,"no_shadow")
col.prop(obj.pov,"no_image")
col.prop(obj.pov,"no_reflection")
col.prop(obj.pov,"no_radiosity")
col.prop(obj.pov,"inverse")
col.prop(obj.pov,"hierarchy")
# col.prop(obj.pov,"boundorclip",text="Bound / Clip")
# if obj.pov.boundorclip != "none":
# col.prop_search(obj.pov,"boundorclipob",context.blend_data,"objects",text="Object")
# text = "Clipped by"
# if obj.pov.boundorclip == "clipped_by":
# text = "Bounded by"
# col.prop(obj.pov,"addboundorclip",text=text)
Campbell Barton
committed
class OBJECT_PT_povray_obj_sphere(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Sphere"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'SPHERE' and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column()
if obj.pov.object_as == 'SPHERE':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
col.label(text="Sphere radius: " + str(obj.pov.sphere_radius))
else:
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters
layout.operator("pov.sphere_update", text="Update",icon="SOLID")
#col.label(text="Parameters:")
col.prop(obj.pov, "sphere_radius", text="Radius of Sphere")
Maurice Raybaud
committed
class OBJECT_PT_povray_obj_cylinder(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Cylinder"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'CYLINDER' and (engine in cls.COMPAT_ENGINES))
Maurice Raybaud
committed
def draw(self, context):
layout = self.layout
obj = context.object
Maurice Raybaud
committed
col = layout.column()
if obj.pov.object_as == 'CYLINDER':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
Maurice Raybaud
committed
col.label(text="Cylinder radius: " + str(obj.pov.cylinder_radius))
col.label(text="Cylinder cap location: " + str(obj.pov.cylinder_location_cap))
else:
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
Maurice Raybaud
committed
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters
layout.operator("pov.cylinder_update", text="Update",icon="MESH_CYLINDER")
Maurice Raybaud
committed
#col.label(text="Parameters:")
col.prop(obj.pov, "cylinder_radius")
col.prop(obj.pov, "cylinder_location_cap")
class OBJECT_PT_povray_obj_cone(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Cone"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'CONE' and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column()
if obj.pov.object_as == 'CONE':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
col.label(text="Cone base radius: " + str(obj.pov.cone_base_radius))
col.label(text="Cone cap radius: " + str(obj.pov.cone_cap_radius))
col.label(text="Cone proxy segments: " + str(obj.pov.cone_segments))
col.label(text="Cone height: " + str(obj.pov.cone_height))
else:
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters
layout.operator("pov.cone_update", text="Update",icon="MESH_CONE")
#col.label(text="Parameters:")
col.prop(obj.pov, "cone_base_radius", text="Radius of Cone Base")
col.prop(obj.pov, "cone_cap_radius", text="Radius of Cone Cap")
col.prop(obj.pov, "cone_segments", text="Segmentation of Cone proxy")
col.prop(obj.pov, "cone_height", text="Height of the cone")
class OBJECT_PT_povray_obj_superellipsoid(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Superquadric ellipsoid"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'SUPERELLIPSOID' and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column()
if obj.pov.object_as == 'SUPERELLIPSOID':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
col.label(text="Radial segmentation: " + str(obj.pov.se_u))
col.label(text="Lateral segmentation: " + str(obj.pov.se_v))
col.label(text="Ring shape: " + str(obj.pov.se_n1))
col.label(text="Cross-section shape: " + str(obj.pov.se_n2))
col.label(text="Fill up and down: " + str(obj.pov.se_edit))
else:
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters
layout.operator("pov.superellipsoid_update", text="Update",icon="MOD_SUBSURF")
#col.label(text="Parameters:")
col.prop(obj.pov, "se_u")
col.prop(obj.pov, "se_v")
col.prop(obj.pov, "se_n1")
col.prop(obj.pov, "se_n2")
col.prop(obj.pov, "se_edit")
class OBJECT_PT_povray_obj_torus(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Torus"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'TORUS' and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column()
if obj.pov.object_as == 'TORUS':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
col.label(text="Torus major radius: " + str(obj.pov.torus_major_radius))
col.label(text="Torus minor radius: " + str(obj.pov.torus_minor_radius))
col.label(text="Torus major segments: " + str(obj.pov.torus_major_segments))
col.label(text="Torus minor segments: " + str(obj.pov.torus_minor_segments))
else:
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters
layout.operator("pov.torus_update", text="Update",icon="MESH_TORUS")
#col.label(text="Parameters:")
col.prop(obj.pov, "torus_major_radius")
col.prop(obj.pov, "torus_minor_radius")
col.prop(obj.pov, "torus_major_segments")
col.prop(obj.pov, "torus_minor_segments")
class OBJECT_PT_povray_obj_supertorus(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray SuperTorus"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'SUPERTORUS' and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column()
if obj.pov.object_as == 'SUPERTORUS':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
col.label(text="SuperTorus major radius: " + str(obj.pov.st_major_radius))
col.label(text="SuperTorus minor radius: " + str(obj.pov.st_minor_radius))
col.label(text="SuperTorus major segments: " + str(obj.pov.st_u))
col.label(text="SuperTorus minor segments: " + str(obj.pov.st_v))
col.label(text="SuperTorus Ring Manipulator: " + str(obj.pov.st_ring))
col.label(text="SuperTorus Cross Manipulator: " + str(obj.pov.st_cross))
col.label(text="SuperTorus Internal And External radii: " + str(obj.pov.st_ie))
col.label(text="SuperTorus accuracy: " + str(ob.pov.st_accuracy))
col.label(text="SuperTorus max gradient: " + str(ob.pov.st_max_gradient))
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters
layout.operator("pov.supertorus_update", text="Update",icon="MESH_TORUS")
#col.label(text="Parameters:")
col.prop(obj.pov, "st_major_radius")
col.prop(obj.pov, "st_minor_radius")
col.prop(obj.pov, "st_u")
col.prop(obj.pov, "st_v")
col.prop(obj.pov, "st_ring")
col.prop(obj.pov, "st_cross")
col.prop(obj.pov, "st_ie")
#col.prop(obj.pov, "st_edit") #?
col.prop(obj.pov, "st_accuracy")
col.prop(obj.pov, "st_max_gradient")
class OBJECT_PT_povray_obj_parametric(PovDataButtonsPanel, bpy.types.Panel):
bl_label = "POV-Ray Parametric surface"
COMPAT_ENGINES = {'POVRAY_RENDER'}
#bl_options = {'HIDE_HEADER'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
obj = context.object
return (obj and obj.pov.object_as == 'PARAMETRIC' and (engine in cls.COMPAT_ENGINES))
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column()
if obj.pov.object_as == 'PARAMETRIC':
if obj.pov.unlock_parameters == False:
col.prop(obj.pov, "unlock_parameters", text="Exported parameters below", icon='LOCKED')
col.label(text="Minimum U: " + str(obj.pov.u_min))
col.label(text="Minimum V: " + str(obj.pov.v_min))
col.label(text="Maximum U: " + str(obj.pov.u_max))
col.label(text="Minimum V: " + str(obj.pov.v_min))
col.label(text="X Function: " + str(obj.pov.x_eq))
col.label(text="Y Function: " + str(obj.pov.y_eq))
col.label(text="Z Function: " + str(obj.pov.x_eq))
else:
col.prop(obj.pov, "unlock_parameters", text="Edit exported parameters", icon='UNLOCKED')
col.label(text="3D view proxy may get out of synch")
col.active = obj.pov.unlock_parameters