Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-embree3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-embree3
Commits
2a869472
Commit
2a869472
authored
12 years ago
by
Lukas Toenne
Browse files
Options
Downloads
Patches
Plain Diff
svn merge ^/trunk/blender -c57073
parent
1e61184f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
release/scripts/modules/nodeitems_utils.py
+7
-2
7 additions, 2 deletions
release/scripts/modules/nodeitems_utils.py
release/scripts/startup/nodeitems_builtins.py
+16
-0
16 additions, 0 deletions
release/scripts/startup/nodeitems_builtins.py
with
23 additions
and
2 deletions
release/scripts/modules/nodeitems_utils.py
+
7
−
2
View file @
2a869472
...
@@ -36,13 +36,18 @@ class NodeCategory():
...
@@ -36,13 +36,18 @@ class NodeCategory():
elif
callable
(
items
):
elif
callable
(
items
):
self
.
items
=
items
self
.
items
=
items
else
:
else
:
self
.
items
=
lambda
context
:
items
def
items_gen
(
context
):
for
item
in
items
:
if
item
.
poll
is
None
or
item
.
poll
(
context
):
yield
item
self
.
items
=
items_gen
class
NodeItem
():
class
NodeItem
():
def
__init__
(
self
,
nodetype
,
label
=
None
,
settings
=
{}):
def
__init__
(
self
,
nodetype
,
label
=
None
,
settings
=
{}
,
poll
=
None
):
self
.
nodetype
=
nodetype
self
.
nodetype
=
nodetype
self
.
_label
=
label
self
.
_label
=
label
self
.
settings
=
settings
self
.
settings
=
settings
self
.
poll
=
poll
@property
@property
def
label
(
self
):
def
label
(
self
):
...
...
This diff is collapsed.
Click to expand it.
release/scripts/startup/nodeitems_builtins.py
+
16
−
0
View file @
2a869472
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
# ##### END GPL LICENSE BLOCK #####
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# <pep8 compliant>
import
bpy
import
nodeitems_utils
import
nodeitems_utils
from
nodeitems_utils
import
NodeCategory
,
NodeItem
from
nodeitems_utils
import
NodeCategory
,
NodeItem
...
@@ -80,6 +81,13 @@ def node_group_items(context):
...
@@ -80,6 +81,13 @@ def node_group_items(context):
yield
NodeItem
(
node_tree_group_type
[
group
.
bl_idname
],
group
.
name
,
{
"
node_tree
"
:
"
bpy.data.node_groups[%r]
"
%
group
.
name
})
yield
NodeItem
(
node_tree_group_type
[
group
.
bl_idname
],
group
.
name
,
{
"
node_tree
"
:
"
bpy.data.node_groups[%r]
"
%
group
.
name
})
# only show input/output nodes inside node groups
def
group_input_output_item_poll
(
context
):
space
=
context
.
space_data
if
space
.
edit_tree
in
bpy
.
data
.
node_groups
.
values
():
return
True
return
False
# All standard node categories currently used in nodes.
# All standard node categories currently used in nodes.
...
@@ -93,9 +101,11 @@ shader_node_categories = [
...
@@ -93,9 +101,11 @@ shader_node_categories = [
NodeItem
(
"
ShaderNodeTexture
"
),
NodeItem
(
"
ShaderNodeTexture
"
),
NodeItem
(
"
ShaderNodeGeometry
"
),
NodeItem
(
"
ShaderNodeGeometry
"
),
NodeItem
(
"
ShaderNodeExtendedMaterial
"
),
NodeItem
(
"
ShaderNodeExtendedMaterial
"
),
NodeItem
(
"
NodeGroupInput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
ShaderOldNodeCategory
(
"
SH_OUTPUT
"
,
"
Output
"
,
items
=
[
ShaderOldNodeCategory
(
"
SH_OUTPUT
"
,
"
Output
"
,
items
=
[
NodeItem
(
"
ShaderNodeOutput
"
),
NodeItem
(
"
ShaderNodeOutput
"
),
NodeItem
(
"
NodeGroupOutput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
ShaderOldNodeCategory
(
"
SH_OP_COLOR
"
,
"
Color
"
,
items
=
[
ShaderOldNodeCategory
(
"
SH_OP_COLOR
"
,
"
Color
"
,
items
=
[
NodeItem
(
"
ShaderNodeMixRGB
"
),
NodeItem
(
"
ShaderNodeMixRGB
"
),
...
@@ -139,11 +149,13 @@ shader_node_categories = [
...
@@ -139,11 +149,13 @@ shader_node_categories = [
NodeItem
(
"
ShaderNodeHairInfo
"
),
NodeItem
(
"
ShaderNodeHairInfo
"
),
NodeItem
(
"
ShaderNodeParticleInfo
"
),
NodeItem
(
"
ShaderNodeParticleInfo
"
),
NodeItem
(
"
ShaderNodeCameraData
"
),
NodeItem
(
"
ShaderNodeCameraData
"
),
NodeItem
(
"
NodeGroupInput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
ShaderNewNodeCategory
(
"
SH_NEW_OUTPUT
"
,
"
Output
"
,
items
=
[
ShaderNewNodeCategory
(
"
SH_NEW_OUTPUT
"
,
"
Output
"
,
items
=
[
NodeItem
(
"
ShaderNodeOutputMaterial
"
),
NodeItem
(
"
ShaderNodeOutputMaterial
"
),
NodeItem
(
"
ShaderNodeOutputLamp
"
),
NodeItem
(
"
ShaderNodeOutputLamp
"
),
NodeItem
(
"
ShaderNodeOutputWorld
"
),
NodeItem
(
"
ShaderNodeOutputWorld
"
),
NodeItem
(
"
NodeGroupOutput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
ShaderNewNodeCategory
(
"
SH_NEW_SHADER
"
,
"
Shader
"
,
items
=
[
ShaderNewNodeCategory
(
"
SH_NEW_SHADER
"
,
"
Shader
"
,
items
=
[
NodeItem
(
"
ShaderNodeMixShader
"
),
NodeItem
(
"
ShaderNodeMixShader
"
),
...
@@ -221,6 +233,7 @@ compositor_node_categories = [
...
@@ -221,6 +233,7 @@ compositor_node_categories = [
NodeItem
(
"
CompositorNodeBokehImage
"
),
NodeItem
(
"
CompositorNodeBokehImage
"
),
NodeItem
(
"
CompositorNodeTime
"
),
NodeItem
(
"
CompositorNodeTime
"
),
NodeItem
(
"
CompositorNodeTrackPos
"
),
NodeItem
(
"
CompositorNodeTrackPos
"
),
NodeItem
(
"
NodeGroupInput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
CompositorNodeCategory
(
"
CMP_OUTPUT
"
,
"
Output
"
,
items
=
[
CompositorNodeCategory
(
"
CMP_OUTPUT
"
,
"
Output
"
,
items
=
[
NodeItem
(
"
CompositorNodeComposite
"
),
NodeItem
(
"
CompositorNodeComposite
"
),
...
@@ -228,6 +241,7 @@ compositor_node_categories = [
...
@@ -228,6 +241,7 @@ compositor_node_categories = [
NodeItem
(
"
CompositorNodeSplitViewer
"
),
NodeItem
(
"
CompositorNodeSplitViewer
"
),
NodeItem
(
"
CompositorNodeOutputFile
"
),
NodeItem
(
"
CompositorNodeOutputFile
"
),
NodeItem
(
"
CompositorNodeLevels
"
),
NodeItem
(
"
CompositorNodeLevels
"
),
NodeItem
(
"
NodeGroupOutput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
CompositorNodeCategory
(
"
CMP_OP_COLOR
"
,
"
Color
"
,
items
=
[
CompositorNodeCategory
(
"
CMP_OP_COLOR
"
,
"
Color
"
,
items
=
[
NodeItem
(
"
CompositorNodeMixRGB
"
),
NodeItem
(
"
CompositorNodeMixRGB
"
),
...
@@ -321,10 +335,12 @@ texture_node_categories = [
...
@@ -321,10 +335,12 @@ texture_node_categories = [
NodeItem
(
"
TextureNodeCoordinates
"
),
NodeItem
(
"
TextureNodeCoordinates
"
),
NodeItem
(
"
TextureNodeTexture
"
),
NodeItem
(
"
TextureNodeTexture
"
),
NodeItem
(
"
TextureNodeImage
"
),
NodeItem
(
"
TextureNodeImage
"
),
NodeItem
(
"
NodeGroupInput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
TextureNodeCategory
(
"
TEX_OUTPUT
"
,
"
Output
"
,
items
=
[
TextureNodeCategory
(
"
TEX_OUTPUT
"
,
"
Output
"
,
items
=
[
NodeItem
(
"
TextureNodeOutput
"
),
NodeItem
(
"
TextureNodeOutput
"
),
NodeItem
(
"
TextureNodeViewer
"
),
NodeItem
(
"
TextureNodeViewer
"
),
NodeItem
(
"
NodeGroupOutput
"
,
poll
=
group_input_output_item_poll
),
]),
]),
TextureNodeCategory
(
"
TEX_OP_COLOR
"
,
"
Color
"
,
items
=
[
TextureNodeCategory
(
"
TEX_OP_COLOR
"
,
"
Color
"
,
items
=
[
NodeItem
(
"
TextureNodeMixRGB
"
),
NodeItem
(
"
TextureNodeMixRGB
"
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment