Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2016-03-24 13:41:44 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-03-24 14:07:03 +0300
commitbdae647670817f4c09d4c871314f237dde1bfaac (patch)
tree59907fb1b268a3023e43b3b4568798a5e4c3f7e2 /release/scripts/startup/bl_ui/properties_texture.py
parent8e9a55f1e51daaadf92cd4f8236e3214b8db7c85 (diff)
Color sources for point density textures based on mesh vertices
This patch adds support for coloring point density textures based on several mesh vertex attributes. * Vertex Color: Use a vertex color layer for coloring the point density texture * Vertex Weight: Use a weights from a vertex group as intensity values. (for Blender Render engine the additional color band is used) * Vertex Normals: Use object-space vertex normals as RGB values. The vertex color source enum is stored separately from the particle color source, to avoid invalid values when switching. Note that vertex colors are technically "corner colors" (MLoop), so each vertex can have as many colors as faces it is part of. For the purpose of point density the mloop colors are simply averaged, which is physically plausible because corners can be viewed as multiple points in the same location.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_texture.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 1f0107f2a0e..caf19a9e469 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -830,12 +830,21 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel):
col.separator()
+ col.label(text="Color Source:")
if pd.point_source == 'PARTICLE_SYSTEM':
- col.label(text="Color Source:")
- col.prop(pd, "color_source", text="")
- if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_VELOCITY'}:
+ col.prop(pd, "particle_color_source", text="")
+ if pd.particle_color_source in {'PARTICLE_SPEED', 'PARTICLE_VELOCITY'}:
col.prop(pd, "speed_scale")
- if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_AGE'}:
+ if pd.particle_color_source in {'PARTICLE_SPEED', 'PARTICLE_AGE'}:
+ layout.template_color_ramp(pd, "color_ramp", expand=True)
+ else:
+ col.prop(pd, "vertex_color_source", text="")
+ if pd.vertex_color_source == 'VERTEX_COLOR':
+ if pd.object and pd.object.data:
+ col.prop_search(pd, "vertex_attribute_name", pd.object.data, "vertex_colors", text="")
+ if pd.vertex_color_source == 'VERTEX_WEIGHT':
+ if pd.object:
+ col.prop_search(pd, "vertex_attribute_name", pd.object, "vertex_groups", text="")
layout.template_color_ramp(pd, "color_ramp", expand=True)
col = split.column()