2009-11-01 15:21:20 +00:00
|
|
|
# ##### 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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# 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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-01 11:39:11 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-10-31 19:57:59 +00:00
|
|
|
from properties_physics_common import point_cache_ui
|
|
|
|
from properties_physics_common import effector_weights_ui
|
|
|
|
from properties_physics_common import basic_force_field_settings_ui
|
|
|
|
from properties_physics_common import basic_force_field_falloff_ui
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-15 18:27:41 +00:00
|
|
|
def particle_panel_enabled(context, psys):
|
2009-10-31 23:35:56 +00:00
|
|
|
return psys.point_cache.baked == False and psys.edited == False and (not context.particle_system_editable)
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
def particle_panel_poll(context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys == None:
|
|
|
|
return False
|
|
|
|
if psys.settings == None:
|
|
|
|
return False
|
2009-10-31 19:31:45 +00:00
|
|
|
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
|
2009-06-05 23:59:33 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-01 11:39:11 +00:00
|
|
|
class ParticleButtonsPanel(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "particle"
|
2009-06-01 11:39:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def poll(self, context):
|
|
|
|
return particle_panel_poll(context)
|
2009-06-01 11:39:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-01 11:39:11 +00:00
|
|
|
class PARTICLE_PT_particles(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
return (context.particle_system or context.object)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
psys = context.particle_system
|
|
|
|
|
|
|
|
if ob:
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="")
|
|
|
|
col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="")
|
|
|
|
|
|
|
|
if psys and not psys.settings:
|
|
|
|
split = layout.split(percentage=0.32)
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Name:")
|
|
|
|
col.itemL(text="Settings:")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(psys, "name", text="")
|
|
|
|
col.template_ID(psys, "settings", new="particle.new")
|
|
|
|
elif psys:
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.32)
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Name:")
|
|
|
|
if part.type in ('EMITTER', 'REACTOR', 'HAIR'):
|
|
|
|
col.itemL(text="Settings:")
|
|
|
|
col.itemL(text="Type:")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(psys, "name", text="")
|
|
|
|
if part.type in ('EMITTER', 'REACTOR', 'HAIR'):
|
|
|
|
col.template_ID(psys, "settings", new="particle.new")
|
|
|
|
|
|
|
|
#row = layout.row()
|
|
|
|
#row.itemL(text="Viewport")
|
|
|
|
#row.itemL(text="Render")
|
|
|
|
|
|
|
|
if part:
|
|
|
|
if part.type not in ('EMITTER', 'REACTOR', 'HAIR'):
|
|
|
|
layout.itemL(text="No settings for fluid particles")
|
|
|
|
return
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
row = col.row()
|
2009-10-31 19:31:45 +00:00
|
|
|
row.enabled = particle_panel_enabled(context, psys)
|
|
|
|
row.itemR(part, "type", text="")
|
|
|
|
row.itemR(psys, "seed")
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.65)
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.type == 'HAIR':
|
|
|
|
if psys.edited == True:
|
2009-10-31 19:31:45 +00:00
|
|
|
split.itemO("particle.edited_clear", text="Free Edit")
|
|
|
|
else:
|
|
|
|
split.itemL(text="")
|
|
|
|
row = split.row()
|
|
|
|
row.enabled = particle_panel_enabled(context, psys)
|
|
|
|
row.itemR(part, "hair_step")
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys.edited == True:
|
2009-10-31 19:31:45 +00:00
|
|
|
if psys.global_hair:
|
|
|
|
layout.itemO("particle.connect_hair")
|
|
|
|
layout.itemL(text="Hair is disconnected.")
|
|
|
|
else:
|
|
|
|
layout.itemO("particle.disconnect_hair")
|
|
|
|
layout.itemL(text="")
|
2009-10-31 23:35:56 +00:00
|
|
|
elif part.type == 'REACTOR':
|
2009-10-31 19:31:45 +00:00
|
|
|
split.enabled = particle_panel_enabled(context, psys)
|
|
|
|
split.itemR(psys, "reactor_target_object")
|
|
|
|
split.itemR(psys, "reactor_target_particle_system", text="Particle System")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_emission(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Emission"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
if particle_panel_poll(context):
|
|
|
|
return not context.particle_system.point_cache.external
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys) and not psys.multiple_caches
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.active = part.distribution != 'GRID'
|
|
|
|
row.itemR(part, "amount")
|
|
|
|
|
|
|
|
if part.type != 'HAIR':
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemR(part, "start")
|
|
|
|
col.itemR(part, "end")
|
|
|
|
|
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemR(part, "lifetime")
|
|
|
|
col.itemR(part, "random_lifetime", slider=True)
|
|
|
|
|
|
|
|
layout.row().itemL(text="Emit From:")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "emit_from", expand=True)
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "trand")
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.distribution != 'GRID':
|
2009-10-31 19:31:45 +00:00
|
|
|
row.itemR(part, "even_distribution")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "distribution", expand=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.distribution == 'JIT':
|
2009-10-31 19:31:45 +00:00
|
|
|
row.itemR(part, "userjit", text="Particles/Face")
|
|
|
|
row.itemR(part, "jitter_factor", text="Jittering Amount", slider=True)
|
2009-10-31 23:35:56 +00:00
|
|
|
elif part.distribution == 'GRID':
|
2009-10-31 19:31:45 +00:00
|
|
|
row.itemR(part, "grid_resolution")
|
2009-06-06 16:18:19 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-09-10 22:32:33 +00:00
|
|
|
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Hair dynamics"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
psys = context.particle_system
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys == None:
|
|
|
|
return False
|
|
|
|
if psys.settings == None:
|
|
|
|
return False
|
2009-10-31 19:31:45 +00:00
|
|
|
return psys.settings.type == 'HAIR'
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
#cloth = context.cloth.collision_settings
|
|
|
|
|
|
|
|
#self.layout.active = cloth_panel_enabled(context.cloth)
|
|
|
|
#self.layout.itemR(cloth, "enable_collision", text="")
|
|
|
|
psys = context.particle_system
|
|
|
|
self.layout.itemR(psys, "hair_dynamics", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
2009-11-14 13:35:44 +00:00
|
|
|
#part = psys.settings
|
2009-10-31 19:31:45 +00:00
|
|
|
cloth = psys.cloth.settings
|
|
|
|
|
|
|
|
layout.enabled = psys.hair_dynamics
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.itemL(text="Material:")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
|
|
|
|
sub.itemR(cloth, "mass")
|
|
|
|
sub.itemR(cloth, "bending_stiffness", text="Bending")
|
|
|
|
sub.itemR(cloth, "internal_friction", slider="True")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
|
|
|
col.itemL(text="Damping:")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.itemR(cloth, "spring_damping", text="Spring")
|
|
|
|
sub.itemR(cloth, "air_damping", text="Air")
|
|
|
|
|
|
|
|
col.itemL(text="Quality:")
|
2009-10-31 23:35:56 +00:00
|
|
|
col.itemR(cloth, "quality", text="Steps", slider=True)
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_cache(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Cache"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
psys = context.particle_system
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys == None:
|
|
|
|
return False
|
|
|
|
if psys.settings == None:
|
|
|
|
return False
|
2009-10-31 19:31:45 +00:00
|
|
|
phystype = psys.settings.physics_type
|
|
|
|
if phystype == 'NO' or phystype == 'KEYED':
|
|
|
|
return False
|
|
|
|
return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
|
|
|
|
point_cache_ui(self, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
|
2009-06-06 16:18:19 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-05 13:25:56 +00:00
|
|
|
class PARTICLE_PT_velocity(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Velocity"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
if particle_panel_poll(context):
|
|
|
|
psys = context.particle_system
|
|
|
|
return psys.settings.physics_type != 'BOIDS' and not psys.point_cache.external
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
sub = split.column()
|
|
|
|
sub.itemL(text="Emitter Geometry:")
|
|
|
|
sub.itemR(part, "normal_factor")
|
|
|
|
subsub = sub.column(align=True)
|
|
|
|
subsub.itemR(part, "tangent_factor")
|
|
|
|
subsub.itemR(part, "tangent_phase", slider=True)
|
|
|
|
|
|
|
|
sub = split.column()
|
|
|
|
sub.itemL(text="Emitter Object")
|
|
|
|
sub.itemR(part, "object_aligned_factor", text="")
|
|
|
|
|
|
|
|
layout.row().itemL(text="Other:")
|
|
|
|
split = layout.split()
|
|
|
|
sub = split.column()
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.emit_from == 'PARTICLE':
|
2009-10-31 19:31:45 +00:00
|
|
|
sub.itemR(part, "particle_factor")
|
|
|
|
else:
|
|
|
|
sub.itemR(part, "object_factor", slider=True)
|
|
|
|
sub = split.column()
|
|
|
|
sub.itemR(part, "random_factor")
|
|
|
|
|
|
|
|
#if part.type=='REACTOR':
|
|
|
|
# sub.itemR(part, "reactor_factor")
|
|
|
|
# sub.itemR(part, "reaction_shape", slider=True)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-05 13:25:56 +00:00
|
|
|
class PARTICLE_PT_rotation(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Rotation"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
if particle_panel_poll(context):
|
|
|
|
psys = context.particle_system
|
|
|
|
return psys.settings.physics_type != 'BOIDS' and not psys.point_cache.external
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
split.itemL(text="Initial Rotation:")
|
|
|
|
split.itemR(part, "rotation_dynamic")
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
sub = split.column(align=True)
|
|
|
|
sub.itemR(part, "rotation_mode", text="")
|
|
|
|
sub.itemR(part, "random_rotation_factor", slider=True, text="Random")
|
|
|
|
|
|
|
|
sub = split.column(align=True)
|
|
|
|
sub.itemR(part, "phase_factor", slider=True)
|
|
|
|
sub.itemR(part, "random_phase_factor", text="Random", slider=True)
|
|
|
|
|
|
|
|
layout.row().itemL(text="Angular Velocity:")
|
|
|
|
layout.row().itemR(part, "angular_velocity_mode", expand=True)
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
sub = split.column()
|
|
|
|
|
|
|
|
sub.itemR(part, "angular_velocity_factor", text="")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_physics(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Physics"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
if particle_panel_poll(context):
|
|
|
|
return not context.particle_system.point_cache.external
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "physics_type", expand=True)
|
|
|
|
if part.physics_type != 'NO':
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "particle_size")
|
|
|
|
col.itemR(part, "random_size", slider=True)
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "mass")
|
|
|
|
col.itemR(part, "sizemass", text="Multiply mass with size")
|
|
|
|
|
|
|
|
if part.physics_type == 'NEWTON':
|
|
|
|
split = layout.split()
|
|
|
|
sub = split.column()
|
|
|
|
|
|
|
|
sub.itemL(text="Forces:")
|
|
|
|
sub.itemR(part, "brownian_factor")
|
|
|
|
sub.itemR(part, "drag_factor", slider=True)
|
|
|
|
sub.itemR(part, "damp_factor", slider=True)
|
|
|
|
sub = split.column()
|
|
|
|
sub.itemR(part, "size_deflect")
|
|
|
|
sub.itemR(part, "die_on_collision")
|
|
|
|
sub.itemR(part, "integrator")
|
|
|
|
sub.itemR(part, "time_tweak")
|
|
|
|
|
|
|
|
elif part.physics_type == 'KEYED':
|
|
|
|
split = layout.split()
|
|
|
|
sub = split.column()
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
col.active = not psys.keyed_timing
|
|
|
|
col.itemR(part, "keyed_loops", text="Loops")
|
|
|
|
row.itemR(psys, "keyed_timing", text="Use Timing")
|
|
|
|
|
|
|
|
layout.itemL(text="Keys:")
|
2009-10-31 23:35:56 +00:00
|
|
|
elif part.physics_type == 'BOIDS':
|
2009-10-31 19:31:45 +00:00
|
|
|
boids = part.boids
|
|
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(boids, "allow_flight")
|
|
|
|
row.itemR(boids, "allow_land")
|
|
|
|
row.itemR(boids, "allow_climb")
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
sub = split.column()
|
|
|
|
col = sub.column(align=True)
|
|
|
|
col.active = boids.allow_flight
|
|
|
|
col.itemR(boids, "air_max_speed")
|
|
|
|
col.itemR(boids, "air_min_speed", slider="True")
|
|
|
|
col.itemR(boids, "air_max_acc", slider="True")
|
|
|
|
col.itemR(boids, "air_max_ave", slider="True")
|
|
|
|
col.itemR(boids, "air_personal_space")
|
|
|
|
row = col.row()
|
|
|
|
row.active = (boids.allow_land or boids.allow_climb) and boids.allow_flight
|
|
|
|
row.itemR(boids, "landing_smoothness")
|
|
|
|
|
|
|
|
sub = split.column()
|
|
|
|
col = sub.column(align=True)
|
|
|
|
col.active = boids.allow_land or boids.allow_climb
|
|
|
|
col.itemR(boids, "land_max_speed")
|
|
|
|
col.itemR(boids, "land_jump_speed")
|
|
|
|
col.itemR(boids, "land_max_acc", slider="True")
|
|
|
|
col.itemR(boids, "land_max_ave", slider="True")
|
|
|
|
col.itemR(boids, "land_personal_space")
|
|
|
|
col.itemR(boids, "land_stick_force")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemL(text="Battle:")
|
|
|
|
col.itemR(boids, "health")
|
|
|
|
col.itemR(boids, "strength")
|
|
|
|
col.itemR(boids, "aggression")
|
|
|
|
col.itemR(boids, "accuracy")
|
|
|
|
col.itemR(boids, "range")
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
col.itemL(text="Misc:")
|
|
|
|
col.itemR(boids, "banking", slider=True)
|
|
|
|
col.itemR(boids, "height", slider=True)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.physics_type == 'KEYED' or part.physics_type == 'BOIDS':
|
|
|
|
if part.physics_type == 'BOIDS':
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemL(text="Relations:")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(psys, "targets", psys, "active_particle_target_index")
|
|
|
|
|
|
|
|
col = row.column()
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
|
|
|
subsub.itemO("particle.new_target", icon='ICON_ZOOMIN', text="")
|
|
|
|
subsub.itemO("particle.remove_target", icon='ICON_ZOOMOUT', text="")
|
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
|
|
|
subsub.itemO("particle.target_move_up", icon='VICON_MOVE_UP', text="")
|
|
|
|
subsub.itemO("particle.target_move_down", icon='VICON_MOVE_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
key = psys.active_particle_target
|
|
|
|
if key:
|
|
|
|
row = layout.row()
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.physics_type == 'KEYED':
|
2009-10-31 19:31:45 +00:00
|
|
|
col = row.column()
|
|
|
|
#doesn't work yet
|
|
|
|
#col.red_alert = key.valid
|
|
|
|
col.itemR(key, "object", text="")
|
|
|
|
col.itemR(key, "system", text="System")
|
2009-10-31 23:35:56 +00:00
|
|
|
col = row.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
col.active = psys.keyed_timing
|
|
|
|
col.itemR(key, "time")
|
|
|
|
col.itemR(key, "duration")
|
|
|
|
else:
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = row.row()
|
2009-10-31 19:31:45 +00:00
|
|
|
#doesn't work yet
|
2009-11-12 14:37:13 +00:00
|
|
|
#sub.red_alert = key.valid
|
2009-11-01 10:45:42 +00:00
|
|
|
sub.itemR(key, "object", text="")
|
|
|
|
sub.itemR(key, "system", text="System")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.itemR(key, "mode", expand=True)
|
2009-07-20 23:52:53 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-20 23:52:53 +00:00
|
|
|
class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Boid Brain"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
psys = context.particle_system
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys == None:
|
|
|
|
return False
|
|
|
|
if psys.settings == None:
|
|
|
|
return False
|
|
|
|
if psys.point_cache.external:
|
|
|
|
return False
|
|
|
|
return psys.settings.physics_type == 'BOIDS'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
boids = context.particle_system.settings.boids
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, context.particle_system)
|
|
|
|
|
|
|
|
# Currently boids can only use the first state so these are commented out for now.
|
|
|
|
#row = layout.row()
|
|
|
|
#row.template_list(boids, "states", boids, "active_boid_state_index", compact="True")
|
|
|
|
#col = row.row()
|
2009-11-12 14:37:13 +00:00
|
|
|
#sub = col.row(align=True)
|
|
|
|
#sub.itemO("boid.state_add", icon='ICON_ZOOMIN', text="")
|
|
|
|
#sub.itemO("boid.state_del", icon='ICON_ZOOMOUT', text="")
|
|
|
|
#sub = row.row(align=True)
|
|
|
|
#sub.itemO("boid.state_move_up", icon='VICON_MOVE_UP', text="")
|
|
|
|
#sub.itemO("boid.state_move_down", icon='VICON_MOVE_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
state = boids.active_boid_state
|
|
|
|
|
|
|
|
#layout.itemR(state, "name", text="State name")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(state, "ruleset_type")
|
2009-10-31 23:35:56 +00:00
|
|
|
if state.ruleset_type == 'FUZZY':
|
2009-10-31 19:31:45 +00:00
|
|
|
row.itemR(state, "rule_fuzziness", slider=True)
|
|
|
|
else:
|
|
|
|
row.itemL(text="")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(state, "rules", state, "active_boid_rule_index")
|
|
|
|
|
|
|
|
col = row.column()
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
|
|
|
subsub.item_menu_enumO("boid.rule_add", "type", icon='ICON_ZOOMIN', text="")
|
|
|
|
subsub.itemO("boid.rule_del", icon='ICON_ZOOMOUT', text="")
|
|
|
|
sub = col.row()
|
2009-11-12 14:37:13 +00:00
|
|
|
subsub = sub.column(align=True)
|
2009-11-01 10:45:42 +00:00
|
|
|
subsub.itemO("boid.rule_move_up", icon='VICON_MOVE_UP', text="")
|
|
|
|
subsub.itemO("boid.rule_move_down", icon='VICON_MOVE_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
rule = state.active_boid_rule
|
|
|
|
|
|
|
|
if rule:
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(rule, "name", text="")
|
|
|
|
#somebody make nice icons for boids here please! -jahka
|
|
|
|
row.itemR(rule, "in_air", icon='VICON_MOVE_UP', text="")
|
|
|
|
row.itemR(rule, "on_land", icon='VICON_MOVE_DOWN', text="")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
if rule.type == 'GOAL':
|
|
|
|
row.itemR(rule, "object")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(rule, "predict")
|
|
|
|
elif rule.type == 'AVOID':
|
|
|
|
row.itemR(rule, "object")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(rule, "predict")
|
|
|
|
row.itemR(rule, "fear_factor")
|
|
|
|
elif rule.type == 'FOLLOW_PATH':
|
|
|
|
row.itemL(text="Not yet functional.")
|
|
|
|
elif rule.type == 'AVOID_COLLISION':
|
|
|
|
row.itemR(rule, "boids")
|
|
|
|
row.itemR(rule, "deflectors")
|
|
|
|
row.itemR(rule, "look_ahead")
|
|
|
|
elif rule.type == 'FOLLOW_LEADER':
|
|
|
|
row.itemR(rule, "object", text="")
|
|
|
|
row.itemR(rule, "distance")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(rule, "line")
|
2009-11-12 14:37:13 +00:00
|
|
|
sub = row.row()
|
|
|
|
sub.active = rule.line
|
|
|
|
sub.itemR(rule, "queue_size")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'AVERAGE_SPEED':
|
|
|
|
row.itemR(rule, "speed", slider=True)
|
|
|
|
row.itemR(rule, "wander", slider=True)
|
|
|
|
row.itemR(rule, "level", slider=True)
|
|
|
|
elif rule.type == 'FIGHT':
|
|
|
|
row.itemR(rule, "distance")
|
|
|
|
row.itemR(rule, "flee_distance")
|
2009-06-05 23:59:33 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_render(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Render"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
psys = context.particle_system
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys == None:
|
|
|
|
return False
|
|
|
|
if psys.settings == None:
|
|
|
|
return False
|
|
|
|
return True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "material")
|
2009-10-31 23:35:56 +00:00
|
|
|
row.itemR(psys, "parent")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
sub = split.column()
|
2009-10-31 23:35:56 +00:00
|
|
|
sub.itemR(part, "emitter")
|
|
|
|
sub.itemR(part, "parent")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = split.column()
|
2009-10-31 23:35:56 +00:00
|
|
|
sub.itemR(part, "unborn")
|
|
|
|
sub.itemR(part, "died")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "ren_as", expand=True)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
sub = split.column()
|
|
|
|
|
|
|
|
if part.ren_as == 'LINE':
|
|
|
|
sub.itemR(part, "line_length_tail")
|
|
|
|
sub.itemR(part, "line_length_head")
|
|
|
|
sub = split.column()
|
|
|
|
sub.itemR(part, "velocity_length")
|
|
|
|
elif part.ren_as == 'PATH':
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked == False:
|
2009-10-31 19:31:45 +00:00
|
|
|
box = layout.box()
|
|
|
|
box.itemL(text="Baked or keyed particles needed for correct rendering.")
|
|
|
|
return
|
|
|
|
|
|
|
|
sub.itemR(part, "render_strand")
|
2009-11-01 10:45:42 +00:00
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = part.render_strand == False
|
|
|
|
subsub.itemR(part, "render_adaptive")
|
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = part.render_adaptive or part.render_strand == True
|
|
|
|
subsub.itemR(part, "adaptive_angle")
|
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = part.render_adaptive == True and part.render_strand == False
|
|
|
|
subsub.itemR(part, "adaptive_pix")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub.itemR(part, "hair_bspline")
|
|
|
|
sub.itemR(part, "render_step", text="Steps")
|
2009-11-01 18:07:35 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
sub = split.column()
|
|
|
|
sub.itemL(text="Timing:")
|
|
|
|
sub.itemR(part, "abs_path_time")
|
2009-10-31 23:35:56 +00:00
|
|
|
sub.itemR(part, "path_start", text="Start", slider=not part.abs_path_time)
|
|
|
|
sub.itemR(part, "path_end", text="End", slider=not part.abs_path_time)
|
2009-10-31 19:31:45 +00:00
|
|
|
sub.itemR(part, "random_length", text="Random", slider=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.type == 'HAIR' and part.render_strand == True and part.child_type == 'FACES':
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemR(part, "enable_simplify")
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.enable_simplify == True:
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "simplify_refsize")
|
|
|
|
row.itemR(part, "simplify_rate")
|
|
|
|
row.itemR(part, "simplify_transition")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "viewport")
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = row.row()
|
|
|
|
sub.active = part.viewport == True
|
|
|
|
sub.itemR(part, "simplify_viewport")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
elif part.ren_as == 'OBJECT':
|
|
|
|
sub.itemR(part, "dupli_object")
|
|
|
|
sub.itemR(part, "use_global_dupli")
|
|
|
|
elif part.ren_as == 'GROUP':
|
|
|
|
sub.itemR(part, "dupli_group")
|
|
|
|
split = layout.split()
|
|
|
|
sub = split.column()
|
|
|
|
sub.itemR(part, "whole_group")
|
2009-11-01 10:45:42 +00:00
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = part.whole_group == False
|
|
|
|
subsub.itemR(part, "use_group_count")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = split.column()
|
2009-11-01 10:45:42 +00:00
|
|
|
subsub = sub.column()
|
|
|
|
subsub.active = part.whole_group == False
|
|
|
|
subsub.itemR(part, "use_global_dupli")
|
|
|
|
subsub.itemR(part, "rand_group")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if part.use_group_count and not part.whole_group:
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(part, "dupliweights", part, "active_dupliweight_index")
|
|
|
|
|
|
|
|
col = row.column()
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
|
|
|
subsub.itemO("particle.dupliob_copy", icon='ICON_ZOOMIN', text="")
|
|
|
|
subsub.itemO("particle.dupliob_remove", icon='ICON_ZOOMOUT', text="")
|
|
|
|
subsub.itemO("particle.dupliob_move_up", icon='VICON_MOVE_UP', text="")
|
|
|
|
subsub.itemO("particle.dupliob_move_down", icon='VICON_MOVE_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
weight = part.active_dupliweight
|
|
|
|
if weight:
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(weight, "count")
|
|
|
|
|
|
|
|
elif part.ren_as == 'BILLBOARD':
|
|
|
|
sub.itemL(text="Align:")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "billboard_align", expand=True)
|
|
|
|
row.itemR(part, "billboard_lock", text="Lock")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "billboard_object")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemL(text="Tilt:")
|
|
|
|
col.itemR(part, "billboard_tilt", text="Angle", slider=True)
|
|
|
|
col.itemR(part, "billboard_random_tilt", slider=True)
|
|
|
|
col = row.column()
|
|
|
|
col.itemR(part, "billboard_offset")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(psys, "billboard_normal_uv")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(psys, "billboard_time_index_uv")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Split uv's:")
|
|
|
|
row.itemR(part, "billboard_uv_split", text="Number of splits")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(psys, "billboard_split_uv")
|
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Animate:")
|
|
|
|
row.itemR(part, "billboard_animation", expand=True)
|
|
|
|
row.itemL(text="Offset:")
|
|
|
|
row.itemR(part, "billboard_split_offset", expand=True)
|
2009-10-31 23:35:56 +00:00
|
|
|
|
|
|
|
if part.ren_as == 'HALO' or part.ren_as == 'LINE' or part.ren_as == 'BILLBOARD':
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
col.itemR(part, "trail_count")
|
|
|
|
if part.trail_count > 1:
|
|
|
|
col.itemR(part, "abs_path_time", text="Length in frames")
|
|
|
|
col = row.column()
|
|
|
|
col.itemR(part, "path_end", text="Length", slider=not part.abs_path_time)
|
|
|
|
col.itemR(part, "random_length", text="Random", slider=True)
|
|
|
|
else:
|
|
|
|
col = row.column()
|
|
|
|
col.itemL(text="")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_draw(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Display"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
psys = context.particle_system
|
2009-10-31 23:35:56 +00:00
|
|
|
if psys == None:
|
|
|
|
return False
|
|
|
|
if psys.settings == None:
|
|
|
|
return False
|
|
|
|
return True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "draw_as", expand=True)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.draw_as == 'NONE' or (part.ren_as == 'NONE' and part.draw_as == 'RENDER'):
|
2009-10-31 19:31:45 +00:00
|
|
|
return
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
path = (part.ren_as == 'PATH' and part.draw_as == 'RENDER') or part.draw_as == 'PATH'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if path and part.type != 'HAIR' and part.physics_type != 'KEYED' and psys.point_cache.baked == False:
|
2009-10-31 19:31:45 +00:00
|
|
|
box = layout.box()
|
|
|
|
box.itemL(text="Baked or keyed particles needed for correct drawing.")
|
|
|
|
return
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(part, "display", slider=True)
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.draw_as != 'RENDER' or part.ren_as == 'HALO':
|
2009-10-31 19:31:45 +00:00
|
|
|
row.itemR(part, "draw_size")
|
|
|
|
else:
|
|
|
|
row.itemL(text="")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
col.itemR(part, "show_size")
|
|
|
|
col.itemR(part, "velocity")
|
|
|
|
col.itemR(part, "num")
|
|
|
|
if part.physics_type == 'BOIDS':
|
|
|
|
col.itemR(part, "draw_health")
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
col.itemR(part, "material_color", text="Use material color")
|
|
|
|
|
|
|
|
if (path):
|
|
|
|
col.itemR(part, "draw_step")
|
|
|
|
else:
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = part.material_color == False
|
|
|
|
#sub.itemL(text="color")
|
|
|
|
#sub.itemL(text="Override material color")
|
2009-06-05 23:59:33 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_children(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Children"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
layout.row().itemR(part, "child_type", expand=True)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.child_type == 'NONE':
|
2009-10-31 19:31:45 +00:00
|
|
|
return
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "child_nbr", text="Display")
|
|
|
|
col.itemR(part, "rendered_child_nbr", text="Render")
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.child_type == 'FACES':
|
2009-10-31 19:31:45 +00:00
|
|
|
col.itemR(part, "virtual_parents", slider=True)
|
|
|
|
else:
|
|
|
|
col.itemR(part, "child_radius", text="Radius")
|
|
|
|
col.itemR(part, "child_roundness", text="Roundness", slider=True)
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "child_size", text="Size")
|
|
|
|
col.itemR(part, "child_random_size", text="Random")
|
|
|
|
|
|
|
|
layout.row().itemL(text="Effects:")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "clump_factor", slider=True)
|
|
|
|
col.itemR(part, "clumppow", slider=True)
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "rough_endpoint")
|
|
|
|
col.itemR(part, "rough_end_shape")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "rough1")
|
|
|
|
col.itemR(part, "rough1_size")
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "rough2")
|
|
|
|
col.itemR(part, "rough2_size")
|
|
|
|
col.itemR(part, "rough2_thres", slider=True)
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemR(part, "child_length", slider=True)
|
|
|
|
col.itemR(part, "child_length_thres", slider=True)
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.itemL(text="Space reserved for")
|
|
|
|
col.itemL(text="hair parting controls")
|
|
|
|
|
|
|
|
layout.row().itemL(text="Kink:")
|
|
|
|
layout.row().itemR(part, "kink", expand=True)
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2009-11-01 10:45:42 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(part, "kink_amplitude")
|
|
|
|
col.itemR(part, "kink_frequency")
|
|
|
|
col = split.column()
|
|
|
|
col.itemR(part, "kink_shape", slider=True)
|
2009-06-06 16:18:19 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
class PARTICLE_PT_field_weights(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Field Weights"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
part = context.particle_system.settings
|
|
|
|
effector_weights_ui(self, part.effector_weights)
|
|
|
|
|
|
|
|
if part.type == 'HAIR':
|
|
|
|
self.layout.itemR(part.effector_weights, "do_growing_hair")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
class PARTICLE_PT_force_fields(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Force Field Settings"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
part = context.particle_system.settings
|
|
|
|
|
|
|
|
layout.itemR(part, "self_effect")
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.2)
|
|
|
|
split.itemL(text="Type 1:")
|
2009-10-31 23:35:56 +00:00
|
|
|
split.itemR(part.force_field_1, "type", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
basic_force_field_settings_ui(self, part.force_field_1)
|
|
|
|
basic_force_field_falloff_ui(self, part.force_field_1)
|
|
|
|
|
|
|
|
if part.force_field_1.type != 'NONE':
|
|
|
|
layout.itemL(text="")
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.2)
|
|
|
|
split.itemL(text="Type 2:")
|
2009-10-31 23:35:56 +00:00
|
|
|
split.itemR(part.force_field_2, "type", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
basic_force_field_settings_ui(self, part.force_field_2)
|
|
|
|
basic_force_field_falloff_ui(self, part.force_field_2)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-05 23:59:33 +00:00
|
|
|
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Vertexgroups"
|
|
|
|
bl_default_closed = True
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
ob = context.object
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2009-11-14 13:35:44 +00:00
|
|
|
# part = psys.settings
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
# layout.itemL(text="Nothing here yet.")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.itemL(text="Vertex Group")
|
|
|
|
row.itemL(text="Negate")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
|
|
|
|
row.itemR(psys, "vertex_group_density_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
|
|
|
|
row.itemR(psys, "vertex_group_velocity_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
|
|
|
|
row.itemR(psys, "vertex_group_length_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
|
|
|
|
row.itemR(psys, "vertex_group_clump_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
|
|
|
|
row.itemR(psys, "vertex_group_kink_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_roughness1", ob, "vertex_groups", text="Roughness 1")
|
|
|
|
row.itemR(psys, "vertex_group_roughness1_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_roughness2", ob, "vertex_groups", text="Roughness 2")
|
|
|
|
row.itemR(psys, "vertex_group_roughness2_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
|
|
|
|
row.itemR(psys, "vertex_group_roughness_end_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
|
|
|
|
row.itemR(psys, "vertex_group_size_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
|
|
|
|
row.itemR(psys, "vertex_group_tangent_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
|
|
|
|
row.itemR(psys, "vertex_group_rotation_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.item_pointerR(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
|
|
|
|
row.itemR(psys, "vertex_group_field_negate", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-06-01 11:39:11 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_particles)
|
2009-09-10 22:32:33 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_hair_dynamics)
|
2009-06-05 23:59:33 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_cache)
|
|
|
|
bpy.types.register(PARTICLE_PT_emission)
|
2009-10-05 13:25:56 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_velocity)
|
|
|
|
bpy.types.register(PARTICLE_PT_rotation)
|
2009-06-05 23:59:33 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_physics)
|
2009-07-20 23:52:53 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_boidbrain)
|
2009-06-05 23:59:33 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_render)
|
|
|
|
bpy.types.register(PARTICLE_PT_draw)
|
|
|
|
bpy.types.register(PARTICLE_PT_children)
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_field_weights)
|
|
|
|
bpy.types.register(PARTICLE_PT_force_fields)
|
2009-06-07 13:36:12 +00:00
|
|
|
bpy.types.register(PARTICLE_PT_vertexgroups)
|