Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_scene.py
| Show First 20 Lines • Show All 491 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, Panel): | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| bl_label = "LANPR" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| @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 | |||||
| layout.prop(lanpr, "master_mode", expand=True) | |||||
| if lanpr.master_mode == "DPIX" or lanpr.master_mode == "SOFTWARE": | |||||
| if lanpr.master_mode == "DPIX": | |||||
| layout.prop(lanpr, "reloaded") | |||||
| rows = 4 | |||||
| if lanpr.master_mode == "SOFTWARE": | |||||
| layout.label(text="Enable On Demand:") | |||||
| layout.prop(lanpr,"calculate_intersections", toggle = True, text = "Enable Intersection Lines") | |||||
| layout.label(text="RUN:") | |||||
| layout.operator("scene.lanpr_calculate", icon='RENDER_STILL') | |||||
| layout.label(text="Layer Composition:") | |||||
| layout.template_list("LANPR_linesets", "", lanpr, "layers", lanpr.layers, "active_layer_index", rows=rows) | |||||
| if active_layer: | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.operator("scene.lanpr_add_line_layer", icon="ZOOMIN") | |||||
| col.operator("scene.lanpr_delete_line_layer", icon="ZOOMOUT") | |||||
| col = split.column() | |||||
| col.operator("scene.lanpr_move_line_layer", icon="TRIA_UP").direction = "UP" | |||||
| col.operator("scene.lanpr_move_line_layer", icon="TRIA_DOWN").direction = "DOWN" | |||||
| layout.operator("scene.lanpr_rebuild_all_commands") | |||||
| else: | |||||
| layout.operator("scene.lanpr_add_line_layer") | |||||
| elif not lanpr.layers.active_layer: | |||||
| layout.operator("scene.lanpr_add_line_layer") | |||||
| else: | |||||
| layout.label(text="Vectorization:") | |||||
| layout.prop(lanpr, "enable_vector_trace", expand = True) | |||||
| #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) | |||||
| class SCENE_PT_lanpr_line_types(SceneButtonsPanel, Panel): | |||||
| bl_label = "Types" | |||||
| bl_parent_id = "SCENE_PT_lanpr" | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| active_layer = lanpr.layers.active_layer | |||||
| return active_layer and lanpr.master_mode != "SNAKE" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| active_layer = lanpr.layers.active_layer | |||||
| split = layout.split(percentage=0.3) | |||||
| col = split.column() | |||||
| col.prop(active_layer, "enable_contour", text="Contour", toggle=True) | |||||
| col.prop(active_layer, "enable_crease", text="Crease", toggle=True) | |||||
| col.prop(active_layer, "enable_edge_mark", text="Mark", toggle=True) | |||||
| col.prop(active_layer, "enable_material_seperate", text="Material", toggle=True) | |||||
| col.prop(active_layer, "enable_intersection", text="Intersection", toggle=True) | |||||
| col = split.column() | |||||
| row = col.row(align = True) | |||||
| #row.enabled = active_layer.enable_contour this is always enabled now | |||||
| row.prop(active_layer, "color", text="") | |||||
| row.prop(active_layer, "thickness", text="") | |||||
| row = col.row(align = True) | |||||
| row.enabled = active_layer.enable_crease | |||||
| row.prop(active_layer, "crease_color", text="") | |||||
| row.prop(active_layer, "thickness_crease", text="") | |||||
| row = col.row(align = True) | |||||
| row.enabled = active_layer.enable_edge_mark | |||||
| row.prop(active_layer, "edge_mark_color", text="") | |||||
| row.prop(active_layer, "thickness_edge_mark", text="") | |||||
| row = col.row(align = True) | |||||
| row.enabled = active_layer.enable_material_seperate | |||||
| row.prop(active_layer, "material_color", text="") | |||||
| row.prop(active_layer, "thickness_material", text="") | |||||
| row = col.row(align = True) | |||||
| if lanpr.calculate_intersections: | |||||
| row.enabled = active_layer.enable_intersection | |||||
| row.prop(active_layer, "intersection_color", text="") | |||||
| row.prop(active_layer, "thickness_intersection", text="") | |||||
| else: | |||||
| row.label(text= "Intersection Calculation Disabled") | |||||
| if lanpr.master_mode == "DPIX" and active_layer.enable_intersection: | |||||
| row = col.row(align = True) | |||||
| row.prop(lanpr,"calculate_intersections", toggle = True, text = "Enable") | |||||
| if lanpr.calculate_intersections: | |||||
| row.operator("scene.lanpr_calculate", text= "Recalculate") | |||||
| if lanpr.master_mode == "SOFTWARE": | |||||
| row = layout.row(align=True) | |||||
| row.prop(active_layer, "qi_begin") | |||||
| row.prop(active_layer, "qi_end") | |||||
| class SCENE_PT_lanpr_line_components(SceneButtonsPanel, Panel): | |||||
| bl_label = "Including" | |||||
| bl_parent_id = "SCENE_PT_lanpr" | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| active_layer = lanpr.layers.active_layer | |||||
| return active_layer and lanpr.master_mode == "SOFTWARE" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| active_layer = lanpr.layers.active_layer | |||||
| layout.operator("scene.lanpr_add_line_component", icon = "ZOOMIN") | |||||
| i=0 | |||||
| for c in active_layer.components: | |||||
| split = layout.split(percentage=0.85) | |||||
| col = split.column() | |||||
| sp2 = col.split(percentage=0.4) | |||||
| cl = sp2.column() | |||||
| cl.prop(c,"component_mode", text = "") | |||||
| cl = sp2.column() | |||||
| if c.component_mode == "OBJECT": | |||||
| cl.prop(c,"object_select", text = "") | |||||
| elif c.component_mode == "MATERIAL": | |||||
| cl.prop(c,"material_select", text = "") | |||||
| elif c.component_mode == "COLLECTION": | |||||
| cl.prop(c,"collection_select", text = "") | |||||
| col = split.column() | |||||
| col.operator("scene.lanpr_delete_line_component", text="", icon = "ZOOMOUT").index=i | |||||
| i=i+1 | |||||
| class SCENE_PT_lanpr_line_effects(SceneButtonsPanel, Panel): | |||||
| bl_label = "Effects" | |||||
| bl_parent_id = "SCENE_PT_lanpr" | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| return lanpr.master_mode == "DPIX" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| active_layer = lanpr.layers.active_layer | |||||
| row = layout.row(align = True) | |||||
| row.prop(lanpr, "crease_threshold") | |||||
| row.prop(lanpr, "crease_fade_threshold") | |||||
| row = layout.row(align = True) | |||||
| row.prop(lanpr, "depth_width_influence") | |||||
| row.prop(lanpr, "depth_width_curve") | |||||
| row = layout.row(align = True) | |||||
| row.prop(lanpr, "depth_alpha_influence") | |||||
| row.prop(lanpr, "depth_alpha_curve") | |||||
| class SCENE_PT_lanpr_snake_sobel_parameters(SceneButtonsPanel, Panel): | |||||
| bl_label = "Sobel Parameters" | |||||
| bl_parent_id = "SCENE_PT_lanpr" | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| return lanpr.master_mode == "SNAKE" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| layout.prop(lanpr, "depth_clamp") | |||||
| layout.prop(lanpr, "depth_strength") | |||||
| layout.prop(lanpr, "normal_clamp") | |||||
| layout.prop(lanpr, "normal_strength") | |||||
| if lanpr.enable_vector_trace == "DISABLED": | |||||
| layout.prop(lanpr, "display_thinning_result") | |||||
| class SCENE_PT_lanpr_snake_settings(SceneButtonsPanel, Panel): | |||||
| bl_label = "Snake Settings" | |||||
| bl_parent_id = "SCENE_PT_lanpr" | |||||
| COMPAT_ENGINES = {'BLENDER_CLAY'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| return lanpr.master_mode == "SNAKE" and lanpr.enable_vector_trace == "ENABLED" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| scene = context.scene | |||||
| lanpr = scene.lanpr | |||||
| split = layout.split() | |||||
| col = split.column() | |||||
| col.prop(lanpr, "background_color") | |||||
| col = split.column() | |||||
| col.prop(lanpr, "line_color") | |||||
| layout.prop(lanpr, "line_thickness") | |||||
| 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.label(text="Taper:") | |||||
| layout.prop(lanpr, "use_same_taper", expand = True) | |||||
| if lanpr.use_same_taper == "DISABLED": | |||||
| split = layout.split() | |||||
| col = split.column(align = True) | |||||
| col.label(text="Left:") | |||||
| col.prop(lanpr,"taper_left_distance") | |||||
| col.prop(lanpr,"taper_left_strength") | |||||
| col = split.column(align = True) | |||||
| col.label(text="Right:") | |||||
| col.prop(lanpr,"taper_right_distance") | |||||
| col.prop(lanpr,"taper_right_strength") | |||||
| else: | |||||
| split = layout.split() | |||||
| col = split.column(align = True) | |||||
| col.prop(lanpr,"taper_left_distance") | |||||
| col.prop(lanpr,"taper_left_strength") | |||||
| layout.label(text="Tip Extend:") | |||||
| layout.prop(lanpr, "enable_tip_extend", expand = True) | |||||
| if lanpr.enable_tip_extend == "ENABLED": | |||||
| layout.label(text="---INOP---") | |||||
| layout.prop(lanpr,"extend_length") | |||||
| 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 29 Lines | classes = ( | ||||
| 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_simplify_viewport, | SCENE_PT_simplify_viewport, | ||||
| SCENE_PT_simplify_render, | SCENE_PT_simplify_render, | ||||
| SCENE_PT_custom_props, | SCENE_PT_custom_props, | ||||
| SCENE_PT_lanpr, | |||||
| SCENE_PT_lanpr_line_types, | |||||
| SCENE_PT_lanpr_line_components, | |||||
| SCENE_PT_lanpr_line_effects, | |||||
| SCENE_PT_lanpr_snake_sobel_parameters, | |||||
| SCENE_PT_lanpr_snake_settings, | |||||
| 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) | ||||