[Bf-blender-cvs] [53d0f76] hair_system: UI cleanup for hair: Moved settings into the physics button tab and enabled cycles curve render settings.
Lukas Tönne
noreply at git.blender.org
Thu Aug 14 11:46:19 CEST 2014
Commit: 53d0f76248b5bed5acb2e440866764e339b6cd77
Author: Lukas Tönne
Date: Thu Aug 14 11:46:35 2014 +0200
Branches: hair_system
https://developer.blender.org/rB53d0f76248b5bed5acb2e440866764e339b6cd77
UI cleanup for hair: Moved settings into the physics button tab and
enabled cycles curve render settings.
===================================================================
M intern/cycles/blender/addon/ui.py
M release/scripts/startup/bl_ui/__init__.py
M release/scripts/startup/bl_ui/properties_data_modifier.py
M release/scripts/startup/bl_ui/properties_physics_common.py
A release/scripts/startup/bl_ui/properties_physics_hair.py
M source/blender/editors/space_buttons/buttons_context.c
M source/blender/makesrna/RNA_access.h
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 4a13f26..261c54a 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1194,15 +1194,10 @@ class CyclesParticle_PT_textures(CyclesButtonsPanel, Panel):
layout.template_ID(slot, "texture", new="texture.new")
-class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
+# generic curve rendering panel base class,
+# used for both particles and hair systems
+class CyclesCurveRenderingPanel(CyclesButtonsPanel):
bl_label = "Cycles Hair Rendering"
- bl_context = "particle"
-
- @classmethod
- def poll(cls, context):
- scene = context.scene
- psys = context.particle_system
- return CyclesButtonsPanel.poll(context) and psys and psys.settings.type == 'HAIR'
def draw_header(self, context):
ccscene = context.scene.cycles_curves
@@ -1232,6 +1227,24 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
row.prop(ccscene, "maximum_width", text="Max Ext.")
+class CyclesRender_PT_ParticleCurves(CyclesCurveRenderingPanel, Panel):
+ bl_context = "particle"
+
+ @classmethod
+ def poll(cls, context):
+ scene = context.scene
+ psys = context.particle_system
+ return CyclesButtonsPanel.poll(context) and psys and psys.settings.type == 'HAIR'
+
+
+class CyclesRender_PT_HairCurves(CyclesCurveRenderingPanel, Panel):
+ bl_context = "physics"
+
+ @classmethod
+ def poll(cls, context):
+ return CyclesButtonsPanel.poll(context) and context.hair
+
+
class CyclesRender_PT_bake(CyclesButtonsPanel, Panel):
bl_label = "Bake"
bl_context = "render"
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 6b72ef1..12ce6f4 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -50,6 +50,7 @@ _modules = [
"properties_physics_dynamicpaint",
"properties_physics_field",
"properties_physics_fluid",
+ "properties_physics_hair",
"properties_physics_rigidbody",
"properties_physics_rigidbody_constraint",
"properties_physics_smoke",
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 35151be..d602d91 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -351,6 +351,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def FLUID_SIMULATION(self, layout, ob, md):
layout.label(text="Settings are inside the Physics tab")
+ def HAIR(self, layout, ob, md):
+ layout.label(text="Settings are inside the Physics tab")
+
def HOOK(self, layout, ob, md):
split = layout.split()
@@ -1222,67 +1225,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "material_offset", text="Material Offset")
- def HAIR(self, layout, ob, md):
- hsys = md.hair_system
- params = hsys.params
- display = hsys.display
- col = layout.column()
-
- col.separator()
-
- row = col.row()
- col2 = row.column()
- col2.prop(params, "substeps_forces")
- col2 = row.column()
- col2.prop(params, "substeps_damping")
-
- row = col.row()
- col2 = row.column()
- col2.prop(params, "stretch_stiffness")
- col2.prop(params, "bend_stiffness")
- col2.prop(params, "bend_smoothing")
- col2 = row.column()
- col2.prop(params, "stretch_damping")
- col2.prop(params, "bend_damping")
-
- col.separator()
-
- row = col.row()
- col2 = row.column()
- col2.prop(params, "restitution")
- col2.prop(params, "friction")
- col2.prop(params, "margin")
- col2 = row.column()
- col2.prop(params, "drag")
-
- col.separator()
-
- col.operator("hair.reset to rest location")
- col.operator("hair.copy_from_particles")
-
- col.separator()
-
- col.label("Render:")
- col2.prop(params, "render_hairs")
- col2.prop(params, "curl_smoothing")
-
- col.separator()
-
- col.label("Display:")
- row = col.row()
- row.prop(display, "mode", expand=True)
-
- col.separator()
-
- col.prop(md, "show_debug")
- col2 = col.column()
- col2.active = md.show_debug
- col2.prop(md, "show_debug_contacts")
- col2.prop(md, "show_debug_size")
- col2.prop(md, "show_debug_roots")
- col2.prop(md, "show_debug_frames")
- col2.prop(md, "show_debug_smoothing")
-
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 4df8eab..c35713a 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -75,6 +75,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False)
physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True)
physics_add(self, col, context.dynamic_paint, "Dynamic Paint", 'DYNAMIC_PAINT', 'MOD_DYNAMICPAINT', True)
+ physics_add(self, col, context.hair, "Hair", 'HAIR', 'MOD_HAIR', True)
col = split.column()
diff --git a/release/scripts/startup/bl_ui/properties_physics_hair.py b/release/scripts/startup/bl_ui/properties_physics_hair.py
new file mode 100644
index 0000000..91bbcaa
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_physics_hair.py
@@ -0,0 +1,188 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Panel
+
+from bl_ui.properties_physics_common import (point_cache_ui,
+ effector_weights_ui)
+
+
+class PhysicButtonsPanel():
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
+ bl_context = "physics"
+
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ rd = context.scene.render
+ return (ob and ob.type == 'MESH') and (not rd.use_game_engine) and (context.hair)
+
+
+class PHYSICS_PT_hair(PhysicButtonsPanel, Panel):
+ bl_label = ""
+ bl_options = {'HIDE_HEADER'}
+
+ def draw(self, context):
+ layout = self.layout
+
+ col = layout.column()
+ col.operator("hair.reset to rest location")
+ col.operator("hair.copy_from_particles")
+
+
+class PHYSICS_PT_hair_simulation(PhysicButtonsPanel, Panel):
+ bl_label = "Hair Simulation"
+
+ def draw(self, context):
+ layout = self.layout
+ md = context.hair
+ hsys = md.hair_system
+ params = hsys.params
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(params, "substeps_forces")
+
+ col = split.column()
+ col.prop(params, "substeps_damping")
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(params, "stretch_stiffness")
+ col.prop(params, "bend_stiffness")
+ col.prop(params, "bend_smoothing")
+
+ col = split.column()
+ col.prop(params, "stretch_damping")
+ col.prop(params, "bend_damping")
+
+
+class PHYSICS_PT_hair_collision(PhysicButtonsPanel, Panel):
+ bl_label = "Hair Collision"
+
+ def draw(self, context):
+ layout = self.layout
+ md = context.hair
+ hsys = md.hair_system
+ params = hsys.params
+
+ split = layout.split()
+
+ col = split.column()
+ col.prop(params, "restitution")
+ col.prop(params, "friction")
+ col.prop(params, "margin")
+
+ col = split.column()
+ col.prop(params, "drag")
+
+
+class PHYSICS_PT_hair_render(PhysicButtonsPanel, Panel):
+ bl_label = "Hair Render"
+
+ def draw(self, context):
+ layout = self.layout
+ md = context.hair
+ hsys = md.hair_system
+ params = hsys.params
+
+ col = layout.column()
+ col.prop(params, "render_hairs")
+ col.prop(params, "curl_smoothing")
+
+
+class PHYSICS_PT_hair_display(PhysicButtonsPanel, Panel):
+ bl_label = "Hair Display"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ layout = self.layout
+ md = context.hair
+ hsys = md.hair_system
+ display = hsys.display
+
+ col = layout.column()
+ row = col.row()
+ row.prop(display, "mode", expand=True)
+
+
+class PHYSICS_PT_hair_debug(PhysicButtonsPanel, Panel):
+ bl_label = "Hair Debugging"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw_header(self, context):
+ self.layout.prop(context.hair, "show_debug", text="")
+
+ def draw(self, context):
+ layout = self.layout
+ md = context.hair
+
+ col = layout.column()
+ col.active = md.show_debug
+ col.prop(md, "show_debug_contacts")
+ col.prop(md, "show_debug_size")
+ col.prop(md, "show_debug_roots")
+ col.prop(md, "show_debug_frames")
+ col.prop(md, "show_debug_smoo
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list