Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_node.py
| Context not available. | |||||
| socket.draw(context, row, node, iface_(socket.name, socket.bl_rna.translation_context)) | socket.draw(context, row, node, iface_(socket.name, socket.bl_rna.translation_context)) | ||||
| class NODE_PT_options(Panel): | |||||
| bl_space_type = 'NODE_EDITOR' | |||||
| bl_region_type = 'UI' | |||||
| bl_label = "Options" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| COMPAT_ENGINES = {'BLENDER_EEVEE'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| engine = context.engine | |||||
| return context.active_object.active_material and (engine in cls.COMPAT_ENGINES) and context.space_data.shader_type == 'OBJECT' | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| mat = context.active_object.active_material | |||||
| layout.prop(mat, "blend_method") | |||||
| if mat.blend_method != 'OPAQUE': | |||||
| layout.prop(mat, "transparent_shadow_method") | |||||
| row = layout.row() | |||||
| row.active = ((mat.blend_method == 'CLIP') or (mat.transparent_shadow_method == 'CLIP')) | |||||
| row.prop(mat, "alpha_threshold") | |||||
| if mat.blend_method not in {'OPAQUE', 'CLIP', 'HASHED'}: | |||||
| layout.prop(mat, "show_transparent_backside") | |||||
| layout.prop(mat, "use_screen_refraction") | |||||
| layout.prop(mat, "refraction_depth") | |||||
| layout.prop(mat, "use_sss_translucency") | |||||
| class NODE_PT_viewport(Panel): | |||||
| bl_space_type = 'NODE_EDITOR' | |||||
| bl_region_type = 'UI' | |||||
| bl_label = "Viewport Display" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return context.active_object.active_material and context.space_data.shader_type == 'OBJECT' | |||||
| def draw(self, context): | |||||
| mat = context.active_object.active_material | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| col = layout.column() | |||||
| col.prop(mat, "diffuse_color") | |||||
| col.prop(mat, "specular_color") | |||||
| col.prop(mat, "roughness") | |||||
| # Node Backdrop options | # Node Backdrop options | ||||
| class NODE_PT_backdrop(Panel): | class NODE_PT_backdrop(Panel): | ||||
| bl_space_type = 'NODE_EDITOR' | bl_space_type = 'NODE_EDITOR' | ||||
| Context not available. | |||||
| NODE_PT_active_node_generic, | NODE_PT_active_node_generic, | ||||
| NODE_PT_active_node_color, | NODE_PT_active_node_color, | ||||
| NODE_PT_active_node_properties, | NODE_PT_active_node_properties, | ||||
| NODE_PT_options, | |||||
| NODE_PT_viewport, | |||||
| NODE_PT_backdrop, | NODE_PT_backdrop, | ||||
| NODE_PT_quality, | NODE_PT_quality, | ||||
| NODE_UL_interface_sockets, | NODE_UL_interface_sockets, | ||||
| Context not available. | |||||