2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-01 11:39:11 +00:00
|
|
|
import bpy
|
2015-01-20 10:36:05 +01:00
|
|
|
from bpy.types import Panel, Menu
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2013-02-10 10:29:38 +00:00
|
|
|
from bpy.app.translations import pgettext_iface as iface_
|
2013-02-10 09:09:26 +00:00
|
|
|
|
2017-10-21 12:41:42 +11:00
|
|
|
from .properties_physics_common import (
|
2017-03-20 09:43:18 +11:00
|
|
|
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
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-15 18:27:41 +00:00
|
|
|
def particle_panel_enabled(context, psys):
|
2011-03-29 04:16:55 +00:00
|
|
|
if psys is None:
|
2011-02-16 10:57:58 +00:00
|
|
|
return True
|
2010-09-28 08:47:59 +00:00
|
|
|
phystype = psys.settings.physics_type
|
2011-03-07 13:23:45 +00:00
|
|
|
if psys.settings.type in {'EMITTER', 'REACTOR'} and phystype in {'NO', 'KEYED'}:
|
2010-09-28 08:47:59 +00:00
|
|
|
return True
|
|
|
|
else:
|
2010-10-05 09:32:35 +00:00
|
|
|
return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable)
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-05 16:05:30 +00:00
|
|
|
def particle_panel_poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2011-02-16 10:57:58 +00:00
|
|
|
settings = 0
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
if psys:
|
|
|
|
settings = psys.settings
|
|
|
|
elif isinstance(context.space_data.pin_id, bpy.types.ParticleSettings):
|
|
|
|
settings = context.space_data.pin_id
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
if not settings:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2011-02-16 10:57:58 +00:00
|
|
|
|
2012-10-08 08:28:05 +00:00
|
|
|
return settings.is_fluid is False and (engine in cls.COMPAT_ENGINES)
|
2011-02-17 04:35:41 +00:00
|
|
|
|
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
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
|
2009-06-05 23:59:33 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2015-01-15 12:53:28 +01:00
|
|
|
class PARTICLE_MT_specials(Menu):
|
|
|
|
bl_label = "Particle Specials"
|
2018-04-16 14:07:42 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2015-01-15 12:53:28 +01:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2015-01-16 11:42:13 +01:00
|
|
|
props = layout.operator("particle.copy_particle_systems", text="Copy Active to Selected Objects")
|
|
|
|
props.use_active = True
|
|
|
|
props.remove_target_particles = False
|
|
|
|
|
|
|
|
props = layout.operator("particle.copy_particle_systems", text="Copy All to Selected Objects")
|
|
|
|
props.use_active = False
|
|
|
|
props.remove_target_particles = True
|
2015-01-15 12:53:28 +01:00
|
|
|
|
2016-09-23 14:32:14 +02:00
|
|
|
layout.operator("particle.duplicate_particle_system")
|
|
|
|
|
2015-01-15 12:53:28 +01:00
|
|
|
|
2014-12-19 14:56:02 +01:00
|
|
|
class PARTICLE_MT_hair_dynamics_presets(Menu):
|
|
|
|
bl_label = "Hair Dynamics Presets"
|
|
|
|
preset_subdir = "hair_dynamics"
|
|
|
|
preset_operator = "script.execute_preset"
|
2018-04-16 14:07:42 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2014-12-19 14:56:02 +01:00
|
|
|
draw = Menu.draw_preset
|
|
|
|
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class ParticleButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "particle"
|
2009-06-01 11:39:11 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return particle_panel_poll(cls, context)
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2015-01-16 17:06:17 +01:00
|
|
|
def find_modifier(ob, psys):
|
|
|
|
for md in ob.modifiers:
|
|
|
|
if md.type == 'PARTICLE_SYSTEM':
|
|
|
|
if md.particle_system == psys:
|
|
|
|
return md
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
|
2015-01-16 17:06:17 +01:00
|
|
|
class PARTICLE_UL_particle_systems(bpy.types.UIList):
|
2017-03-20 09:43:18 +11:00
|
|
|
|
2015-01-16 17:06:17 +01:00
|
|
|
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index, flt_flag):
|
|
|
|
ob = data
|
|
|
|
psys = item
|
|
|
|
|
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
|
|
|
md = find_modifier(ob, psys)
|
|
|
|
|
|
|
|
layout.prop(psys, "name", text="", emboss=False, icon_value=icon)
|
|
|
|
if md:
|
2017-03-20 09:43:18 +11:00
|
|
|
layout.prop(md, "show_render", emboss=False, icon_only=True,
|
|
|
|
icon='RESTRICT_RENDER_OFF' if md.show_render else 'RESTRICT_RENDER_ON')
|
|
|
|
layout.prop(md, "show_viewport", emboss=False, icon_only=True,
|
|
|
|
icon='RESTRICT_VIEW_OFF' if md.show_viewport else 'RESTRICT_VIEW_ON')
|
2015-01-16 17:06:17 +01:00
|
|
|
|
2015-04-14 10:29:11 +10:00
|
|
|
elif self.layout_type == 'GRID':
|
2015-01-16 17:06:17 +01:00
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
layout.label(text="", icon_value=icon)
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2018-04-16 14:07:42 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2011-12-20 06:26:03 +00:00
|
|
|
return (context.particle_system or context.object or context.space_data.pin_id) and (engine in cls.COMPAT_ENGINES)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2012-01-01 08:52:54 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
ob = context.object
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
part = 0
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if ob:
|
|
|
|
row = layout.row()
|
|
|
|
|
2015-01-16 17:06:17 +01:00
|
|
|
row.template_list("PARTICLE_UL_particle_systems", "particle_systems", ob, "particle_systems",
|
2013-10-13 23:04:39 +00:00
|
|
|
ob.particle_systems, "active_index", rows=1)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = row.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
col.operator("object.particle_system_add", icon='ZOOMIN', text="")
|
|
|
|
col.operator("object.particle_system_remove", icon='ZOOMOUT', text="")
|
2015-01-15 12:53:28 +01:00
|
|
|
col.menu("PARTICLE_MT_specials", icon='DOWNARROW_HLT', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-03-29 04:16:55 +00:00
|
|
|
if psys is None:
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2014-01-12 00:39:15 +01:00
|
|
|
layout.operator("object.particle_system_add", icon='ZOOMIN', text="New")
|
|
|
|
|
2011-03-29 04:16:55 +00:00
|
|
|
if part is None:
|
2011-02-16 10:57:58 +00:00
|
|
|
return
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
layout.template_ID(context.space_data, "pin_id")
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
if part.is_fluid:
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.label(text="Settings used for fluid")
|
2011-02-16 10:57:58 +00:00
|
|
|
return
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.prop(part, "type", text="Type")
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
elif not psys.settings:
|
2009-10-31 19:31:45 +00:00
|
|
|
split = layout.split(percentage=0.32)
|
|
|
|
|
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Settings:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.template_ID(psys, "settings", new="particle.new")
|
2011-02-16 10:57:58 +00:00
|
|
|
else:
|
2009-10-31 19:31:45 +00:00
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.32)
|
|
|
|
col = split.column()
|
2012-10-08 08:28:05 +00:00
|
|
|
if part.is_fluid is False:
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Settings:")
|
|
|
|
col.label(text="Type:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2012-10-08 08:28:05 +00:00
|
|
|
if part.is_fluid is False:
|
2010-11-26 15:37:08 +00:00
|
|
|
row = col.row()
|
|
|
|
row.enabled = particle_panel_enabled(context, psys)
|
|
|
|
row.template_ID(psys, "settings", new="particle.new")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
if part.is_fluid:
|
2013-02-10 10:29:38 +00:00
|
|
|
layout.label(text=iface_("%d fluid particles for this frame") % part.count, translate=False)
|
2011-02-16 10:57:58 +00:00
|
|
|
return
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
row = col.row()
|
|
|
|
row.enabled = particle_panel_enabled(context, psys)
|
|
|
|
row.prop(part, "type", text="")
|
|
|
|
row.prop(psys, "seed")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
if part:
|
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
if part.type == 'HAIR':
|
2011-08-22 09:01:49 +00:00
|
|
|
if psys is not None and psys.is_edited:
|
2011-09-21 15:18:38 +00:00
|
|
|
split.operator("particle.edited_clear", text="Free Edit")
|
2011-02-16 10:57:58 +00:00
|
|
|
else:
|
2009-10-31 19:31:45 +00:00
|
|
|
row = split.row()
|
|
|
|
row.enabled = particle_panel_enabled(context, psys)
|
2011-02-16 10:57:58 +00:00
|
|
|
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")
|
2011-08-22 09:01:49 +00:00
|
|
|
if psys is not None and psys.is_edited:
|
2011-02-16 10:57:58 +00:00
|
|
|
if psys.is_global_hair:
|
2016-03-14 21:04:30 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.operator("particle.connect_hair").all = False
|
|
|
|
row.operator("particle.connect_hair", text="Connect All").all = True
|
2011-02-16 10:57:58 +00:00
|
|
|
else:
|
2016-03-14 21:04:30 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.operator("particle.disconnect_hair").all = False
|
|
|
|
row.operator("particle.disconnect_hair", text="Disconnect All").all = True
|
2011-08-22 09:01:49 +00:00
|
|
|
elif psys is not None and part.type == 'REACTOR':
|
2011-02-16 10:57:58 +00:00
|
|
|
split.enabled = particle_panel_enabled(context, psys)
|
|
|
|
split.prop(psys, "reactor_target_object")
|
2011-09-21 15:18:38 +00:00
|
|
|
split.prop(psys, "reactor_target_particle_system", text="Particle System")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Emission"
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2011-01-22 21:22:29 +00:00
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
settings = particle_get_settings(context)
|
|
|
|
|
|
|
|
if settings is None:
|
2011-01-22 21:22:29 +00:00
|
|
|
return False
|
2011-02-16 10:57:58 +00:00
|
|
|
if settings.is_fluid:
|
2011-01-22 20:38:27 +00:00
|
|
|
return False
|
2010-08-05 16:05:30 +00:00
|
|
|
if particle_panel_poll(PARTICLE_PT_emission, context):
|
2011-03-29 04:16:55 +00:00
|
|
|
return psys is None or not context.particle_system.point_cache.use_external
|
2011-01-22 20:38:27 +00:00
|
|
|
return False
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
2011-03-29 04:16:55 +00:00
|
|
|
layout.enabled = particle_panel_enabled(context, psys) and (psys is None or not psys.has_multiple_caches)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.active = part.emit_from == 'VERT' or part.distribution != 'GRID'
|
|
|
|
col.prop(part, "count")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-10-17 10:42:47 +00:00
|
|
|
if part.type == 'HAIR':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "hair_length")
|
2013-10-17 10:42:47 +00:00
|
|
|
if not part.use_advanced_hair:
|
|
|
|
row = layout.row()
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "use_modifier_stack")
|
2013-10-17 10:42:47 +00:00
|
|
|
return
|
2011-02-10 14:59:17 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if part.type != 'HAIR':
|
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "frame_start", text="Frame Start")
|
|
|
|
sub.prop(part, "frame_end", text="End")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(part, "lifetime")
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "lifetime_random", slider=True, text="Lifetime Randomness")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-03 21:35:33 +02:00
|
|
|
|
|
|
|
class PARTICLE_PT_emission_source(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Source"
|
|
|
|
bl_parent_id = "PARTICLE_PT_emission"
|
2018-06-04 12:20:40 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-06-03 21:35:33 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
2018-06-02 21:40:33 +02:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(part, "emit_from")
|
|
|
|
col.prop(part, "use_modifier_stack")
|
|
|
|
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
|
|
|
|
col.prop(part, "distribution")
|
2010-08-06 15:17:44 +00:00
|
|
|
|
2011-02-18 00:40:15 +00:00
|
|
|
if part.emit_from == 'VERT':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "use_emit_random", text="Random Order")
|
2011-02-18 00:40:15 +00:00
|
|
|
elif part.distribution == 'GRID':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.label(text="Grid")
|
|
|
|
col.prop(part, "invert_grid")
|
|
|
|
col.prop(part, "hexagonal_grid")
|
2011-02-04 15:48:13 +00:00
|
|
|
else:
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "use_emit_random")
|
|
|
|
col.prop(part, "use_even_distribution")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.emit_from == 'FACE' or part.emit_from == 'VOLUME':
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.distribution == 'JIT':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "userjit", text="Particles/Face")
|
|
|
|
col.prop(part, "jitter_factor", text="Jittering Amount", slider=True)
|
2009-10-31 23:35:56 +00:00
|
|
|
elif part.distribution == 'GRID':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "grid_resolution")
|
|
|
|
col.prop(part, "grid_random", text="Random", slider=True)
|
2013-05-27 17:11:05 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
|
2017-05-08 15:24:05 +02:00
|
|
|
bl_label = "Hair Dynamics"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2009-11-22 17:41:35 +00:00
|
|
|
if psys is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2009-11-22 17:41:35 +00:00
|
|
|
if psys.settings is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2010-08-09 01:37:09 +00:00
|
|
|
return psys.settings.type == 'HAIR' and (engine in cls.COMPAT_ENGINES)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
psys = context.particle_system
|
2010-08-20 06:09:58 +00:00
|
|
|
self.layout.prop(psys, "use_hair_dynamics", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
2009-12-07 17:55:58 +00:00
|
|
|
|
|
|
|
if not psys.cloth:
|
2018-06-04 12:20:40 +02:00
|
|
|
layout.label(text="Hair dynamics disabled")
|
2009-12-07 17:55:58 +00:00
|
|
|
return
|
|
|
|
|
2014-08-30 17:54:36 +02:00
|
|
|
cloth_md = psys.cloth
|
|
|
|
cloth = cloth_md.settings
|
2014-09-20 21:05:46 +02:00
|
|
|
result = cloth_md.solver_result
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-10-08 08:28:05 +00:00
|
|
|
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-12-19 14:56:02 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.menu("PARTICLE_MT_hair_dynamics_presets", text=bpy.types.PARTICLE_MT_hair_dynamics_presets.bl_label)
|
|
|
|
row.operator("particle.hair_dynamics_preset_add", text="", icon='ZOOMIN')
|
|
|
|
row.operator("particle.hair_dynamics_preset_add", text="", icon='ZOOMOUT').remove_active = True
|
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
col.prop(cloth, "quality", text="Quality Steps", slider=True)
|
|
|
|
col.prop(psys.settings, "show_hair_grid", text="Display Hair Grid")
|
2014-10-30 15:10:34 +01:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.separator()
|
2014-09-17 14:21:06 +02:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
col.prop(cloth, "pin_stiffness", text="Pin Goal Strength")
|
2014-10-30 15:10:34 +01:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2014-09-20 21:05:46 +02:00
|
|
|
if result:
|
|
|
|
box = layout.box()
|
|
|
|
|
|
|
|
if not result.status:
|
|
|
|
label = " "
|
|
|
|
icon = 'NONE'
|
|
|
|
elif result.status == {'SUCCESS'}:
|
|
|
|
label = "Success"
|
|
|
|
icon = 'NONE'
|
|
|
|
elif result.status - {'SUCCESS'} == {'NO_CONVERGENCE'}:
|
|
|
|
label = "No Convergence"
|
|
|
|
icon = 'ERROR'
|
|
|
|
else:
|
|
|
|
label = "ERROR"
|
|
|
|
icon = 'ERROR'
|
|
|
|
box.label(label, icon=icon)
|
2017-03-20 09:43:18 +11:00
|
|
|
box.label("Iterations: %d .. %d (avg. %d)" %
|
|
|
|
(result.min_iterations, result.max_iterations, result.avg_iterations))
|
2014-09-20 21:05:46 +02:00
|
|
|
box.label("Error: %.5f .. %.5f (avg. %.5f)" % (result.min_error, result.max_error, result.avg_error))
|
2014-08-30 17:54:36 +02:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_hair_dynamics_structure(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Structure"
|
|
|
|
bl_parent_id = "PARTICLE_PT_hair_dynamics"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-06-05 16:35:20 +02:00
|
|
|
return context.particle_system.cloth is not None
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
cloth_md = psys.cloth
|
|
|
|
cloth = cloth_md.settings
|
|
|
|
result = cloth_md.solver_result
|
|
|
|
|
|
|
|
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(cloth, "mass")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(cloth, "bending_stiffness", text="Stiffness")
|
|
|
|
sub.prop(psys.settings, "bending_random", text="Random")
|
|
|
|
col.prop(cloth, "bending_damping", text="Damping")
|
|
|
|
# XXX has no noticeable effect with stiff hair structure springs
|
|
|
|
#col.prop(cloth, "spring_damping", text="Damping")
|
|
|
|
|
|
|
|
|
|
|
|
class PARTICLE_PT_hair_dynamics_volume(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Volume"
|
|
|
|
bl_parent_id = "PARTICLE_PT_hair_dynamics"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-06-05 16:35:20 +02:00
|
|
|
return context.particle_system.cloth is not None
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
cloth_md = psys.cloth
|
|
|
|
cloth = cloth_md.settings
|
|
|
|
result = cloth_md.solver_result
|
|
|
|
|
|
|
|
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(cloth, "air_damping", text="Air Drag")
|
|
|
|
col.prop(cloth, "internal_friction", slider=True)
|
|
|
|
col.prop(cloth, "voxel_cell_size")
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.prop(cloth, "density_target", text="Density Target")
|
|
|
|
col.prop(cloth, "density_strength", slider=True, text="Density Strength")
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Cache"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2009-11-22 17:41:35 +00:00
|
|
|
if psys is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2009-11-22 17:41:35 +00:00
|
|
|
if psys.settings is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2011-01-22 20:38:27 +00:00
|
|
|
if psys.settings.is_fluid:
|
|
|
|
return False
|
2009-10-31 19:31:45 +00:00
|
|
|
phystype = psys.settings.physics_type
|
|
|
|
if phystype == 'NO' or phystype == 'KEYED':
|
|
|
|
return False
|
2017-03-20 09:43:18 +11:00
|
|
|
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
|
|
|
|
)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
psys = context.particle_system
|
|
|
|
|
2010-12-13 09:39:14 +00:00
|
|
|
point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if (psys.settings.type == 'HAIR') else 'PSYS')
|
2009-06-06 16:18:19 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Velocity"
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-08-05 16:05:30 +00:00
|
|
|
if particle_panel_poll(PARTICLE_PT_velocity, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
settings = particle_get_settings(context)
|
|
|
|
|
|
|
|
if settings.type == 'HAIR' and not settings.use_advanced_hair:
|
2011-02-07 11:43:33 +00:00
|
|
|
return False
|
2011-03-29 04:16:55 +00:00
|
|
|
return settings.physics_type != 'BOIDS' and (psys is None or not psys.point_cache.use_external)
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
2011-03-12 15:24:16 +00:00
|
|
|
col.prop(part, "normal_factor")
|
|
|
|
sub = col.column(align=True)
|
2018-06-02 21:40:33 +02:00
|
|
|
sub.prop(part, "tangent_factor", text="Tangent")
|
|
|
|
sub.prop(part, "tangent_phase", slider=True, text="Tangent Phase")
|
2011-03-12 15:24:16 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.prop(part, "object_align_factor")
|
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.separator()
|
2011-03-12 15:24:16 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.emit_from == 'PARTICLE':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "particle_factor")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "object_factor", slider=True)
|
2018-06-04 12:20:40 +02:00
|
|
|
col.prop(part, "factor_random", text="Randomize")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
# if part.type=='REACTOR':
|
|
|
|
# sub.prop(part, "reactor_factor")
|
|
|
|
# sub.prop(part, "reaction_shape", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Rotation"
|
2012-03-18 21:33:00 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-08-05 16:05:30 +00:00
|
|
|
if particle_panel_poll(PARTICLE_PT_rotation, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
settings = particle_get_settings(context)
|
2011-02-17 04:35:41 +00:00
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
if settings.type == 'HAIR' and not settings.use_advanced_hair:
|
2011-02-07 11:43:33 +00:00
|
|
|
return False
|
2011-03-29 04:16:55 +00:00
|
|
|
return settings.physics_type != 'BOIDS' and (psys is None or not psys.point_cache.use_external)
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
2012-03-18 21:33:00 +00:00
|
|
|
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="")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
if psys:
|
|
|
|
part = psys.settings
|
|
|
|
else:
|
|
|
|
part = context.space_data.pin_id
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-03-18 21:33:00 +00:00
|
|
|
layout.enabled = particle_panel_enabled(context, psys) and part.use_rotations
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2011-10-17 02:20:53 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.prop(part, "rotation_mode")
|
|
|
|
col.prop(part, "rotation_factor_random", slider=True, text="Randomize")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-03-12 15:24:16 +00:00
|
|
|
col.prop(part, "phase_factor", slider=True)
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "phase_factor_random", text="Randomize Phase ", slider=True)
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2011-10-16 16:14:36 +00:00
|
|
|
if part.type != 'HAIR':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "use_dynamic_rotation")
|
2012-03-20 01:00:28 +00:00
|
|
|
|
2013-12-13 10:54:44 +01:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_rotation_angular_velocity(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Angular Velocity"
|
|
|
|
bl_parent_id = "PARTICLE_PT_rotation"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2013-12-13 10:54:44 +01:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
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.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.prop(part, "angular_velocity_mode", text="Axis")
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.active = part.angular_velocity_mode != 'NONE'
|
|
|
|
sub.prop(part, "angular_velocity_factor", text="Amount")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Physics"
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-08-05 16:05:30 +00:00
|
|
|
if particle_panel_poll(PARTICLE_PT_physics, context):
|
2011-02-07 11:43:33 +00:00
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
settings = particle_get_settings(context)
|
|
|
|
|
|
|
|
if settings.type == 'HAIR' and not settings.use_advanced_hair:
|
2011-02-07 11:43:33 +00:00
|
|
|
return False
|
2011-03-29 04:16:55 +00:00
|
|
|
return psys is None or not psys.point_cache.use_external
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.prop(part, "physics_type")
|
2010-05-03 16:00:42 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
if part.physics_type != 'NO':
|
2018-06-02 21:40:33 +02:00
|
|
|
col = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(part, "mass")
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(part, "use_multiply_size_mass", text="Multiply mass with size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
if part.physics_type == 'FLUID':
|
|
|
|
fluid = part.fluid
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.label(text="Fluid")
|
|
|
|
col.prop(fluid, "solver")
|
|
|
|
col.prop(fluid, "stiffness", text="Stiffness")
|
|
|
|
col.prop(fluid, "linear_viscosity", text="Viscosity")
|
|
|
|
col.prop(fluid, "buoyancy", text="Buoyancy", slider=True)
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.label(text="Advanced")
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
if fluid.solver == 'DDR':
|
|
|
|
sub = col.column()
|
|
|
|
sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion)
|
|
|
|
sub.prop(fluid, "factor_repulsion")
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity)
|
|
|
|
sub.prop(fluid, "factor_stiff_viscosity")
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub = col.column()
|
|
|
|
sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius)
|
|
|
|
sub.prop(fluid, "factor_radius")
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub.prop(fluid, "rest_density", slider=fluid.use_factor_density)
|
|
|
|
sub.prop(fluid, "use_factor_density")
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
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
|
|
|
|
spacing = pow(particle_volume, 1.0 / 3.0)
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub.label(text="Spacing: %g" % spacing)
|
2012-12-14 04:57:26 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
elif fluid.solver == 'DDR':
|
2012-12-14 04:57:26 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.label(text="Springs")
|
|
|
|
col.prop(fluid, "spring_force", text="Force")
|
|
|
|
col.prop(fluid, "use_viscoelastic_springs")
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = fluid.use_viscoelastic_springs
|
|
|
|
sub.prop(fluid, "yield_ratio", slider=True)
|
|
|
|
sub.prop(fluid, "plasticity", slider=True)
|
2012-12-14 04:57:26 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.label(text="Advanced")
|
|
|
|
sub = col.column()
|
|
|
|
sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length)
|
|
|
|
sub.prop(fluid, "factor_rest_length", text="")
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = fluid.use_viscoelastic_springs
|
|
|
|
sub.prop(fluid, "use_initial_rest_length")
|
|
|
|
sub.prop(fluid, "spring_frames", text="Frames")
|
2010-04-04 12:29:06 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
elif part.physics_type == 'KEYED':
|
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = not psys.use_keyed_timing
|
|
|
|
sub.prop(part, "keyed_loops", text="Loops")
|
2011-02-16 10:57:58 +00:00
|
|
|
if psys:
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(psys, "use_keyed_timing", text="Use Timing")
|
|
|
|
|
|
|
|
col.label(text="Keys")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
elif part.physics_type == 'BOIDS':
|
2009-10-31 19:31:45 +00:00
|
|
|
boids = part.boids
|
|
|
|
|
|
|
|
row = layout.row()
|
2010-08-19 15:49:30 +00:00
|
|
|
row.prop(boids, "use_flight")
|
|
|
|
row.prop(boids, "use_land")
|
|
|
|
row.prop(boids, "use_climb")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
col = split.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)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(boids, "air_personal_space")
|
2013-08-23 20:41:21 +00:00
|
|
|
row = col.row(align=True)
|
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")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
col = split.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")
|
2009-11-23 00:27:30 +00:00
|
|
|
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)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(boids, "land_personal_space")
|
|
|
|
col.prop(boids, "land_stick_force")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2016-08-06 10:49:42 +03:00
|
|
|
layout.prop(part, "collision_group")
|
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
split = layout.split()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
col = split.column(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Battle:")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(boids, "health")
|
|
|
|
col.prop(boids, "strength")
|
|
|
|
col.prop(boids, "aggression")
|
|
|
|
col.prop(boids, "accuracy")
|
|
|
|
col.prop(boids, "range")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
col = split.column()
|
2011-09-21 15:18:38 +00:00
|
|
|
col.label(text="Misc:")
|
2010-08-19 15:49:30 +00:00
|
|
|
col.prop(boids, "bank", slider=True)
|
2010-09-16 20:06:10 +00:00
|
|
|
col.prop(boids, "pitch", slider=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(boids, "height", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-03-07 13:23:45 +00:00
|
|
|
if psys and part.physics_type in {'KEYED', 'BOIDS', 'FLUID'}:
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.physics_type == 'BOIDS':
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.label(text="Relations:")
|
2011-01-09 19:09:41 +00:00
|
|
|
elif part.physics_type == 'FLUID':
|
2017-09-02 15:42:29 +10:00
|
|
|
layout.label(text="Fluid Interaction:")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2017-03-20 09:43:18 +11:00
|
|
|
row.template_list("UI_UL_list", "particle_targets", psys, "targets",
|
|
|
|
psys, "active_particle_target_index", rows=4)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = row.column()
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
subsub.operator("particle.new_target", icon='ZOOMIN', text="")
|
|
|
|
subsub.operator("particle.target_remove", icon='ZOOMOUT', text="")
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
2017-01-04 23:21:45 -05:00
|
|
|
subsub.operator("particle.target_move_up", icon='TRIA_UP', text="")
|
|
|
|
subsub.operator("particle.target_move_down", icon='TRIA_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
key = psys.active_particle_target
|
|
|
|
if key:
|
|
|
|
row = layout.row()
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.physics_type == 'KEYED':
|
2009-10-31 19:31:45 +00:00
|
|
|
col = row.column()
|
2017-03-20 09:43:18 +11:00
|
|
|
# doesn't work yet
|
2011-01-03 13:33:07 +00:00
|
|
|
#col.alert = key.valid
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(key, "object", text="")
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(key, "system", text="System")
|
2009-10-31 23:35:56 +00:00
|
|
|
col = row.column()
|
2010-08-20 06:09:58 +00:00
|
|
|
col.active = psys.use_keyed_timing
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(key, "time")
|
|
|
|
col.prop(key, "duration")
|
2010-04-04 12:29:06 +00:00
|
|
|
elif part.physics_type == 'BOIDS':
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = row.row()
|
2017-03-20 09:43:18 +11:00
|
|
|
# doesn't work yet
|
2011-01-03 13:33:07 +00:00
|
|
|
#sub.alert = key.valid
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(key, "object", text="")
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(key, "system", text="System")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2017-06-01 16:38:32 +03:00
|
|
|
layout.row().prop(key, "alliance", expand=True)
|
2010-04-04 12:29:06 +00:00
|
|
|
elif part.physics_type == 'FLUID':
|
|
|
|
sub = row.row()
|
2017-03-20 09:43:18 +11:00
|
|
|
# doesn't work yet
|
2011-01-03 13:33:07 +00:00
|
|
|
#sub.alert = key.valid
|
2010-04-04 12:29:06 +00:00
|
|
|
sub.prop(key, "object", text="")
|
2011-09-21 15:18:38 +00:00
|
|
|
sub.prop(key, "system", text="System")
|
2009-07-20 23:52:53 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_physics_deflection(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Deflection"
|
|
|
|
bl_parent_id = "PARTICLE_PT_physics"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-06-05 16:35:20 +02:00
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.physics_type in {'NEWTON', 'FLUID'}
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(part, "use_size_deflect")
|
|
|
|
col.prop(part, "use_die_on_collision")
|
|
|
|
|
|
|
|
col.prop(part, "collision_group")
|
|
|
|
|
|
|
|
|
|
|
|
class PARTICLE_PT_physics_forces(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Forces"
|
|
|
|
bl_parent_id = "PARTICLE_PT_physics"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-06-05 16:35:20 +02:00
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.physics_type == 'NEWTON'
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.prop(part, "brownian_factor")
|
|
|
|
col.prop(part, "drag_factor", slider=True)
|
|
|
|
col.prop(part, "damping", slider=True)
|
|
|
|
|
|
|
|
|
|
|
|
class PARTICLE_PT_physics_integration(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Integration"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
bl_parent_id = "PARTICLE_PT_physics"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-06-05 16:35:20 +02:00
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.physics_type == 'NEWTON'
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.enabled = particle_panel_enabled(context, psys)
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.prop(part, "integrator")
|
|
|
|
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")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Boid Brain"
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
settings = particle_get_settings(context)
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2011-02-16 10:57:58 +00:00
|
|
|
|
|
|
|
if settings is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2011-08-22 09:01:49 +00:00
|
|
|
if psys is not None and psys.point_cache.use_external:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2011-02-16 10:57:58 +00:00
|
|
|
return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
boids = particle_get_settings(context).boids
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
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()
|
2018-06-05 16:32:11 +02:00
|
|
|
# row.template_list("UI_UL_list", "particle_boids", boids, "states",
|
2013-02-18 13:30:40 +00:00
|
|
|
# boids, "active_boid_state_index", compact="True")
|
2009-10-31 19:31:45 +00:00
|
|
|
#col = row.row()
|
2009-11-12 14:37:13 +00:00
|
|
|
#sub = col.row(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
#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)
|
2017-01-04 23:21:45 -05:00
|
|
|
#sub.operator("boid.state_move_up", icon='TRIA_UP', text="")
|
|
|
|
#sub.operator("boid.state_move_down", icon='TRIA_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
state = boids.active_boid_state
|
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
#layout.prop(state, "name", text="State name")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(state, "ruleset_type")
|
2009-10-31 23:35:56 +00:00
|
|
|
if state.ruleset_type == 'FUZZY':
|
2010-08-19 12:51:31 +00:00
|
|
|
row.prop(state, "rule_fuzzy", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
row.label(text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
2017-03-20 09:43:18 +11:00
|
|
|
row.template_list("UI_UL_list", "particle_boids_rules", state,
|
|
|
|
"rules", state, "active_boid_rule_index", rows=4)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = row.column()
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
|
|
|
subsub = sub.column(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
subsub.operator_menu_enum("boid.rule_add", "type", icon='ZOOMIN', text="")
|
|
|
|
subsub.operator("boid.rule_del", icon='ZOOMOUT', text="")
|
2009-11-01 10:45:42 +00:00
|
|
|
sub = col.row()
|
2009-11-12 14:37:13 +00:00
|
|
|
subsub = sub.column(align=True)
|
2017-01-04 23:21:45 -05:00
|
|
|
subsub.operator("boid.rule_move_up", icon='TRIA_UP', text="")
|
|
|
|
subsub.operator("boid.rule_move_down", icon='TRIA_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
rule = state.active_boid_rule
|
|
|
|
|
|
|
|
if rule:
|
|
|
|
row = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "name", text="")
|
2017-03-20 09:43:18 +11:00
|
|
|
# somebody make nice icons for boids here please! -jahka
|
2017-01-04 23:21:45 -05:00
|
|
|
row.prop(rule, "use_in_air", icon='TRIA_UP', text="")
|
|
|
|
row.prop(rule, "use_on_land", icon='TRIA_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
if rule.type == 'GOAL':
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "object")
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
2010-08-19 15:49:30 +00:00
|
|
|
row.prop(rule, "use_predict")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'AVOID':
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "object")
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row()
|
2010-08-19 15:49:30 +00:00
|
|
|
row.prop(rule, "use_predict")
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "fear_factor")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'FOLLOW_PATH':
|
2011-09-21 15:18:38 +00:00
|
|
|
row.label(text="Not yet functional")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'AVOID_COLLISION':
|
2010-08-19 15:49:30 +00:00
|
|
|
row.prop(rule, "use_avoid")
|
|
|
|
row.prop(rule, "use_avoid_collision")
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "look_ahead")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'FOLLOW_LEADER':
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "object", text="")
|
|
|
|
row.prop(rule, "distance")
|
2009-10-31 19:31:45 +00:00
|
|
|
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")
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'AVERAGE_SPEED':
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "speed", slider=True)
|
|
|
|
row.prop(rule, "wander", slider=True)
|
|
|
|
row.prop(rule, "level", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
elif rule.type == 'FIGHT':
|
2009-11-23 00:27:30 +00:00
|
|
|
row.prop(rule, "distance")
|
|
|
|
row.prop(rule, "flee_distance")
|
2009-06-05 23:59:33 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Render"
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2011-03-29 13:00:59 +00:00
|
|
|
settings = particle_get_settings(context)
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2011-03-29 13:00:59 +00:00
|
|
|
if settings is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2011-03-29 13:00:59 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
return engine in cls.COMPAT_ENGINES
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-03-29 13:00:59 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.prop(part, "render_type", text="Render As")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
if part.type == 'EMITTER' or \
|
2018-06-04 12:20:40 +02:00
|
|
|
(part.render_type in {'OBJECT', 'COLLECTION'} and part.type == 'HAIR'):
|
2018-06-02 21:40:33 +02:00
|
|
|
if part.render_type not in {'NONE'}:
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.prop(part, "particle_size", text="Scale")
|
|
|
|
col.prop(part, "size_random", slider=True, text="Scale Randomness")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
if psys:
|
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
if part.render_type not in {'OBJECT', 'COLLECTION', 'NONE'}:
|
2018-06-02 21:40:33 +02:00
|
|
|
# col.enabled = False
|
|
|
|
col.prop(part, "material_slot", text="Material")
|
|
|
|
col.prop(psys, "parent", text="Coordinate System")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_extra(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Extra"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type != 'NONE'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
col.prop(part, "use_parent_particles", text="Parent Particles")
|
|
|
|
col.prop(part, "show_unborn", text="Unborn")
|
|
|
|
col.prop(part, "use_dead", text="Dead")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_line(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Line"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'LINE'
|
2013-03-22 09:54:43 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2013-03-22 09:54:43 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.separator()
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "line_length_tail", text="Length Tail")
|
|
|
|
sub.prop(part, "line_length_head", text="Head")
|
|
|
|
col.prop(part, "use_velocity_length", text="Velocity Length")
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_path(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Path"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'PATH'
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
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()
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
|
|
|
class PARTICLE_PT_render_path_timing(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Timing"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'PATH'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_object(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Object"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'OBJECT'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
col.prop(part, "dupli_object", text="Instance Object")
|
|
|
|
sub = col.column()
|
|
|
|
sub.prop(part, "use_global_dupli", text="Global Coordinates")
|
|
|
|
sub.prop(part, "use_rotation_dupli", text="Object Rotation")
|
|
|
|
sub.prop(part, "use_scale_dupli", text="Object Scale")
|
|
|
|
|
|
|
|
|
|
|
|
class PARTICLE_PT_render_collection(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Collection"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'COLLECTION'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
col.prop(part, "dupli_group")
|
|
|
|
|
|
|
|
col.prop(part, "use_whole_group")
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = (part.use_whole_group is False)
|
|
|
|
sub.prop(part, "use_group_pick_random")
|
|
|
|
sub.prop(part, "use_global_dupli", text="Global Coordinates")
|
|
|
|
sub.prop(part, "use_rotation_dupli", text="Object Rotation")
|
|
|
|
sub.prop(part, "use_scale_dupli", text="Object Scale")
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_collection_use_count(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Use Count"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render_collection"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'COLLECTION'
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.active = not part.use_whole_group
|
|
|
|
|
|
|
|
layout.prop(part, "use_group_count", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
layout.active = 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",
|
2018-06-05 16:35:20 +02:00
|
|
|
part, "active_dupliweight_index")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
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='TRIA_UP', text="")
|
|
|
|
subsub.operator("particle.dupliob_move_down", icon='TRIA_DOWN', text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
weight = part.active_dupliweight
|
|
|
|
if weight:
|
|
|
|
row = layout.row()
|
|
|
|
row.prop(weight, "count")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_billboards_alignment(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Billboard Alignment"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'BILLBOARD'
|
2011-02-16 02:25:03 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2011-07-01 12:33:34 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
col.prop(part, "billboard_align", text="Align To")
|
|
|
|
col.prop(part, "lock_billboard", text="Lock Axis")
|
|
|
|
col.prop(part, "billboard_object")
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_billboards_tilt(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Billboard Tilt"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'BILLBOARD'
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2011-02-12 23:25:03 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
2011-04-01 02:41:15 +00:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2011-02-16 02:25:03 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "billboard_tilt", text="Angle", slider=True)
|
|
|
|
sub.prop(part, "billboard_tilt_random", text="Random", slider=True)
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "billboard_offset")
|
|
|
|
col.prop(part, "billboard_size", text="Scale")
|
|
|
|
if part.billboard_align == 'VEL':
|
|
|
|
col = col.column(align=True)
|
|
|
|
col.prop(part, "billboard_velocity_head", text="Velocity ScaleHead")
|
|
|
|
col.prop(part, "billboard_velocity_tail", text="Tail")
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_render_billboards_uv(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Billboard UVs"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type == 'BILLBOARD'
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2018-06-02 21:40:33 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
psys = context.particle_system
|
|
|
|
ob = context.object
|
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
if psys:
|
|
|
|
col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_layers")
|
|
|
|
col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_layers")
|
|
|
|
|
|
|
|
col.prop(part, "billboard_uv_split", text="Split UVs")
|
|
|
|
|
|
|
|
if psys:
|
2018-06-02 21:40:33 +02:00
|
|
|
sub = col.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
sub.active = part.billboard_uv_split > 1
|
|
|
|
sub.prop_search(psys, "billboard_split_uv", ob.data, "uv_layers")
|
|
|
|
|
|
|
|
sub.prop(part, "billboard_animation")
|
|
|
|
sub.prop(part, "billboard_offset_split")
|
|
|
|
|
|
|
|
|
|
|
|
class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Trails"
|
|
|
|
bl_parent_id = "PARTICLE_PT_render"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.render_type in {'HALO', 'LINE', 'BILLBOARD'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
col = layout.column()
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
col.prop(part, "trail_count")
|
|
|
|
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = (part.trail_count > 1)
|
|
|
|
sub.prop(part, "use_absolute_path_time", text="Length in Frames")
|
|
|
|
sub.prop(part, "path_end", text="Length", slider=not part.use_absolute_path_time)
|
|
|
|
sub.prop(part, "length_random", text="Random Length", slider=True)
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-03-14 23:17:52 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
|
2018-06-02 21:40:33 +02:00
|
|
|
bl_label = "Viewport Display"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2011-03-29 13:00:59 +00:00
|
|
|
settings = particle_get_settings(context)
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2011-03-29 13:00:59 +00:00
|
|
|
if settings is None:
|
2009-10-31 23:35:56 +00:00
|
|
|
return False
|
2010-08-09 01:37:09 +00:00
|
|
|
return engine in cls.COMPAT_ENGINES
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.prop(part, "draw_method", text="Display As")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
if part.draw_method == 'NONE' or (part.render_type == 'NONE' and part.draw_method == 'RENDER'):
|
2009-10-31 19:31:45 +00:00
|
|
|
return
|
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
path = (part.render_type == 'PATH' and part.draw_method == 'RENDER') or part.draw_method == 'PATH'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(part, "draw_color", text="Color")
|
|
|
|
if part.draw_color in {'VELOCITY', 'ACCELERATION'}:
|
|
|
|
col.prop(part, "color_maximum", text="Fade Distance")
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
if path:
|
|
|
|
col.prop(part, "draw_step", text="Strand Steps")
|
|
|
|
col.prop(part, "draw_percentage", slider=True, text="Amount")
|
2010-08-20 06:09:58 +00:00
|
|
|
if part.draw_method != 'RENDER' or part.render_type == 'HALO':
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "draw_size", text="Size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-03-29 13:00:59 +00:00
|
|
|
if part.draw_percentage != 100 and psys is not None:
|
2010-09-02 06:58:54 +00:00
|
|
|
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:
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.row().label(text="Display percentage makes dynamics inaccurate without baking")
|
2010-09-02 06:58:54 +00:00
|
|
|
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:
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.row().label(text="Display percentage makes dynamics inaccurate without baking")
|
|
|
|
else:
|
|
|
|
layout.row().label(text="")
|
2010-09-02 06:58:54 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(part, "show_guide_hairs", text="Guide Hairs")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(part, "show_size")
|
2010-08-21 04:51:00 +00:00
|
|
|
col.prop(part, "show_velocity")
|
2010-08-17 17:03:52 +00:00
|
|
|
col.prop(part, "show_number")
|
2009-10-31 19:31:45 +00:00
|
|
|
if part.physics_type == 'BOIDS':
|
2010-08-17 17:03:52 +00:00
|
|
|
col.prop(part, "show_health")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Children"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return particle_panel_poll(cls, context)
|
2010-08-05 16:05:30 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-06 15:17:44 +00:00
|
|
|
layout.row().prop(part, "child_type", expand=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
if part.child_type == 'NONE':
|
2009-10-31 19:31:45 +00:00
|
|
|
return
|
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "child_nbr", text="Display Amount")
|
|
|
|
sub.prop(part, "rendered_child_count", text="Render Amount")
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.prop(part, "child_length", slider=True)
|
|
|
|
col.prop(part, "child_length_threshold", slider=True)
|
|
|
|
if psys:
|
|
|
|
col.prop(psys, "child_seed", text="Seed")
|
|
|
|
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-01-07 11:24:34 +00:00
|
|
|
if part.child_type == 'INTERPOLATED':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(part, "virtual_parents", slider=True)
|
2011-01-07 11:24:34 +00:00
|
|
|
col.prop(part, "create_long_hair_children")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2018-06-02 21:40:33 +02:00
|
|
|
col.separator()
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "child_size", text="Size")
|
|
|
|
sub.prop(part, "child_size_random", text="Randomize Size", slider=True)
|
|
|
|
|
|
|
|
if part.child_type == 'SIMPLE':
|
|
|
|
col.separator()
|
|
|
|
col.prop(part, "child_radius", text="Radius")
|
|
|
|
col.prop(part, "child_roundness", text="Roundness", slider=True)
|
|
|
|
elif part.virtual_parents > 0.0:
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.label(text="Parting not available with virtual parents")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_children_parting(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Parting"
|
|
|
|
bl_parent_id = "PARTICLE_PT_children"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.child_type == 'INTERPOLATED'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(part, "child_parting_factor", text="Parting", slider=True)
|
|
|
|
col.prop(part, "child_parting_min", text="Min")
|
|
|
|
col.prop(part, "child_parting_max", text="Max")
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_children_clumping(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Clumping"
|
|
|
|
bl_parent_id = "PARTICLE_PT_children"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.child_type != 'NONE'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
sub = col.column()
|
2018-02-14 14:33:53 +01:00
|
|
|
|
2015-01-09 14:24:19 +01:00
|
|
|
sub.prop(part, "use_clump_curve")
|
|
|
|
if part.use_clump_curve:
|
|
|
|
sub.template_curve_mapping(part, "clump_curve")
|
|
|
|
else:
|
|
|
|
sub.prop(part, "clump_factor", slider=True)
|
|
|
|
sub.prop(part, "clump_shape", slider=True)
|
2015-01-12 16:03:12 +01:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "use_clump_noise")
|
|
|
|
subsub = sub.column()
|
|
|
|
subsub.enabled = part.use_clump_noise
|
|
|
|
subsub.prop(part, "clump_noise_size")
|
2011-01-13 23:00:51 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
if part.child_type == 'SIMPLE':
|
|
|
|
sub.prop(part, "twist")
|
|
|
|
sub.prop(part, "use_twist_curve")
|
|
|
|
if part.use_twist_curve:
|
|
|
|
sub.template_curve_mapping(part, "twist_curve")
|
|
|
|
|
2018-06-05 16:35:20 +02:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Roughness"
|
|
|
|
bl_parent_id = "PARTICLE_PT_children"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.child_type != 'NONE'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2015-01-09 15:58:18 +01:00
|
|
|
col.prop(part, "use_roughness_curve")
|
|
|
|
if part.use_roughness_curve:
|
|
|
|
sub = col.column()
|
|
|
|
sub.template_curve_mapping(part, "roughness_curve")
|
|
|
|
sub.prop(part, "roughness_1", text="Roughness")
|
|
|
|
sub.prop(part, "roughness_1_size", text="Size")
|
|
|
|
else:
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "roughness_1", text="Uniform")
|
|
|
|
sub.prop(part, "roughness_1_size", text="Size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2015-01-09 15:58:18 +01:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "roughness_endpoint", "Endpoint")
|
|
|
|
sub.prop(part, "roughness_end_shape")
|
|
|
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "roughness_2", text="Random")
|
|
|
|
sub.prop(part, "roughness_2_size", text="Size")
|
|
|
|
sub.prop(part, "roughness_2_threshold", slider=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-04 12:20:40 +02:00
|
|
|
|
|
|
|
class PARTICLE_PT_children_kink(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Kink"
|
|
|
|
bl_parent_id = "PARTICLE_PT_children"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
return part.child_type != 'NONE'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = particle_get_settings(context)
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col.prop(part, "kink", text="Kink Type")
|
|
|
|
col = layout.column()
|
|
|
|
col.active = part.kink != 'NO'
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2015-04-14 10:29:11 +10:00
|
|
|
if part.kink == 'SPIRAL':
|
2018-06-02 21:40:33 +02:00
|
|
|
|
|
|
|
sub = col.column()
|
|
|
|
sub.prop(part, "kink_amplitude", text="Amplitude")
|
|
|
|
sub.prop(part, "kink_amplitude_random", text="Randomize Amplitude", slider=True)
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
sub = col.column()
|
2015-01-13 19:41:25 +01:00
|
|
|
sub.prop(part, "kink_axis")
|
2018-06-02 21:40:33 +02:00
|
|
|
sub.prop(part, "kink_axis_random", text="Randomize Axis", slider=True)
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
2015-01-12 20:24:50 +01:00
|
|
|
col.prop(part, "kink_frequency", text="Frequency")
|
|
|
|
col.prop(part, "kink_shape", text="Shape", slider=True)
|
2015-01-13 17:24:20 +01:00
|
|
|
col.prop(part, "kink_extra_steps", text="Steps")
|
2018-06-02 21:40:33 +02:00
|
|
|
|
|
|
|
elif part.kink in {'CURL', 'RADIAL', 'WAVE', 'BRAID', 'WAVE'}:
|
2015-01-12 20:24:50 +01:00
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.prop(part, "kink_amplitude")
|
|
|
|
sub.prop(part, "kink_amplitude_clump", text="Clump", slider=True)
|
|
|
|
col.prop(part, "kink_flat", slider=True)
|
|
|
|
col.prop(part, "kink_frequency")
|
|
|
|
col.prop(part, "kink_shape", slider=True)
|
2009-06-06 16:18:19 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Field Weights"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2011-02-10 14:59:17 +00:00
|
|
|
|
2011-01-22 20:38:27 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return particle_panel_poll(cls, context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2012-10-10 13:18:07 +00:00
|
|
|
effector_weights_ui(self, context, part.effector_weights, 'PSYS')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if part.type == 'HAIR':
|
2011-02-07 11:43:33 +00:00
|
|
|
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)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Force Field Settings"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-02-16 10:57:58 +00:00
|
|
|
part = particle_get_settings(context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-02-12 17:54:24 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(part, "use_self_effect")
|
2011-09-21 15:18:38 +00:00
|
|
|
row.prop(part, "effector_amount", text="Amount")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split(percentage=0.2)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Type 1:")
|
2009-11-23 00:27:30 +00:00
|
|
|
split.prop(part.force_field_1, "type", text="")
|
2009-11-18 21:57:13 +00:00
|
|
|
basic_force_field_settings_ui(self, context, part.force_field_1)
|
2011-02-12 17:54:24 +00:00
|
|
|
if part.force_field_1.type != 'NONE':
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.label(text="Falloff:")
|
2009-11-18 21:57:13 +00:00
|
|
|
basic_force_field_falloff_ui(self, context, part.force_field_1)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if part.force_field_1.type != 'NONE':
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.label(text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
split = layout.split(percentage=0.2)
|
2011-09-21 15:18:38 +00:00
|
|
|
split.label(text="Type 2:")
|
2009-11-23 00:27:30 +00:00
|
|
|
split.prop(part.force_field_2, "type", text="")
|
2009-11-18 21:57:13 +00:00
|
|
|
basic_force_field_settings_ui(self, context, part.force_field_2)
|
2011-02-12 17:54:24 +00:00
|
|
|
if part.force_field_2.type != 'NONE':
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.label(text="Falloff:")
|
2009-11-18 21:57:13 +00:00
|
|
|
basic_force_field_falloff_ui(self, context, part.force_field_2)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
|
2011-10-23 17:52:20 +00:00
|
|
|
bl_label = "Vertex Groups"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2011-02-10 14:59:17 +00:00
|
|
|
|
2011-01-22 20:38:27 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2011-03-29 04:16:55 +00:00
|
|
|
if context.particle_system is None:
|
2011-02-16 10:57:58 +00:00
|
|
|
return False
|
2011-01-22 20:38:27 +00:00
|
|
|
return particle_panel_poll(cls, context)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-04 12:09:02 +00:00
|
|
|
ob = context.object
|
2009-10-31 19:31:45 +00:00
|
|
|
psys = context.particle_system
|
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
col = layout.column()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
|
|
|
|
row.prop(psys, "invert_vertex_group_density", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
|
|
|
|
row.prop(psys, "invert_vertex_group_length", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
|
|
|
|
row.prop(psys, "invert_vertex_group_clump", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
|
|
|
|
row.prop(psys, "invert_vertex_group_kink", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1")
|
|
|
|
row.prop(psys, "invert_vertex_group_roughness_1", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2")
|
|
|
|
row.prop(psys, "invert_vertex_group_roughness_2", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2013-10-13 23:45:41 +00:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
|
|
|
|
row.prop(psys, "invert_vertex_group_roughness_end", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
2012-04-20 18:50:18 +00:00
|
|
|
|
2018-02-14 16:46:29 +01:00
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop_search(psys, "vertex_group_twist", ob, "vertex_groups", text="Twist")
|
|
|
|
row.prop(psys, "invert_vertex_group_twist", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
|
|
|
|
2010-09-03 05:48:19 +00:00
|
|
|
# Commented out vertex groups don't work and are still waiting for better implementation
|
|
|
|
# row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
# row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
|
2010-09-03 05:48:19 +00:00
|
|
|
# row.prop(psys, "invert_vertex_group_velocity", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-09-03 05:48:19 +00:00
|
|
|
# row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
# row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
|
2010-09-03 05:48:19 +00:00
|
|
|
# row.prop(psys, "invert_vertex_group_size", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-09-03 05:48:19 +00:00
|
|
|
# row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
# row.prop_search(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
|
2010-09-03 05:48:19 +00:00
|
|
|
# row.prop(psys, "invert_vertex_group_tangent", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-09-03 05:48:19 +00:00
|
|
|
# row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
# row.prop_search(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
|
2010-09-03 05:48:19 +00:00
|
|
|
# row.prop(psys, "invert_vertex_group_rotation", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-09-03 05:48:19 +00:00
|
|
|
# row = layout.row()
|
2011-09-21 15:18:38 +00:00
|
|
|
# row.prop_search(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
|
2010-09-03 05:48:19 +00:00
|
|
|
# row.prop(psys, "invert_vertex_group_field", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
class PARTICLE_PT_textures(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Textures"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list("TEXTURE_UL_texslots", "", part, "texture_slots", part, "active_texture_index", rows=2)
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
col.operator("texture.slot_move", text="", icon='TRIA_UP').type = 'UP'
|
|
|
|
col.operator("texture.slot_move", text="", icon='TRIA_DOWN').type = 'DOWN'
|
|
|
|
col.menu("TEXTURE_MT_specials", icon='DOWNARROW_HLT', text="")
|
|
|
|
|
|
|
|
if not part.active_texture:
|
|
|
|
layout.template_ID(part, "active_texture", new="texture.new")
|
|
|
|
else:
|
|
|
|
slot = part.texture_slots[part.active_texture_index]
|
|
|
|
layout.template_ID(slot, "texture", new="texture.new")
|
|
|
|
|
|
|
|
|
2018-05-29 11:20:37 +02:00
|
|
|
class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel):
|
|
|
|
bl_label = "Hair Shape"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
@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
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.use_property_split = True
|
2018-05-29 11:20:37 +02:00
|
|
|
|
|
|
|
psys = context.particle_system
|
|
|
|
part = psys.settings
|
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
layout.prop(part, "shape", text="Strand Shape")
|
2018-05-29 11:20:37 +02:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
col.prop(part, "root_radius", text="Radius Root")
|
|
|
|
col.prop(part, "tip_radius", text="Tip")
|
2018-05-29 11:20:37 +02:00
|
|
|
|
2018-06-02 21:40:33 +02:00
|
|
|
col = layout.column()
|
|
|
|
col.prop(part, "radius_scale", text="Radius Scaling")
|
|
|
|
col.prop(part, "use_close_tip")
|
2018-05-29 11:20:37 +02:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel):
|
2017-05-12 16:34:30 +02:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
|
2010-08-17 09:05:44 +00:00
|
|
|
_context_path = "particle_system.settings"
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.ParticleSettings
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
|
|
|
|
classes = (
|
|
|
|
PARTICLE_MT_specials,
|
2017-03-20 02:34:32 +11:00
|
|
|
PARTICLE_MT_hair_dynamics_presets,
|
|
|
|
PARTICLE_UL_particle_systems,
|
2017-03-18 20:03:24 +11:00
|
|
|
PARTICLE_PT_context_particles,
|
|
|
|
PARTICLE_PT_emission,
|
2018-06-03 21:35:33 +02:00
|
|
|
PARTICLE_PT_emission_source,
|
2017-03-18 20:03:24 +11:00
|
|
|
PARTICLE_PT_hair_dynamics,
|
2018-06-04 12:20:40 +02:00
|
|
|
PARTICLE_PT_hair_dynamics_structure,
|
|
|
|
PARTICLE_PT_hair_dynamics_volume,
|
2017-03-20 02:34:32 +11:00
|
|
|
PARTICLE_PT_cache,
|
|
|
|
PARTICLE_PT_velocity,
|
|
|
|
PARTICLE_PT_rotation,
|
2018-06-04 12:20:40 +02:00
|
|
|
PARTICLE_PT_rotation_angular_velocity,
|
2017-03-18 20:03:24 +11:00
|
|
|
PARTICLE_PT_physics,
|
2018-06-04 12:20:40 +02:00
|
|
|
PARTICLE_PT_physics_forces,
|
|
|
|
PARTICLE_PT_physics_deflection,
|
|
|
|
PARTICLE_PT_physics_integration,
|
2017-03-20 02:34:32 +11:00
|
|
|
PARTICLE_PT_boidbrain,
|
2017-03-18 20:03:24 +11:00
|
|
|
PARTICLE_PT_render,
|
2018-06-04 12:20:40 +02:00
|
|
|
PARTICLE_PT_render_line,
|
|
|
|
PARTICLE_PT_render_path,
|
|
|
|
PARTICLE_PT_render_path_timing,
|
|
|
|
PARTICLE_PT_render_object,
|
|
|
|
PARTICLE_PT_render_collection,
|
|
|
|
PARTICLE_PT_render_collection_use_count,
|
|
|
|
PARTICLE_PT_render_billboards_tilt,
|
|
|
|
PARTICLE_PT_render_billboards_uv,
|
|
|
|
PARTICLE_PT_render_trails,
|
|
|
|
PARTICLE_PT_render_extra,
|
2017-03-20 02:34:32 +11:00
|
|
|
PARTICLE_PT_draw,
|
|
|
|
PARTICLE_PT_children,
|
2018-06-04 12:20:40 +02:00
|
|
|
PARTICLE_PT_children_parting,
|
|
|
|
PARTICLE_PT_children_clumping,
|
|
|
|
PARTICLE_PT_children_roughness,
|
|
|
|
PARTICLE_PT_children_kink,
|
2018-05-29 11:20:37 +02:00
|
|
|
PARTICLE_PT_hair_shape,
|
2017-03-20 02:34:32 +11:00
|
|
|
PARTICLE_PT_field_weights,
|
|
|
|
PARTICLE_PT_force_fields,
|
2017-03-18 20:03:24 +11:00
|
|
|
PARTICLE_PT_vertexgroups,
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
PARTICLE_PT_textures,
|
2017-03-20 02:34:32 +11:00
|
|
|
PARTICLE_PT_custom_props,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|