blender/release/scripts/startup/bl_ui/properties_particle.py

1266 lines
46 KiB
Python
Raw Normal View History

# ##### 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,
2010-02-12 13:34:04 +00:00
# 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 rna_prop_ui import PropertyPanel
from bpy.app.translations import pgettext_iface as iface_
2012-10-08 08:28:05 +00:00
from bl_ui.properties_physics_common import (point_cache_ui,
effector_weights_ui,
basic_force_field_settings_ui,
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
def particle_panel_enabled(context, psys):
if psys is None:
return True
phystype = psys.settings.physics_type
if psys.settings.type in {'EMITTER', 'REACTOR'} and phystype in {'NO', 'KEYED'}:
return True
else:
return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable)
def particle_panel_poll(cls, context):
psys = context.particle_system
engine = context.scene.render.engine
settings = 0
if psys:
settings = psys.settings
elif isinstance(context.space_data.pin_id, bpy.types.ParticleSettings):
settings = context.space_data.pin_id
if not settings:
return False
2012-10-08 08:28:05 +00:00
return settings.is_fluid is False and (engine in cls.COMPAT_ENGINES)
def particle_get_settings(context):
if context.particle_system:
return context.particle_system.settings
elif isinstance(context.space_data.pin_id, bpy.types.ParticleSettings):
return context.space_data.pin_id
return None
class ParticleButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "particle"
@classmethod
def poll(cls, context):
return particle_panel_poll(cls, context)
class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@classmethod
def poll(cls, context):
engine = context.scene.render.engine
return (context.particle_system or context.object or context.space_data.pin_id) and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
2012-01-01 08:52:54 +00:00
2012-07-04 21:41:05 +00:00
if context.scene.render.engine == 'BLENDER_GAME':
layout.label("Not available in the Game Engine")
Cucumber, first batch of merge - UI changes and custom exit key --------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-12-20 03:11:56 +00:00
return
ob = context.object
psys = context.particle_system
part = 0
if ob:
row = layout.row()
row.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
ob.particle_systems, "active_index", rows=2)
col = row.column(align=True)
col.operator("object.particle_system_add", icon='ZOOMIN', text="")
col.operator("object.particle_system_remove", icon='ZOOMOUT', text="")
if psys is None:
part = particle_get_settings(context)
if part is None:
return
layout.template_ID(context.space_data, "pin_id")
if part.is_fluid:
layout.label(text="Settings used for fluid")
return
layout.prop(part, "type", text="Type")
elif not psys.settings:
split = layout.split(percentage=0.32)
col = split.column()
col.label(text="Name:")
col.label(text="Settings:")
col = split.column()
col.prop(psys, "name", text="")
col.template_ID(psys, "settings", new="particle.new")
else:
part = psys.settings
split = layout.split(percentage=0.32)
col = split.column()
col.label(text="Name:")
2012-10-08 08:28:05 +00:00
if part.is_fluid is False:
col.label(text="Settings:")
col.label(text="Type:")
col = split.column()
col.prop(psys, "name", text="")
2012-10-08 08:28:05 +00:00
if part.is_fluid is False:
row = col.row()
row.enabled = particle_panel_enabled(context, psys)
row.template_ID(psys, "settings", new="particle.new")
#row = layout.row()
#row.label(text="Viewport")
#row.label(text="Render")
if part.is_fluid:
layout.label(text=iface_("%d fluid particles for this frame") % part.count, translate=False)
return
row = col.row()
row.enabled = particle_panel_enabled(context, psys)
row.prop(part, "type", text="")
row.prop(psys, "seed")
if part:
split = layout.split(percentage=0.65)
if part.type == 'HAIR':
if psys is not None and psys.is_edited:
split.operator("particle.edited_clear", text="Free Edit")
else:
row = split.row()
row.enabled = particle_panel_enabled(context, psys)
row.prop(part, "regrow_hair")
row.prop(part, "use_advanced_hair")
row = split.row()
row.enabled = particle_panel_enabled(context, psys)
row.prop(part, "hair_step")
if psys is not None and psys.is_edited:
if psys.is_global_hair:
layout.operator("particle.connect_hair")
else:
layout.operator("particle.disconnect_hair")
elif psys is not None and part.type == 'REACTOR':
split.enabled = particle_panel_enabled(context, psys)
split.prop(psys, "reactor_target_object")
split.prop(psys, "reactor_target_particle_system", text="Particle System")
class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
bl_label = "Emission"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
psys = context.particle_system
settings = particle_get_settings(context)
if settings is None:
return False
if settings.is_fluid:
return False
if particle_panel_poll(PARTICLE_PT_emission, context):
return psys is None or not context.particle_system.point_cache.use_external
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = particle_get_settings(context)
layout.enabled = particle_panel_enabled(context, psys) and (psys is None or not psys.has_multiple_caches)
row = layout.row()
row.active = part.distribution != 'GRID'
2010-08-21 04:51:00 +00:00
row.prop(part, "count")
if part.type == 'HAIR' and not part.use_advanced_hair:
row.prop(part, "hair_length")
return
if part.type != 'HAIR':
split = layout.split()
col = split.column(align=True)
col.prop(part, "frame_start")
col.prop(part, "frame_end")
col = split.column(align=True)
col.prop(part, "lifetime")
col.prop(part, "lifetime_random", slider=True)
layout.label(text="Emit From:")
layout.prop(part, "emit_from", expand=True)
row = layout.row()
if part.emit_from == 'VERT':
row.prop(part, "use_emit_random")
elif part.distribution == 'GRID':
row.prop(part, "invert_grid")
row.prop(part, "hexagonal_grid")
else:
row.prop(part, "use_emit_random")
row.prop(part, "use_even_distribution")
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
layout.prop(part, "distribution", expand=True)
row = layout.row()
if part.distribution == 'JIT':
row.prop(part, "userjit", text="Particles/Face")
row.prop(part, "jitter_factor", text="Jittering Amount", slider=True)
elif part.distribution == 'GRID':
row.prop(part, "grid_resolution")
row.prop(part, "grid_random", text="Random", slider=True)
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
bl_label = "Hair dynamics"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
psys = context.particle_system
engine = context.scene.render.engine
if psys is None:
return False
if psys.settings is None:
return False
return psys.settings.type == 'HAIR' and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
psys = context.particle_system
self.layout.prop(psys, "use_hair_dynamics", text="")
def draw(self, context):
layout = self.layout
psys = context.particle_system
if not psys.cloth:
return
cloth = psys.cloth.settings
2012-10-08 08:28:05 +00:00
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
split = layout.split()
col = split.column()
col.label(text="Material:")
sub = col.column(align=True)
sub.prop(cloth, "pin_stiffness", text="Stiffness")
sub.prop(cloth, "mass")
sub.prop(cloth, "bending_stiffness", text="Bending")
sub.prop(cloth, "internal_friction", slider=True)
sub.prop(cloth, "collider_friction", slider=True)
col = split.column()
col.label(text="Damping:")
sub = col.column(align=True)
sub.prop(cloth, "spring_damping", text="Spring")
sub.prop(cloth, "air_damping", text="Air")
col.label(text="Quality:")
col.prop(cloth, "quality", text="Steps", slider=True)
class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
bl_label = "Cache"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
psys = context.particle_system
engine = context.scene.render.engine
if psys is None:
return False
if psys.settings is None:
return False
if psys.settings.is_fluid:
return False
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.use_hair_dynamics or psys.point_cache.is_baked))) and engine in cls.COMPAT_ENGINES
def draw(self, context):
psys = context.particle_system
point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if (psys.settings.type == 'HAIR') else 'PSYS')
class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
bl_label = "Velocity"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
if particle_panel_poll(PARTICLE_PT_velocity, context):
psys = context.particle_system
settings = particle_get_settings(context)
if settings.type == 'HAIR' and not settings.use_advanced_hair:
return False
return settings.physics_type != 'BOIDS' and (psys is None or not psys.point_cache.use_external)
else:
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = particle_get_settings(context)
layout.enabled = particle_panel_enabled(context, psys)
split = layout.split()
col = split.column()
col.label(text="Emitter Geometry:")
col.prop(part, "normal_factor")
sub = col.column(align=True)
sub.prop(part, "tangent_factor")
sub.prop(part, "tangent_phase", slider=True)
col = split.column()
col.label(text="Emitter Object:")
col.prop(part, "object_align_factor", text="")
layout.label(text="Other:")
row = layout.row()
if part.emit_from == 'PARTICLE':
row.prop(part, "particle_factor")
else:
row.prop(part, "object_factor", slider=True)
row.prop(part, "factor_random")
#if part.type=='REACTOR':
# sub.prop(part, "reactor_factor")
# sub.prop(part, "reaction_shape", slider=True)
class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
bl_label = "Rotation"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
if particle_panel_poll(PARTICLE_PT_rotation, context):
psys = context.particle_system
settings = particle_get_settings(context)
if settings.type == 'HAIR' and not settings.use_advanced_hair:
return False
return settings.physics_type != 'BOIDS' and (psys is None or not psys.point_cache.use_external)
else:
return False
def draw_header(self, context):
psys = context.particle_system
if psys:
part = psys.settings
else:
part = context.space_data.pin_id
self.layout.prop(part, "use_rotations", text="")
def draw(self, context):
layout = self.layout
psys = context.particle_system
if psys:
part = psys.settings
else:
part = context.space_data.pin_id
layout.enabled = particle_panel_enabled(context, psys) and part.use_rotations
layout.label(text="Initial Orientation:")
split = layout.split()
col = split.column(align=True)
col.prop(part, "rotation_mode", text="")
col.prop(part, "rotation_factor_random", slider=True, text="Random")
col = split.column(align=True)
col.prop(part, "phase_factor", slider=True)
col.prop(part, "phase_factor_random", text="Random", slider=True)
Particle dupliobject rotation changes: There has been quite a bit of fuss about particle dupliobject rotation in 2.59, so here are some changes to make things work a bit more consistently and predictably in 2.60. Much of the confusion has been about what the "Initial rotation" for particles actually means. Simply put it's just a vector that that the particles (and the dupliobjects) are aligned to and around which they can be rotated with the phase controls. I've now renamed these controls under a label "Rotation axis". In 2.59 and previous versions the dupliobject's global x-axis was aligned to the particle rotation axis for non-hair particles. This meant that the object's own rotation (in addition to the particle rotation) could effect the dupliobjects' rotations. This old behavior can still be used with the "Rotation" option in the particle render panel when object/group is set as the visualization. This option is also activated automatically for old files to maintain backwards compatibility. Now the default dupliobject rotations ignore the object's own rotation completely and align the object's tracking axis to the particle rotation axis. The tracking axis can be found under the Object tab -> Animation Hacks panel. In 2.58 the way of calculating the rotation for hair didn't work as intended and enabled many non-functional combinations of options. For this reason I removed most of the rotation options for hair in 2.59. Now the options have been reimplemented better and the dupliobject's tracking axis is aligned to the hair direction by default (Rotation axis = Velocity / Hair). All the other axis options work too along with the phase controls.
2011-10-16 16:14:36 +00:00
if part.type != 'HAIR':
layout.label(text="Angular Velocity:")
split = layout.split()
col = split.column(align=True)
col.prop(part, "angular_velocity_mode", text="")
sub = col.column()
sub.active = part.angular_velocity_mode != 'NONE'
sub.prop(part, "angular_velocity_factor", text="")
col = split.column()
col.prop(part, "use_dynamic_rotation")
class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
if particle_panel_poll(PARTICLE_PT_physics, context):
psys = context.particle_system
settings = particle_get_settings(context)
if settings.type == 'HAIR' and not settings.use_advanced_hair:
return False
return psys is None or not psys.point_cache.use_external
else:
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = particle_get_settings(context)
layout.enabled = particle_panel_enabled(context, psys)
layout.prop(part, "physics_type", expand=True)
row = layout.row()
col = row.column(align=True)
col.prop(part, "particle_size")
col.prop(part, "size_random", slider=True)
if part.physics_type != 'NO':
col = row.column(align=True)
col.prop(part, "mass")
col.prop(part, "use_multiply_size_mass", text="Multiply mass with size")
if part.physics_type in {'NEWTON', 'FLUID'}:
split = layout.split()
col = split.column()
col.label(text="Forces:")
col.prop(part, "brownian_factor")
col.prop(part, "drag_factor", slider=True)
col.prop(part, "damping", slider=True)
col = split.column()
col.label(text="Integration:")
col.prop(part, "integrator", text="")
col.prop(part, "timestep")
sub = col.row()
sub.prop(part, "subframes")
supports_courant = part.physics_type == 'FLUID'
subsub = sub.row()
subsub.enabled = supports_courant
subsub.prop(part, "use_adaptive_subframes", text="")
if supports_courant and part.use_adaptive_subframes:
col.prop(part, "courant_target", text="Threshold")
row = layout.row()
row.prop(part, "use_size_deflect")
row.prop(part, "use_die_on_collision")
if part.physics_type == 'FLUID':
fluid = part.fluid
split = layout.split()
sub = split.row()
sub.prop(fluid, "solver", expand=True)
split = layout.split()
col = split.column()
col.label(text="Fluid properties:")
col.prop(fluid, "stiffness", text="Stiffness")
col.prop(fluid, "linear_viscosity", text="Viscosity")
col.prop(fluid, "buoyancy", text="Buoyancy", slider=True)
col = split.column()
col.label(text="Advanced:")
if fluid.solver == 'DDR':
sub = col.row()
sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion)
sub.prop(fluid, "factor_repulsion", text="")
sub = col.row()
sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity)
sub.prop(fluid, "factor_stiff_viscosity", text="")
sub = col.row()
sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius)
sub.prop(fluid, "factor_radius", text="")
sub = col.row()
sub.prop(fluid, "rest_density", slider=fluid.use_factor_density)
sub.prop(fluid, "use_factor_density", text="")
if fluid.solver == 'CLASSICAL':
# With the classical solver, it is possible to calculate the
# spacing between particles when the fluid is at rest. This
# makes it easier to set stable initial conditions.
particle_volume = part.mass / fluid.rest_density
2013-02-10 08:54:10 +00:00
spacing = pow(particle_volume, 1.0 / 3.0)
sub = col.row()
sub.label(text="Spacing: %g" % spacing)
elif fluid.solver == 'DDR':
split = layout.split()
col = split.column()
col.label(text="Springs:")
col.prop(fluid, "spring_force", text="Force")
col.prop(fluid, "use_viscoelastic_springs")
sub = col.column(align=True)
sub.active = fluid.use_viscoelastic_springs
sub.prop(fluid, "yield_ratio", slider=True)
sub.prop(fluid, "plasticity", slider=True)
col = split.column()
col.label(text="Advanced:")
sub = col.row()
sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length)
sub.prop(fluid, "factor_rest_length", text="")
col.label(text="")
sub = col.column()
sub.active = fluid.use_viscoelastic_springs
sub.prop(fluid, "use_initial_rest_length")
sub.prop(fluid, "spring_frames", text="Frames")
elif part.physics_type == 'KEYED':
split = layout.split()
sub = split.column()
row = layout.row()
col = row.column()
col.active = not psys.use_keyed_timing
col.prop(part, "keyed_loops", text="Loops")
if psys:
row.prop(psys, "use_keyed_timing", text="Use Timing")
layout.label(text="Keys:")
elif part.physics_type == 'BOIDS':
boids = part.boids
row = layout.row()
2010-08-19 15:49:30 +00:00
row.prop(boids, "use_flight")
row.prop(boids, "use_land")
row.prop(boids, "use_climb")
split = layout.split()
sub = split.column()
col = sub.column(align=True)
2010-08-19 15:49:30 +00:00
col.active = boids.use_flight
col.prop(boids, "air_speed_max")
col.prop(boids, "air_speed_min", slider=True)
col.prop(boids, "air_acc_max", slider=True)
col.prop(boids, "air_ave_max", slider=True)
col.prop(boids, "air_personal_space")
row = col.row()
2010-08-31 15:12:24 +00:00
row.active = (boids.use_land or boids.use_climb) and boids.use_flight
2010-08-19 15:49:30 +00:00
row.prop(boids, "land_smooth")
sub = split.column()
col = sub.column(align=True)
2010-08-31 15:12:24 +00:00
col.active = boids.use_land or boids.use_climb
2010-08-19 15:49:30 +00:00
col.prop(boids, "land_speed_max")
col.prop(boids, "land_jump_speed")
2010-08-19 15:49:30 +00:00
col.prop(boids, "land_acc_max", slider=True)
col.prop(boids, "land_ave_max", slider=True)
col.prop(boids, "land_personal_space")
col.prop(boids, "land_stick_force")
row = layout.row()
col = row.column(align=True)
col.label(text="Battle:")
col.prop(boids, "health")
col.prop(boids, "strength")
col.prop(boids, "aggression")
col.prop(boids, "accuracy")
col.prop(boids, "range")
col = row.column()
col.label(text="Misc:")
2010-08-19 15:49:30 +00:00
col.prop(boids, "bank", slider=True)
col.prop(boids, "pitch", slider=True)
col.prop(boids, "height", slider=True)
if psys and part.physics_type in {'KEYED', 'BOIDS', 'FLUID'}:
if part.physics_type == 'BOIDS':
layout.label(text="Relations:")
elif part.physics_type == 'FLUID':
layout.label(text="Fluid interaction:")
row = layout.row()
row.template_list("UI_UL_list", "particle_targets", psys, "targets", psys, "active_particle_target_index")
col = row.column()
sub = col.row()
subsub = sub.column(align=True)
subsub.operator("particle.new_target", icon='ZOOMIN', text="")
subsub.operator("particle.target_remove", icon='ZOOMOUT', text="")
sub = col.row()
subsub = sub.column(align=True)
subsub.operator("particle.target_move_up", icon='MOVE_UP_VEC', text="")
subsub.operator("particle.target_move_down", icon='MOVE_DOWN_VEC', text="")
key = psys.active_particle_target
if key:
row = layout.row()
if part.physics_type == 'KEYED':
col = row.column()
#doesn't work yet
#col.alert = key.valid
col.prop(key, "object", text="")
col.prop(key, "system", text="System")
col = row.column()
col.active = psys.use_keyed_timing
col.prop(key, "time")
col.prop(key, "duration")
elif part.physics_type == 'BOIDS':
sub = row.row()
#doesn't work yet
#sub.alert = key.valid
sub.prop(key, "object", text="")
sub.prop(key, "system", text="System")
layout.prop(key, "alliance", expand=True)
elif part.physics_type == 'FLUID':
sub = row.row()
#doesn't work yet
#sub.alert = key.valid
sub.prop(key, "object", text="")
sub.prop(key, "system", text="System")
Initial code for boids v2 Too many new features to list! But here are the biggies: - Boids can move on air and/or land, or climb a goal object. - Proper interaction with collision objects. * Closest collision object in negative z direction is considered as ground. * Other collision objects are obstacles and boids collide with them. - Boid behavior rules are now added to a dynamic list. * Many new rules and many still not implemented. * Different rule evaluation modes (fuzzy, random, average). - Only particle systems defined by per system "boid relations" are considered for simulation of that system. * This is in addition to the boids own system of course. * Relations define other systems as "neutral", "friend" or "enemy". - All effectors now effect boid physics, not boid brains. * This allows forcing boids somewhere. * Exception to this is new "boid" effector, which defines boid predators (positive strength) and goals (negative strength). Known issue: - Boid health isn't yet stored in pointcache so simulations with "fight" rule are not be read from cache properly. - Object/Group visualization object's animation is not played in "particle time". This is definately the wanted behavior, but isn't possible with the current state of dupliobject code. Other new features: - Particle systems can now be named separately from particle settings. * Default name for particle settings is now "ParticleSettings" instead of "PSys" - Per particle system list of particle effector weights. * Enables different effection strengths for particles from different particle systems with without messing around with effector group setting. Other code changes: - KDTree now supports range search as it's needed for new boids. - "Keyed particle targets" renamed as general "particle targets", as they're needed for boids too. (this might break some files saved with new keyed particles) Bug fixes: - Object & group visualizations didn't work. - Interpolating pointcache didn't do rotation.
2009-07-20 23:52:53 +00:00
class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
bl_label = "Boid Brain"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
psys = context.particle_system
settings = particle_get_settings(context)
engine = context.scene.render.engine
if settings is None:
return False
if psys is not None and psys.point_cache.use_external:
return False
return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES
def draw(self, context):
layout = self.layout
boids = particle_get_settings(context).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("UI_UL_list", "particle_boids", 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.operator("boid.state_add", icon='ZOOMIN', text="")
#sub.operator("boid.state_del", icon='ZOOMOUT', text="")
2009-11-12 14:37:13 +00:00
#sub = row.row(align=True)
#sub.operator("boid.state_move_up", icon='MOVE_UP_VEC', text="")
#sub.operator("boid.state_move_down", icon='MOVE_DOWN_VEC', text="")
state = boids.active_boid_state
#layout.prop(state, "name", text="State name")
row = layout.row()
row.prop(state, "ruleset_type")
if state.ruleset_type == 'FUZZY':
row.prop(state, "rule_fuzzy", slider=True)
else:
row.label(text="")
row = layout.row()
row.template_list("UI_UL_list", "particle_boids_rules", state, "rules", state, "active_boid_rule_index")
col = row.column()
sub = col.row()
subsub = sub.column(align=True)
subsub.operator_menu_enum("boid.rule_add", "type", icon='ZOOMIN', text="")
subsub.operator("boid.rule_del", icon='ZOOMOUT', text="")
sub = col.row()
2009-11-12 14:37:13 +00:00
subsub = sub.column(align=True)
subsub.operator("boid.rule_move_up", icon='MOVE_UP_VEC', text="")
subsub.operator("boid.rule_move_down", icon='MOVE_DOWN_VEC', text="")
rule = state.active_boid_rule
if rule:
row = layout.row()
row.prop(rule, "name", text="")
#somebody make nice icons for boids here please! -jahka
row.prop(rule, "use_in_air", icon='MOVE_UP_VEC', text="")
row.prop(rule, "use_on_land", icon='MOVE_DOWN_VEC', text="")
row = layout.row()
if rule.type == 'GOAL':
row.prop(rule, "object")
row = layout.row()
2010-08-19 15:49:30 +00:00
row.prop(rule, "use_predict")
elif rule.type == 'AVOID':
row.prop(rule, "object")
row = layout.row()
2010-08-19 15:49:30 +00:00
row.prop(rule, "use_predict")
row.prop(rule, "fear_factor")
elif rule.type == 'FOLLOW_PATH':
row.label(text="Not yet functional")
elif rule.type == 'AVOID_COLLISION':
2010-08-19 15:49:30 +00:00
row.prop(rule, "use_avoid")
row.prop(rule, "use_avoid_collision")
row.prop(rule, "look_ahead")
elif rule.type == 'FOLLOW_LEADER':
row.prop(rule, "object", text="")
row.prop(rule, "distance")
row = layout.row()
2010-08-19 15:49:30 +00:00
row.prop(rule, "use_line")
2009-11-12 14:37:13 +00:00
sub = row.row()
sub.active = rule.line
2010-08-19 15:49:30 +00:00
sub.prop(rule, "queue_count")
elif rule.type == 'AVERAGE_SPEED':
row.prop(rule, "speed", slider=True)
row.prop(rule, "wander", slider=True)
row.prop(rule, "level", slider=True)
elif rule.type == 'FIGHT':
row.prop(rule, "distance")
row.prop(rule, "flee_distance")
class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
bl_label = "Render"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
settings = particle_get_settings(context)
engine = context.scene.render.engine
if settings is None:
return False
return engine in cls.COMPAT_ENGINES
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = particle_get_settings(context)
row = layout.row()
row.prop(part, "material")
if psys:
row.prop(psys, "parent")
split = layout.split()
col = split.column()
col.prop(part, "use_render_emitter")
col.prop(part, "use_parent_particles")
col = split.column()
col.prop(part, "show_unborn")
col.prop(part, "use_dead")
layout.prop(part, "render_type", expand=True)
split = layout.split()
col = split.column()
if part.render_type == 'LINE':
col.prop(part, "line_length_tail")
col.prop(part, "line_length_head")
split.prop(part, "use_velocity_length")
elif part.render_type == 'PATH':
col.prop(part, "use_strand_primitive")
sub = col.column()
sub.active = (part.use_strand_primitive is False)
sub.prop(part, "use_render_adaptive")
sub = col.column()
2012-10-08 08:28:05 +00:00
sub.active = part.use_render_adaptive or part.use_strand_primitive is True
sub.prop(part, "adaptive_angle")
sub = col.column()
sub.active = (part.use_render_adaptive is True and part.use_strand_primitive is False)
sub.prop(part, "adaptive_pixel")
col.prop(part, "use_hair_bspline")
col.prop(part, "render_step", text="Steps")
col = split.column()
col.label(text="Timing:")
col.prop(part, "use_absolute_path_time")
if part.type == 'HAIR' or psys.point_cache.is_baked:
col.prop(part, "path_start", text="Start", slider=not part.use_absolute_path_time)
else:
col.prop(part, "trail_count")
col.prop(part, "path_end", text="End", slider=not part.use_absolute_path_time)
col.prop(part, "length_random", text="Random", slider=True)
row = layout.row()
col = row.column()
2012-10-08 08:28:05 +00:00
if part.type == 'HAIR' and part.use_strand_primitive is True and part.child_type == 'INTERPOLATED':
layout.prop(part, "use_simplify")
2012-10-08 08:28:05 +00:00
if part.use_simplify is True:
row = layout.row()
row.prop(part, "simplify_refsize")
row.prop(part, "simplify_rate")
row.prop(part, "simplify_transition")
row = layout.row()
2010-08-21 04:51:00 +00:00
row.prop(part, "use_simplify_viewport")
sub = row.row()
2012-10-08 08:28:05 +00:00
sub.active = part.use_simplify_viewport is True
sub.prop(part, "simplify_viewport")
elif part.render_type == 'OBJECT':
col.prop(part, "dupli_object")
Particle dupliobject rotation changes: There has been quite a bit of fuss about particle dupliobject rotation in 2.59, so here are some changes to make things work a bit more consistently and predictably in 2.60. Much of the confusion has been about what the "Initial rotation" for particles actually means. Simply put it's just a vector that that the particles (and the dupliobjects) are aligned to and around which they can be rotated with the phase controls. I've now renamed these controls under a label "Rotation axis". In 2.59 and previous versions the dupliobject's global x-axis was aligned to the particle rotation axis for non-hair particles. This meant that the object's own rotation (in addition to the particle rotation) could effect the dupliobjects' rotations. This old behavior can still be used with the "Rotation" option in the particle render panel when object/group is set as the visualization. This option is also activated automatically for old files to maintain backwards compatibility. Now the default dupliobject rotations ignore the object's own rotation completely and align the object's tracking axis to the particle rotation axis. The tracking axis can be found under the Object tab -> Animation Hacks panel. In 2.58 the way of calculating the rotation for hair didn't work as intended and enabled many non-functional combinations of options. For this reason I removed most of the rotation options for hair in 2.59. Now the options have been reimplemented better and the dupliobject's tracking axis is aligned to the hair direction by default (Rotation axis = Velocity / Hair). All the other axis options work too along with the phase controls.
2011-10-16 16:14:36 +00:00
sub = col.row()
sub.prop(part, "use_global_dupli")
sub.prop(part, "use_rotation_dupli")
sub.prop(part, "use_scale_dupli")
elif part.render_type == 'GROUP':
col.prop(part, "dupli_group")
split = layout.split()
col = split.column()
col.prop(part, "use_whole_group")
sub = col.column()
sub.active = (part.use_whole_group is False)
Particle dupliobject rotation changes: There has been quite a bit of fuss about particle dupliobject rotation in 2.59, so here are some changes to make things work a bit more consistently and predictably in 2.60. Much of the confusion has been about what the "Initial rotation" for particles actually means. Simply put it's just a vector that that the particles (and the dupliobjects) are aligned to and around which they can be rotated with the phase controls. I've now renamed these controls under a label "Rotation axis". In 2.59 and previous versions the dupliobject's global x-axis was aligned to the particle rotation axis for non-hair particles. This meant that the object's own rotation (in addition to the particle rotation) could effect the dupliobjects' rotations. This old behavior can still be used with the "Rotation" option in the particle render panel when object/group is set as the visualization. This option is also activated automatically for old files to maintain backwards compatibility. Now the default dupliobject rotations ignore the object's own rotation completely and align the object's tracking axis to the particle rotation axis. The tracking axis can be found under the Object tab -> Animation Hacks panel. In 2.58 the way of calculating the rotation for hair didn't work as intended and enabled many non-functional combinations of options. For this reason I removed most of the rotation options for hair in 2.59. Now the options have been reimplemented better and the dupliobject's tracking axis is aligned to the hair direction by default (Rotation axis = Velocity / Hair). All the other axis options work too along with the phase controls.
2011-10-16 16:14:36 +00:00
sub.prop(part, "use_group_pick_random")
sub.prop(part, "use_group_count")
col = split.column()
sub = col.column()
sub.active = (part.use_whole_group is False)
sub.prop(part, "use_global_dupli")
Particle dupliobject rotation changes: There has been quite a bit of fuss about particle dupliobject rotation in 2.59, so here are some changes to make things work a bit more consistently and predictably in 2.60. Much of the confusion has been about what the "Initial rotation" for particles actually means. Simply put it's just a vector that that the particles (and the dupliobjects) are aligned to and around which they can be rotated with the phase controls. I've now renamed these controls under a label "Rotation axis". In 2.59 and previous versions the dupliobject's global x-axis was aligned to the particle rotation axis for non-hair particles. This meant that the object's own rotation (in addition to the particle rotation) could effect the dupliobjects' rotations. This old behavior can still be used with the "Rotation" option in the particle render panel when object/group is set as the visualization. This option is also activated automatically for old files to maintain backwards compatibility. Now the default dupliobject rotations ignore the object's own rotation completely and align the object's tracking axis to the particle rotation axis. The tracking axis can be found under the Object tab -> Animation Hacks panel. In 2.58 the way of calculating the rotation for hair didn't work as intended and enabled many non-functional combinations of options. For this reason I removed most of the rotation options for hair in 2.59. Now the options have been reimplemented better and the dupliobject's tracking axis is aligned to the hair direction by default (Rotation axis = Velocity / Hair). All the other axis options work too along with the phase controls.
2011-10-16 16:14:36 +00:00
sub.prop(part, "use_rotation_dupli")
sub.prop(part, "use_scale_dupli")
if part.use_group_count and not part.use_whole_group:
row = layout.row()
row.template_list("UI_UL_list", "particle_dupli_weights", part, "dupli_weights",
part, "active_dupliweight_index")
col = row.column()
sub = col.row()
subsub = sub.column(align=True)
subsub.operator("particle.dupliob_copy", icon='ZOOMIN', text="")
subsub.operator("particle.dupliob_remove", icon='ZOOMOUT', text="")
subsub.operator("particle.dupliob_move_up", icon='MOVE_UP_VEC', text="")
subsub.operator("particle.dupliob_move_down", icon='MOVE_DOWN_VEC', text="")
weight = part.active_dupliweight
if weight:
row = layout.row()
row.prop(weight, "count")
elif part.render_type == 'BILLBOARD':
ob = context.object
col.label(text="Align:")
row = layout.row()
row.prop(part, "billboard_align", expand=True)
row.prop(part, "lock_billboard", text="Lock")
row = layout.row()
row.prop(part, "billboard_object")
row = layout.row()
col = row.column(align=True)
col.label(text="Tilt:")
col.prop(part, "billboard_tilt", text="Angle", slider=True)
col.prop(part, "billboard_tilt_random", text="Random", slider=True)
col = row.column()
col.prop(part, "billboard_offset")
2011-07-01 12:33:34 +00:00
row = layout.row()
col = row.column()
col.prop(part, "billboard_size", text="Scale")
if part.billboard_align == 'VEL':
col = row.column(align=True)
col.label("Velocity Scale:")
col.prop(part, "billboard_velocity_head", text="Head")
col.prop(part, "billboard_velocity_tail", text="Tail")
if psys:
col = layout.column()
col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_textures")
col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_textures")
split = layout.split(percentage=0.33)
2012-01-23 22:57:46 +00:00
split.label(text="Split UVs:")
split.prop(part, "billboard_uv_split", text="Number of splits")
if psys:
col = layout.column()
col.active = part.billboard_uv_split > 1
col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
row = col.row()
row.label(text="Animate:")
row.prop(part, "billboard_animation", text="")
row.label(text="Offset:")
row.prop(part, "billboard_offset_split", text="")
if part.render_type == 'HALO' or part.render_type == 'LINE' or part.render_type == 'BILLBOARD':
row = layout.row()
col = row.column()
col.prop(part, "trail_count")
if part.trail_count > 1:
col.prop(part, "use_absolute_path_time", text="Length in frames")
col = row.column()
col.prop(part, "path_end", text="Length", slider=not part.use_absolute_path_time)
col.prop(part, "length_random", text="Random", slider=True)
else:
col = row.column()
col.label(text="")
if part.render_type in {'OBJECT', 'GROUP'} and not part.use_advanced_hair:
row = layout.row(align=True)
row.prop(part, "particle_size")
row.prop(part, "size_random", slider=True)
class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
bl_label = "Display"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
settings = particle_get_settings(context)
engine = context.scene.render.engine
if settings is None:
return False
return engine in cls.COMPAT_ENGINES
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = particle_get_settings(context)
row = layout.row()
row.prop(part, "draw_method", expand=True)
if part.draw_method == 'NONE' or (part.render_type == 'NONE' and part.draw_method == 'RENDER'):
return
path = (part.render_type == 'PATH' and part.draw_method == 'RENDER') or part.draw_method == 'PATH'
row = layout.row()
2010-08-21 04:51:00 +00:00
row.prop(part, "draw_percentage", slider=True)
if part.draw_method != 'RENDER' or part.render_type == 'HALO':
row.prop(part, "draw_size")
else:
row.label(text="")
if part.draw_percentage != 100 and psys is not None:
if part.type == 'HAIR':
2012-10-08 08:28:05 +00:00
if psys.use_hair_dynamics and psys.point_cache.is_baked is False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
else:
phystype = part.physics_type
2012-10-08 08:28:05 +00:00
if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked is False:
layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
row = layout.row()
col = row.column()
col.prop(part, "show_size")
2010-08-21 04:51:00 +00:00
col.prop(part, "show_velocity")
col.prop(part, "show_number")
if part.physics_type == 'BOIDS':
col.prop(part, "show_health")
Completely refactored sph fluid particles. Only the very core of the algorithm remains the same, but big changes have happened both on the outside and on the inside. New UI: * The old parameters were quite true to the underlying algorithm, but were quite obscure from a users point of view. Now there are only a few intuitive basic parameters that define the basic fluid behavior. ** By default particle size is now used to determine the interaction radius, rest density and spring rest lengths so that it's easy to get stable simulations by simply emitting particles for a few frames and adjusting the particle size (easy when the particle size is drawn) so that the fluid appears continuous (particles are touching eachother). ** Stiffness - in reality most fluids are very incompressible, but this is a very hard problem to solve with particle based fluid simulation so some compromises have to be made. So the bigger the stiffness parameter is the less the fluid will compress under stress, but the more substeps are needed for stable simulation. ** Viscosity - how much internal friction there is in the fluid. Large viscosities also smooth out instabilities, so less viscous fluids again need more substeps to remain stable. ** Buoancy - with high buoancy low pressure areas inside the fluid start to rise against gravity, and high pressure areas start to come down. * In addition to these basic parameters there are separate advanced parameters that can either be tweaked relative to the basic parameters (or particle size) or defined independently. ** Repulsion - the stiffness parameter tries to keep the fluid density constant, but this can lead to small clumps of particles, so the repulsion keeps the particles better separated. ** Stiff viscosity - the normal viscosity only applies when particles are moving closer to eachother to allow free flowing fluids. Stiff viscosity also applies smoothing to particles that are moving away from eachother. ** Interaction radius - by default this is 4 * particle size. ** Rest density - by default this is a density that the particles have when they're packed densely next to eachother. ** Spring rest length - by default this is 2 * particle size. * There are also new options for 3d view particle coloring in the display panel to show particle velocity and acceleration. These make it easier to see what's happening in the fluid simulations, but can of course be used with other particles as well. * Viscoelastic springs have some new options too. The plasticity can now be set to much higher values for instant deletion of springs as the elastic limit is exeeded. In addition to that there is an option to only create springs for a certain number of frames when a particle is born. These options give new possibilities for breaking viscoelastic fluids. New in the code: * Most of the fluids code is now thread safe, so when particle dynamics go threaded there will be a nice speed boost to fluids as well. * Fluids now use a bvh-tree instead of a kd-tree for the neighbor lookups. The bvh-tree implementation makes the code quite a bit cleaner and should also give a slight speed boost to the simulation too. * Previously only force fields were calculated with the different integration methods, but now the fluid calculations are also done using the selected integration method, so there are again more choices in effecting simulation accuracy and stability. This change also included a nice cleanup of the whole particle integration code. As the internals are pretty stirred up old particle fluid simulations will probably not work correctly straight away, but with some tweaking the same level of control is still available by not using the "relative versions" of the advanced parameters (by default these are not used when loading old files).
2011-03-12 12:38:11 +00:00
col = row.column(align=True)
col.label(text="Color:")
Completely refactored sph fluid particles. Only the very core of the algorithm remains the same, but big changes have happened both on the outside and on the inside. New UI: * The old parameters were quite true to the underlying algorithm, but were quite obscure from a users point of view. Now there are only a few intuitive basic parameters that define the basic fluid behavior. ** By default particle size is now used to determine the interaction radius, rest density and spring rest lengths so that it's easy to get stable simulations by simply emitting particles for a few frames and adjusting the particle size (easy when the particle size is drawn) so that the fluid appears continuous (particles are touching eachother). ** Stiffness - in reality most fluids are very incompressible, but this is a very hard problem to solve with particle based fluid simulation so some compromises have to be made. So the bigger the stiffness parameter is the less the fluid will compress under stress, but the more substeps are needed for stable simulation. ** Viscosity - how much internal friction there is in the fluid. Large viscosities also smooth out instabilities, so less viscous fluids again need more substeps to remain stable. ** Buoancy - with high buoancy low pressure areas inside the fluid start to rise against gravity, and high pressure areas start to come down. * In addition to these basic parameters there are separate advanced parameters that can either be tweaked relative to the basic parameters (or particle size) or defined independently. ** Repulsion - the stiffness parameter tries to keep the fluid density constant, but this can lead to small clumps of particles, so the repulsion keeps the particles better separated. ** Stiff viscosity - the normal viscosity only applies when particles are moving closer to eachother to allow free flowing fluids. Stiff viscosity also applies smoothing to particles that are moving away from eachother. ** Interaction radius - by default this is 4 * particle size. ** Rest density - by default this is a density that the particles have when they're packed densely next to eachother. ** Spring rest length - by default this is 2 * particle size. * There are also new options for 3d view particle coloring in the display panel to show particle velocity and acceleration. These make it easier to see what's happening in the fluid simulations, but can of course be used with other particles as well. * Viscoelastic springs have some new options too. The plasticity can now be set to much higher values for instant deletion of springs as the elastic limit is exeeded. In addition to that there is an option to only create springs for a certain number of frames when a particle is born. These options give new possibilities for breaking viscoelastic fluids. New in the code: * Most of the fluids code is now thread safe, so when particle dynamics go threaded there will be a nice speed boost to fluids as well. * Fluids now use a bvh-tree instead of a kd-tree for the neighbor lookups. The bvh-tree implementation makes the code quite a bit cleaner and should also give a slight speed boost to the simulation too. * Previously only force fields were calculated with the different integration methods, but now the fluid calculations are also done using the selected integration method, so there are again more choices in effecting simulation accuracy and stability. This change also included a nice cleanup of the whole particle integration code. As the internals are pretty stirred up old particle fluid simulations will probably not work correctly straight away, but with some tweaking the same level of control is still available by not using the "relative versions" of the advanced parameters (by default these are not used when loading old files).
2011-03-12 12:38:11 +00:00
col.prop(part, "draw_color", text="")
sub = col.row()
sub.active = (part.draw_color in {'VELOCITY', 'ACCELERATION'})
sub.prop(part, "color_maximum", text="Max")
2012-08-17 18:36:20 +00:00
if path:
col.prop(part, "draw_step")
class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
bl_label = "Children"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
return particle_panel_poll(cls, context)
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = particle_get_settings(context)
layout.row().prop(part, "child_type", expand=True)
if part.child_type == 'NONE':
return
row = layout.row()
col = row.column(align=True)
col.prop(part, "child_nbr", text="Display")
col.prop(part, "rendered_child_count", text="Render")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
if part.child_type == 'INTERPOLATED':
col = row.column()
if psys:
col.prop(psys, "child_seed", text="Seed")
col.prop(part, "virtual_parents", slider=True)
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
col.prop(part, "create_long_hair_children")
else:
col = row.column(align=True)
col.prop(part, "child_size", text="Size")
col.prop(part, "child_size_random", text="Random")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
split = layout.split()
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
col = split.column()
col.label(text="Effects:")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "clump_factor", slider=True)
sub.prop(part, "clump_shape", slider=True)
2011-01-13 23:00:51 +00:00
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "child_length", slider=True)
sub.prop(part, "child_length_threshold", slider=True)
if part.child_type == 'SIMPLE':
sub = col.column(align=True)
sub.prop(part, "child_radius", text="Radius")
sub.prop(part, "child_roundness", text="Roundness", slider=True)
if psys:
sub.prop(psys, "child_seed", text="Seed")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
elif part.virtual_parents > 0.0:
sub = col.column(align=True)
sub.label(text="Parting not")
sub.label(text="available with")
sub.label(text="virtual parents")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
else:
sub = col.column(align=True)
sub.prop(part, "child_parting_factor", text="Parting", slider=True)
sub.prop(part, "child_parting_min", text="Min")
sub.prop(part, "child_parting_max", text="Max")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
col = split.column()
col.label(text="Roughness:")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "roughness_1", text="Uniform")
sub.prop(part, "roughness_1_size", text="Size")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "roughness_endpoint", "Endpoint")
sub.prop(part, "roughness_end_shape")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "roughness_2", text="Random")
sub.prop(part, "roughness_2_size", text="Size")
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub.prop(part, "roughness_2_threshold", slider=True)
layout.row().label(text="Kink:")
layout.row().prop(part, "kink", expand=True)
split = layout.split()
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
split.active = part.kink != 'NO'
col = split.column()
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "kink_amplitude")
sub.prop(part, "kink_amplitude_clump", text="Clump", slider=True)
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
col.prop(part, "kink_flat", slider=True)
col = split.column()
New hair child options: * Renamed children to "simple" and "interpolated" as this is easier to explain and more descriptive than "from particles" and "from faces". * Also shuffled the child ui around a bit to make it clearer. * Child seed parameter allows to change the seed for children independent of the main seed value. * Long hair mode for interpolated children: - Making even haircuts was impossible before as the child strand lengths were even, but their root coordinates were not similar in relation to the parent strands. - The "long hair" option uses the tips of the parent strands to calculate the child strand tips. * Hair parting options: - Hair parting can now be calculated dynamically on the fly when in 2.49 there was a cumbersome way of using emitter mesh seams to define parting lines. - For long hair parting can be created by a tip distance/root distance threshold. For example setting the minimum threshold to 2.0 creates partings between children belonging to parents with tip distance of three times the root distance ((1+2)*root distance). - For short hair the parting thresholds are used as angles between the root directions. * New kink parameters: - Kink flatness calculates kink into a shape that would have been achieved with an actual curling iron. - Kink amplitude clump determines how much the main clump value effects the kink amplitude. - The beginning of kink is now smoothed to make the hair look more natural close to the roots. * Some bugs fixed along the way too: - Child parent's were not determined correctly in some cases. - Children didn't always look correct in particle mode. - Changing child parameters caused actual particles to be recalculated. * Also cleaned up some deprecated code. All in all there should be no real changes to how old files look (except perhaps a bit better!), but the new options should make hair/fur creation a bit more enjoyable. I'll try to make a video demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
sub = col.column(align=True)
sub.prop(part, "kink_frequency")
sub.prop(part, "kink_shape", slider=True)
class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel):
bl_label = "Field Weights"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
return particle_panel_poll(cls, context)
def draw(self, context):
part = particle_get_settings(context)
effector_weights_ui(self, context, part.effector_weights, 'PSYS')
if part.type == 'HAIR':
row = self.layout.row()
row.prop(part.effector_weights, "apply_to_hair_growing")
row.prop(part, "apply_effector_to_children")
row = self.layout.row()
row.prop(part, "effect_hair", slider=True)
class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel):
bl_label = "Force Field Settings"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
part = particle_get_settings(context)
row = layout.row()
row.prop(part, "use_self_effect")
row.prop(part, "effector_amount", text="Amount")
split = layout.split(percentage=0.2)
split.label(text="Type 1:")
split.prop(part.force_field_1, "type", text="")
basic_force_field_settings_ui(self, context, part.force_field_1)
if part.force_field_1.type != 'NONE':
layout.label(text="Falloff:")
basic_force_field_falloff_ui(self, context, part.force_field_1)
if part.force_field_1.type != 'NONE':
layout.label(text="")
split = layout.split(percentage=0.2)
split.label(text="Type 2:")
split.prop(part.force_field_2, "type", text="")
basic_force_field_settings_ui(self, context, part.force_field_2)
if part.force_field_2.type != 'NONE':
layout.label(text="Falloff:")
basic_force_field_falloff_ui(self, context, part.force_field_2)
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
bl_label = "Vertex Groups"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
if context.particle_system is None:
return False
return particle_panel_poll(cls, context)
def draw(self, context):
layout = self.layout
ob = context.object
psys = context.particle_system
split = layout.split(percentage=0.85)
col = split.column()
col.label(text="Vertex Group:")
col.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
col.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
col.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
col.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
col.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1")
col.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2")
col.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
col = split.column()
col.label(text="Negate:")
col.alignment = 'RIGHT'
col.prop(psys, "invert_vertex_group_density", text="")
col.prop(psys, "invert_vertex_group_length", text="")
col.prop(psys, "invert_vertex_group_clump", text="")
col.prop(psys, "invert_vertex_group_kink", text="")
col.prop(psys, "invert_vertex_group_roughness_1", text="")
col.prop(psys, "invert_vertex_group_roughness_2", text="")
col.prop(psys, "invert_vertex_group_roughness_end", text="")
# Commented out vertex groups don't work and are still waiting for better implementation
# row = layout.row()
# row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
# row.prop(psys, "invert_vertex_group_velocity", text="")
# row = layout.row()
# row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
# row.prop(psys, "invert_vertex_group_size", text="")
# row = layout.row()
# row.prop_search(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
# row.prop(psys, "invert_vertex_group_tangent", text="")
# row = layout.row()
# row.prop_search(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
# row.prop(psys, "invert_vertex_group_rotation", text="")
# row = layout.row()
# row.prop_search(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
# row.prop(psys, "invert_vertex_group_field", text="")
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER'}
_context_path = "particle_system.settings"
_property_type = bpy.types.ParticleSettings
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)