Commit Graph

99 Commits

Author SHA1 Message Date
Campbell Barton
af2f4724d5 Cleanup: don't use single sets for comparisons 2015-04-14 10:34:32 +10:00
Campbell Barton
7293291a40 cleanup: typos 2015-02-27 15:57:59 +11:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Campbell Barton
e17c6f79a5 cleanup: py imports 2015-01-28 16:50:51 +11:00
Lukas Tönne
47bf0934f5 Removed generic debug1..4 values from the cloth data.
These were used as UI buttons during development. If such parameters are
needed again later they should instead be added in the (now global)
SimDebugData and made accessible with a dev addon or so.
2015-01-21 10:07:11 +01:00
Lukas Tönne
bffd824800 Fixed missing import in particles UI script. 2015-01-20 10:36:05 +01:00
Lukas Tönne
755734c12f Second variant of the copy-to-select operator for particles to only
copy the active particle system (and not remove existing in the process).
2015-01-20 09:30:11 +01:00
Lukas Tönne
2a41d8ebdc Added a "specials" menu button next to the particle systems list for
accessing the copy operator.
2015-01-20 09:30:11 +01:00
Lukas Tönne
90e46ae6c0 Optional randomization factors for the spiral radius and axis orientation. 2015-01-20 09:30:10 +01:00
Lukas Tönne
6edeb43c16 Nicer calculation of the kink axis and result of the spiraling for
negative radius.
2015-01-20 09:30:10 +01:00
Lukas Tönne
307c4a4df9 Another crappy approach to spirals on hairs, crazy expensive though.
Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-01-20 09:30:10 +01:00
Lukas Tönne
9bf7633936 Spiral kink mode for particles.
This is BAD code, but the particle kinking does not make it easy to
write a non-local modifier that requires neighboring positions,
curvature, etc. The feature is needed for Gooseberry.
2015-01-20 09:30:10 +01:00
Lukas Tönne
c2306919b7 Optional clumping noise feature for simulating twisted hair strands.
This adds another level of clumping on child hairs. When enabled, child
hairs chose a secondary clumping target using a Voronoi pattern. This
adds visual detail on a smaller scale, which is useful particularly when
the number of parents is relatively small.

Natural fibres behave in a similar way when they become sticky and
intertwined. Hairs close to each other form a first twisted strand, then
combine into larger strands. Similar features can be found in ropes:
http://en.wikipedia.org/wiki/Hair_twists
http://en.wikipedia.org/wiki/Rope

Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-01-20 09:30:10 +01:00
Lukas Tönne
d1246969ed Curve-based control for "roughness" (noise displacement) of child hair. 2015-01-20 09:30:09 +01:00
Lukas Tönne
c86d55d5e7 Curve-based control for child path tapering.
This is an alternative method to the current fixed function with a
clump factor and "shape" parameter. This function is quite limited and
does not give the desired result in many cases (e.g. long, parallel
rasta strands are problematic). So rather than trying to add more
parameters there is now a fully user-defined optional curve for setting
the tapering shape.
2015-01-20 09:30:09 +01:00
Lukas Tönne
bb76e96339 Presets for hair dynamics.
This is necessary because the hair dynamics settings are not part of the
ParticleSettings datablock, but part of the convoluted cloth modifier
inside the particle system struct. In the future this will be recoded
properly, but in the meantime presets provide a simple an unobtrusive
way to have reusable dynamics settings for hair.

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
2015-01-20 09:30:09 +01:00
Lukas Tönne
d031831a05 Randomness factor for hair bending stiffness.
This helps to create some variation in a hair system, which can
otherwise become very uniform and boring. It's yet another confusing
setting in a system that should have been nodified, but only option for
now (broken windows ...)

Conflicts:
	source/blender/blenkernel/intern/particle_system.c
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
Lukas Tönne
325990ff6e Use dedicated debug values in cloth settings instead of abusing unused
other values.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:08 +01:00
Lukas Tönne
b3cbafb966 Implementation of a target density feature for the hair simulation.
This allows setting a target density which the fluid simulation will
take into account as an additional term in the pressure Poisson
equation. Based on two papers
"Detail Preserving Continuum Simulation of Straight Hair" (McAdams et al. 2009)
and
"Two-way Coupled SPH and Particle Level Set Fluid Simulation" (Losasso et al. 2008)

Currently the target pressure is specified directly, but it will be
a lot more convenient to define this in terms of a geometric value such
as "number of hairs per area" (combined with hair "thickness").

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:07 +01:00
Lukas Tönne
bf96400558 Use a fixed, uniform cell size for hair continuum grids.
This is a bit more awkward for artists to use, but necessary for
a stable solution of the hair continuum calculation. The grid size is
defined by the user, the extent of the grid is then calculated based on
the hair geometry. A hard upper limit prevents bad memory allocation
in case too small values are entered.

Conflicts:
	source/blender/physics/intern/BPH_mass_spring.cpp
2015-01-20 09:30:06 +01:00
Lukas Tönne
c3968861b3 Debug drawing feature to visualize the hair continuum grid. 2015-01-20 09:30:05 +01:00
Lukas Tönne
a351e8b6ef Reorganizing hair dynamics UI layout a bit to make settings slightly
more intuitive.

Also removed a couple of unused or useless features from the UI:
* collider friction is unused and replaced in favor of true collision
* spring damping refers to structural springs (stretch), which is
  not noticable in hair due to extreme stiffness atm.
* pressure factors are not sure since this feature is too unstable atm.

Conflicts:
	release/scripts/startup/bl_ui/properties_particle.py
2015-01-20 09:30:05 +01:00
Lukas Tönne
173bdfe05e Guide hair drawing for hair particles.
Without this the particle system only shows the actual non-simulated
hairs ("guide hairs") during edit mode. These hairs are used for goals
as well, so showing them in the regular viewport is pretty important.

Also the usual hair curves are interpolated along the entire length,
which makes it very difficult to see exact vertex positions, unless
using exact powers of 2 for the segment number and match the display
steps.

Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-01-20 09:30:03 +01:00
Lukas Tönne
48e67c49a5 Added separate damping for bending springs.
The bend damping factor was hardcoded to the same value as the stiffness.
Now it has its own factor in the settings and button in hair dynamics.
2015-01-20 09:30:03 +01:00
Lukas Tönne
491e7493c7 Basic solver result feedback from the mass-spring (cloth/hair) solver.
This returns a general status (success/no-convergence/other) along with
basic statistics (min/max/average) for the error value and the number
of iterations. It allows some general estimation of the simulation
quality and detection of critical settings that could become a problem.
Better visualization and extended feedback can follow later.
2015-01-20 09:30:02 +01:00
Lukas Tönne
f03d253f55 Disabled the velocity filtering feature for now, since the weighting is
incorrect.

The voxel grid needs better tool support to make it usable, so fixing
the filtering is not high priority right now.
2015-01-20 09:30:02 +01:00
Lukas Tönne
226beb9866 Added basic filtering feature for velocity smoothing.
This is part of the original method from "Volumetric Methods for
Simulation and Rendering of Hair". The current filter is a simple box
filter. Other energy-preserving filters such as gaussian filtering
can be implemented later.

The filter size is currently given as a cell count. This is not ideal,
rather it should use a geometrical length value, but this is too
abstract for proper artistical use. Eventually defining the whole grid
in terms of spatial size might work better (possibly using an external
object).
2015-01-20 09:30:01 +01:00
Lukas Tönne
bbae8f88b8 Made the voxel grid size for hair interaction configurable and increased
the default to 32.

Conflicts:
	source/blender/blenloader/intern/versioning_270.c
2015-01-20 09:30:01 +01:00
Lukas Tönne
d8cf12fe5a Debug drawing for simulations, to aid in visualizing abstract data such
as forces, velocities, contact points etc.

This uses a hash table to store debug elements (dots, lines, vectors at
this point). The hash table allows continuous display of elements that
are generated only in certain time steps, e.g. contact points, while
avoiding massive memory allocation. In any case, this system is really
a development feature, but very helpful in finding issues with the
internal solver data.
2015-01-20 09:29:56 +01:00
Lukas Tönne
ba8b8ec998 Implemented internal hair pressure to prevent hair from collapsing in
on itself.

This uses the same voxel structure as the hair smoothing algorithm.
A slightly different method was suggested in the original paper
(Volumetric Methods for Simulation and Rendering of Hair), but this is
based on directing hair based on a target density, which is another
way of implementing global goals. Our own approach is to define a
pressure threshold above which the hair is repelled in the density
gradient direction to simulate internal pressure from collisions.
2015-01-20 09:29:21 +01:00
Lukas Tönne
913e2bae19 Show buttons for particle system modifiers render/viewport toggles
in the particle buttons list.

This is much more convenient than having to switch back and forth
between particle and modifier buttons. The modifier box for particles
does not contain anything useful other than these two toggles anyway.
2015-01-16 17:08:07 +01:00
289c5de7d8 Fix T38359: incorrect display of material slot with pinned particle settings.
Just hide it in this case, the material slot is not really valid without an
object in the context.
2014-01-29 16:50:37 +01:00
Bastien Montagne
c7ac0edb34 Fix T38359: Not a bug, but better to grey out Material selector of particles when using Object or Group render type (since we always use duplicated objects' materials in this case!). 2014-01-25 09:01:32 +01:00
Andrew Buttery
9151f5d227 UI: Add a "New" button for the particle system, consistent to other areas like materials, world and textures.
Differential Revision: https://developer.blender.org/D171
2014-01-12 00:39:39 +01:00
Thomas Dinges
7eab49f8d9 Interface / Particles: Fix bad alignment in Rotation panel, sub layout missed the flag. 2013-12-13 10:54:44 +01:00
Geoffroy Krantz
9174f22b3c Particles: change material picking from index number in UI to menu with materials.
Also fix material slot index not being properly initialized to 1, this got clamped
from zero only on drawing the UI.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D55
2013-12-07 12:26:58 +01:00
Thomas Dinges
61a28ef764 Interface: Remove some more name fields, not needed anymore with list rename.
Also small alignment tweaks to Keying Sets UI, looks better when the 2 columns have the same alignment.
2013-11-24 15:14:45 +01:00
Campbell Barton
1ea47c9af9 Code Cleanup: style, spelling and pep8 edits 2013-11-20 03:40:10 +11:00
Sergey Sharybin
023b25b57e Fix #37106: Hair Length vanishes when Advanced is enabled
Seems to be just a missing case from r34687.

Could not see a reason why hair length is to be hidden in
advanced settings mode.
2013-10-17 10:42:47 +00:00
Thomas Dinges
0cbdac99b8 Interface:
* More compact and better looking Vertex Groups panel (Particle System).
* Smaller uiLists for Cycles as well.
2013-10-13 23:45:41 +00:00
Thomas Dinges
f79eff2984 Interface / Template Lists:
* Reduce the space of more lists, should be all in bl_ui/
2013-10-13 23:24:37 +00:00
Thomas Dinges
6e86760de2 Interface / Template lists:
* Make the gap for the filtering options slightly bigger, so 1 row doesn't look so cluttered.
* Default Render Layer and Particle System list in the Properties Editor to 1 row as well, to save space.
2013-10-13 23:04:39 +00:00
Bastien Montagne
5b83a89c81 Followup to r59434 : py UI scripts edits.
Notes:
* Made those edits by full checking of py files, so I should have spoted most needed edits, yet it remains quite probable I missed a few ones, we'll fix if/when someone notice it...
* Also made some cleanup "on the road"!
2013-08-23 20:41:21 +00:00
Brecht Van Lommel
bb15701f86 Particles: patch #35205 by Jakub Zolcik
The Emission panel now has a Use Modifier Stack option to emit particles from
the mesh with modifiers applied. Previously particles would only be emitted from
faces that exist in the original mesh. There are some caveats however:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.68/Tools#Particles
2013-05-27 17:11:05 +00:00
Joshua Leung
fa02cccf2a Bugfix [#35075] Physics Panel of Particles Fluid is Truncated
Some RNA Properties were not updated in UI scripts after a recent refactoring
there removing "use_" prefix from some of the boolean properties (strangely
though, while every other property attached to SPHFluidSettings.flag has gone
from "use_factor_blah" to "factor_blah", use_factor_density still keeps the old
prefix).
2013-04-25 10:05:49 +00:00
Campbell Barton
53917c4e3a rna attribute consistency edits, use common prefix for booleans. 2013-04-23 07:06:29 +00:00
Sergey Sharybin
e4ecdebb87 Fix #34667: trail_count option missing for Particle (emitter) System Render Panel "Path" UI
Patch from Josh Wedlake, many thanks!
2013-03-22 09:54:43 +00:00
Bastien Montagne
5c5b753779 Fix [#34300] Slider for list of particle systems (keyed particles) is not doing anything. Navigating a list of more than 5 elements requires keyboard.
Systematically adding some custom id to template_list using default UI_UL_list class, this one is commoly used more than once in an area, yielding collision issues if they do not have a custom id...
2013-02-18 13:30:40 +00:00
Bastien Montagne
d0f4a2396b Actually, UI scripts should not use directly pgettext, but rather the iface or tooltip variants. Added those to bpy.app.translations, and used pgettext_iface.
(Did not add those when I created that module, because I did not thought we would actually need them in usual UI code, but turned out I was wrong).

Also made some optimizations in those py gettext funcs, when i18n is disabled at build time, no need to do pyobject -> cstring -> pyobject conversions!.
2013-02-10 10:29:38 +00:00
Campbell Barton
3b8a0f3d67 use import rather then assignment for loading '_' into scripts. 2013-02-10 09:56:05 +00:00