Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_scene.py
| Show First 20 Lines • Show All 470 Lines • ▼ Show 20 Lines | class SCENE_PT_viewport_display(SceneButtonsPanel, Panel): | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| scene = context.scene | scene = context.scene | ||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(scene.display, "light_direction") | col.prop(scene.display, "light_direction") | ||||
| col.prop(scene.display, "shadow_shift") | col.prop(scene.display, "shadow_shift") | ||||
| class LANPR_linesets(UIList): | |||||
| def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): | |||||
| lineset = item | |||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | |||||
| split = layout.split(percentage=0.6) | |||||
| split.label(text="Layer") | |||||
| row = split.row(align=True) | |||||
| row.prop(lineset, "color", text="", icon_value=icon) | |||||
| row.prop(lineset, "thickness", text="", icon_value=icon) | |||||
| elif self.layout_type == 'GRID': | |||||
| layout.alignment = 'CENTER' | |||||
| layout.label("", icon_value=icon) | |||||
| class SCENE_PT_lanpr(SceneButtonsPanel, PropertyPanel, Panel): | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| bl_label = "LANPR AHOY" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return True | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| active_layer = lanpr.layers.active_layer #this is alwas none. | |||||
| layout.prop(lanpr, "master_mode", expand=True) | |||||
| if lanpr.master_mode == "DPIX": | |||||
| layout.label(text="DPIX:") | |||||
| layout.prop(lanpr, "reloaded") | |||||
| layout.label(text="Effect Settings:") | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(lanpr, "background_color") | |||||
| col = split.column() | |||||
| col.prop(lanpr, "line_color") | |||||
| layout.label(text="Layer Composition:") | |||||
| row = layout.row() | |||||
| rows = 4 | |||||
| layout.template_list("LANPR_linesets", "", lanpr, "layers", lanpr.layers, "active_layer_index", rows=rows) | |||||
| layout.operator("scene.lanpr_add_line_layer") | |||||
| if active_layer: | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(active_layer, "color", text="") | |||||
| col = split.column() | |||||
| col.prop(active_layer, "thickness") | |||||
| if active_layer.thickness > 0.01: | |||||
| col = layout.column() | |||||
| col.label(text="Enable:") | |||||
| row = col.row(align=True) | |||||
| row.prop(active_layer, "enable_crease", text="Crease", toggle=True) | |||||
| row.prop(active_layer, "enable_edge_mark", text="Mark", toggle=True) | |||||
| row.prop(active_layer, "enable_material_seperate", text="Material", toggle=True) | |||||
| row.prop(active_layer, "enable_intersection", text="Intersection", toggle=True) | |||||
| row = col.row(align=True) | |||||
| if lanpr.enable_crease: | |||||
| row.prop(active_layer, "crease_color", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| if lanpr.enable_edge_mark: | |||||
| row.prop(active_layer, "edge_mark_color", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| if lanpr.enable_material_seperate: | |||||
| row.prop(active_layer, "material_color", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| if lanpr.enable_intersection: | |||||
| row.prop(active_layer, "intersection_color", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| row = col.row(align=True) | |||||
| if lanpr.enable_crease: | |||||
| row.prop(active_layer, "line_thickness_crease", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| if lanpr.enable_edge_mark: | |||||
| row.prop(active_layer, "line_thickness_edge_mark", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| if lanpr.enable_material_seperate: | |||||
| row.prop(active_layer, "line_thickness_material", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| if lanpr.enable_intersection: | |||||
| row.prop(active_layer, "intersection_material", text="") | |||||
| else: | |||||
| row.label(text="OFF") | |||||
| layout.prop(lanpr, "crease_threshold") | |||||
| layout.prop(lanpr, "crease_fade_threshold") | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(lanpr, "depth_width_influence") | |||||
| col.prop(lanpr, "depth_alpha_influence") | |||||
| col = split.column() | |||||
| col.prop(lanpr, "depth_width_curve") | |||||
| col.prop(lanpr, "depth_alpha_curve") | |||||
| else: | |||||
| layout.label(text="Snake:") | |||||
| layout.prop(lanpr, "enable_vector_trace") | |||||
| if lanpr.enable_vector_trace == "DISABLED": | |||||
| layout.prop(lanpr, "display_thinning_result") | |||||
| layout.prop(lanpr, "depth_clamp") | |||||
| layout.prop(lanpr, "depth_strength") | |||||
| layout.prop(lanpr, "normal_clamp") | |||||
| layout.prop(lanpr, "normal_strength") | |||||
| col = layout.column() | |||||
| col.label(text="Enable:") | |||||
| row = col.row(align=True) | |||||
| row.prop(lanpr, "enable_edge_mark", text="Mark", toggle=True) | |||||
| row.prop(lanpr, "enable_material_seperate", text="Material", toggle=True) | |||||
| if lanpr.enable_vector_trace == "ENABLED": | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(lanpr, "background_color") | |||||
| col = split.column() | |||||
| col.prop(lanpr, "line_color") | |||||
| layout.label(text="Thickness:") | |||||
| layout.prop(lanpr, "line_thickness") | |||||
| layout.label(text="Effect Settings:") | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(lanpr, "depth_width_influence") | |||||
| col.prop(lanpr, "depth_alpha_influence") | |||||
| col = split.column() | |||||
| col.prop(lanpr, "depth_width_curve") | |||||
| col.prop(lanpr, "depth_alpha_curve") | |||||
| layout.prop(lanpr, "use_same_taper") | |||||
| if lanpr.use_same_taper == "DISABLED": | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.label(text="Left:") | |||||
| col.prop(lanpr,"taper_left_distance") | |||||
| col.prop(lanpr,"taper_left_strength") | |||||
| col = split.column() | |||||
| col.label(text="Right:") | |||||
| col.prop(lanpr,"taper_right_distance") | |||||
| col.prop(lanpr,"taper_right_strength") | |||||
| else: | |||||
| layout.prop(lanpr,"taper_left_distance") | |||||
| layout.prop(lanpr,"taper_left_strength") | |||||
| layout.prop(lanpr, "enable_tip_extend") | |||||
| if lanpr.enable_tip_extend == "ENABLED": | |||||
| layout.prop(lanpr,"extend_length") | |||||
| else: #disabled vectorization | |||||
| layout.label(text="Adjust values to avoid large pure white regions!") | |||||
| class SCENE_PT_viewport_display_ssao(SceneButtonsPanel, Panel): | class SCENE_PT_viewport_display_ssao(SceneButtonsPanel, Panel): | ||||
| bl_label = "Screen Space Ambient Occlusion" | bl_label = "Screen Space Ambient Occlusion" | ||||
| bl_parent_id = "SCENE_PT_viewport_display" | bl_parent_id = "SCENE_PT_viewport_display" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return True | return True | ||||
| Show All 26 Lines | classes = ( | ||||
| SCENE_PT_viewport_display, | SCENE_PT_viewport_display, | ||||
| SCENE_PT_viewport_display_ssao, | SCENE_PT_viewport_display_ssao, | ||||
| SCENE_PT_audio, | SCENE_PT_audio, | ||||
| SCENE_PT_physics, | SCENE_PT_physics, | ||||
| SCENE_PT_rigid_body_world, | SCENE_PT_rigid_body_world, | ||||
| SCENE_PT_rigid_body_cache, | SCENE_PT_rigid_body_cache, | ||||
| SCENE_PT_rigid_body_field_weights, | SCENE_PT_rigid_body_field_weights, | ||||
| SCENE_PT_simplify, | SCENE_PT_simplify, | ||||
| SCENE_PT_lanpr, | |||||
| SCENE_PT_custom_props, | SCENE_PT_custom_props, | ||||
| LANPR_linesets, | |||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||