diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-12-08 23:10:59 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-12-08 23:10:59 +0300 |
commit | 5d2966283b82b8c5d4b1c47fcdd8511416dfbab8 (patch) | |
tree | 342be7f35b159c160494295523820d20190e57d7 /release | |
parent | 8f8aa3f8639d4fe30b99cb5567f5f8c83050d6d6 (diff) |
UI Cleanup: Halo materials and textures
* Textures applied to halo materials showed influence option for normal particles. This was really confusing, and with the cleanup I revealed a couple of hidden features too!
** Particles actually allow for textures to change halo size and hardness, but my guess is that nobody knew since the names were wrong in the ui!
** I also added the option to change the "add" value with a texture, since it was just silly not to have it.
* Halo material properties are also a bit cleaner now.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/ui/properties_material.py | 42 | ||||
-rw-r--r-- | release/scripts/ui/properties_texture.py | 15 |
2 files changed, 35 insertions, 22 deletions
diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index 5c15bece6d6..6877d5da43a 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -269,7 +269,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel): def poll(cls, context): mat = active_node_mat(context.material) engine = context.scene.render.engine - return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in cls.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -294,9 +294,6 @@ class MATERIAL_PT_shading(MaterialButtonsPanel, bpy.types.Panel): sub.prop(mat, "use_tangent_shading") sub.prop(mat, "use_cubic") - elif mat.type == 'HALO': - layout.prop(mat, "alpha") - class MATERIAL_PT_transp(MaterialButtonsPanel, bpy.types.Panel): bl_label = "Transparency" @@ -486,14 +483,30 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel): mat = context.material # dont use node material halo = mat.halo + def number_but(layout, toggle, number, name, color): + row = layout.row(align=True) + row.prop(halo, toggle, text="") + sub = row.column() + sub.active = getattr(halo, toggle) + sub.prop(halo, number, text=name) + if not color == "": + sub.prop(mat, color, text="") + split = layout.split() col = split.column() + col.prop(mat, "alpha") col.prop(mat, "diffuse_color", text="") + + col = split.column() col.prop(halo, "size") col.prop(halo, "hardness") col.prop(halo, "add") - col.label(text="Options:") + + layout.label(text="Options:") + + split = layout.split() + col = split.column() col.prop(halo, "use_texture") col.prop(halo, "use_vertex_normal") col.prop(halo, "use_extreme_alpha") @@ -501,22 +514,9 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, bpy.types.Panel): col.prop(halo, "use_soft") col = split.column() - col.prop(halo, "use_ring") - sub = col.column() - sub.active = halo.use_ring - sub.prop(halo, "ring_count") - sub.prop(mat, "mirror_color", text="") - col.separator() - col.prop(halo, "use_lines") - sub = col.column() - sub.active = halo.use_lines - sub.prop(halo, "line_count", text="Lines") - sub.prop(mat, "specular_color", text="") - col.separator() - col.prop(halo, "use_star") - sub = col.column() - sub.active = halo.use_star - sub.prop(halo, "star_tip_count") + number_but(col, "use_ring", "ring_count", "Rings", "mirror_color") + number_but(col, "use_lines", "line_count", "Lines", "specular_color") + number_but(col, "use_star", "star_tip_count", "Star tips", "") class MATERIAL_PT_flare(MaterialButtonsPanel, bpy.types.Panel): diff --git a/release/scripts/ui/properties_texture.py b/release/scripts/ui/properties_texture.py index f5b7d5fa32c..c51a9034bf7 100644 --- a/release/scripts/ui/properties_texture.py +++ b/release/scripts/ui/properties_texture.py @@ -894,7 +894,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): return sub # XXX, temp. use_map_normal needs to override. if isinstance(idblock, bpy.types.Material): - if idblock.type in ('SURFACE', 'HALO', 'WIRE'): + if idblock.type in ('SURFACE', 'WIRE'): split = layout.split() col = split.column() @@ -928,6 +928,19 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel): #sub = col.column() #sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror #sub.prop(tex, "default_value", text="Amount", slider=True) + elif idblock.type == 'HALO': + layout.label(text="Halo:") + + split = layout.split() + + col = split.column() + factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color") + factor_but(col, "use_map_alpha", "alpha_factor", "Alpha") + + col = split.column() + factor_but(col, "use_map_raymir", "raymir_factor", "Size") + factor_but(col, "use_map_hardness", "hardness_factor", "Hardness") + factor_but(col, "use_map_translucency", "translucency_factor", "Add") elif idblock.type == 'VOLUME': split = layout.split() |