Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/nodeitems_builtins.py
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | class CompositorNodeCategory(SortedNodeCategory): | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.space_data.tree_type == 'CompositorNodeTree') | return (context.space_data.tree_type == 'CompositorNodeTree') | ||||
| class ShaderNewNodeCategory(SortedNodeCategory): | class ShaderNewNodeCategory(SortedNodeCategory): | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.space_data.tree_type == 'ShaderNodeTree' and | return (context.space_data.tree_type == 'ShaderNodeTree' and | ||||
| context.scene.render.use_shading_nodes) | context.view_render.use_shading_nodes) | ||||
| class ShaderOldNodeCategory(SortedNodeCategory): | class ShaderOldNodeCategory(SortedNodeCategory): | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.space_data.tree_type == 'ShaderNodeTree' and | return (context.space_data.tree_type == 'ShaderNodeTree' and | ||||
| not context.scene.render.use_shading_nodes) | not context.view_render.use_shading_nodes) | ||||
| class TextureNodeCategory(SortedNodeCategory): | class TextureNodeCategory(SortedNodeCategory): | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.space_data.tree_type == 'TextureNodeTree' | return context.space_data.tree_type == 'TextureNodeTree' | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| # only show nodes working in object node trees | # only show nodes working in object node trees | ||||
| def object_shader_nodes_poll(context): | def object_shader_nodes_poll(context): | ||||
| snode = context.space_data | snode = context.space_data | ||||
| return (snode.tree_type == 'ShaderNodeTree' and | return (snode.tree_type == 'ShaderNodeTree' and | ||||
| snode.shader_type == 'OBJECT') | snode.shader_type == 'OBJECT') | ||||
| def cycles_shader_nodes_poll(context): | def cycles_shader_nodes_poll(context): | ||||
| return context.scene.render.engine == 'CYCLES' | return context.view_render.engine == 'CYCLES' | ||||
| def eevee_shader_nodes_poll(context): | def eevee_shader_nodes_poll(context): | ||||
| return context.scene.render.engine == 'BLENDER_EEVEE' | return context.view_render.engine == 'BLENDER_EEVEE' | ||||
| def eevee_cycles_shader_nodes_poll(context): | def eevee_cycles_shader_nodes_poll(context): | ||||
| return (cycles_shader_nodes_poll(context) or | return (cycles_shader_nodes_poll(context) or | ||||
| eevee_shader_nodes_poll(context)) | eevee_shader_nodes_poll(context)) | ||||
| def object_cycles_shader_nodes_poll(context): | def object_cycles_shader_nodes_poll(context): | ||||
| ▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines | |||||