Age | Commit message (Collapse) | Author |
|
|
|
Was only called on copy particle system
which is already doing an undo push.
|
|
- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
undo data is restored.
- Some undo types accumulate changes (image & text editing)
others store the state multiple times (with de-duplication).
This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
manage restoring correct ID's.
Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
Previously this wasn't done, making history fail in some cases.
This can be optimized to skip some combinations of undo steps.
grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.
See D3113
|
|
Also avoid extern declarations which can get out of sync.
|
|
Use common prefix so adding related functions share the prefix.
|
|
Some of these API's can have 3D versions, explicitly name them 2D.
|
|
D1518 from @mba105 w/ edits
|
|
This makes code closer to id_override/assent-engine ones, which
introduce a new type of linked data, and hence reserve
ID_IS_LINKED_DATABLOCK to real linked datablocks.
|
|
Practically all access to enum data is read-only.
|
|
In preparation for modal operators storing their properties,
no need to keep mouse-paths around.
Also use generic function for lasso properties.
|
|
That one was doing exactly same thing as `dm->getLoopTriArray()`, no
point in having twice the same code here...
|
|
|
|
Idea is to replace hard-to-track (id->lib != NULL) 'is linked datablock' check everywhere in Blender
by a macro doing the same thing. This will allow to easily spot those checks in future, and more importantly,
to easily change it (see work done in asset-engine branch).
Note: did not touch to readfile.c, since there most of the time 'id->lib' check actually concerns the pointer,
and not a check whether ID is linked or not. Will have a closer look at it later.
Reviewers: campbellbarton, brecht, sergey
Differential Revision: https://developer.blender.org/D2082
|
|
Replaces `G.is_rendering` with `use_render_params` argument.
This is needed for Cycles, which attempts to restore render-preview settings from particles,
after it gets its own particle data, but fails to restore because
`G.is_rendering` was being checked in psys_cache_paths (and other places).
|
|
|
|
|
|
Pass distance argument so its possible to limit the range we get all hits from.
Other changes:
- Use boundbox test before calling callback, avoids redundant calls.
- Remove meaningless return value.
- Add doc string, explaining purpose of this function.
|
|
|
|
|
|
Request by Andy, should help him a lot doing weird and wonderful hair styles.
A bit experimental yet, details of behavior might be changed after some real
usage feedback.
|
|
Increment the seed on each use,
otherwise calling again selects the same order, unless you manually adjust the seed.
|
|
Also use doxy formatting for warning/note.
|
|
location.
It also fixes another issue (crash) related to symmetric editing.
Quite involved, we (try to!) fix complete broken logic of parts of particle code, which would use poly index
as tessface one (or vice-versa). Issue most probably goes back to BMesh integration time...
This patch mostly fixes particle editing mode:
- Adding/removing particles when using generative modifiers (like subsurf) should now work.
- Adding/removing particles with a non-tessellated mesh (i.e. one having ngons) should also mostly work.
- X-axis-mirror-editing particles over ngons does not really work, not sure why currently.
- All this in both 'modes' (with or without using modifier stack for particles).
Tech side:
- Store a deformed-only DM in particle modifier data.
- Rename existing DM to make it clear it's a final one.
- Use deformed-only DM's tessface2poly mapping to 'solve' poly/tessface mismatches.
- Make (part of) mirror-editing code able to use a DM instead of raw mesh, so that we can mirror based on final DM
when editing particles using modifier stack (mandatory, since there is no way currently to find orig tessface
from an final DM tessface index).
Note that this patch is not really nice and clean (current particles are beyond hope on this side anyway),
it's more like some urgency bandage. Whole crap needs complete rewrite anyway,
BMesh's polygons make it really hard to work with current system (and looptri would not help much here).
Also, did not test everything possibly affected by those changes, so it needs some users' testing & validation too.
Reviewers: psy-fi
Subscribers: dfelinto, eyecandy
Maniphest Tasks: T47038
Differential Revision: https://developer.blender.org/D1685
|
|
Distinguish between line / line_segment
|
|
Add 'Seed' option for all random select operators
D1508 by @mba105, w/ edits
|
|
This removes CD_MASK_MFACE from CD_MASK_BAREMESH, CD_MASK_DERIVEDMESH and others.
Callers that need it must explicitly add it to their data-masks.
|
|
|
|
|
|
|
|
This is only supported for mesh objects so far.
Also, abort in case there are no faces in dm (instead of crashing on NULL BVH tree...).
|
|
|
|
|
|
|
|
Also quiet some other minor warnings
|
|
|
|
another, including edit data (grooming).
This uses basically the same method as the existing connect/disconnect
feature. The main difference is that it allows working with multiple
objects and transferring the //particle/hair data// instead of the
//mesh// data (which is what connect/disconnect expects). This is a much
more realistic workflow when rigging, topology etc. changes and
groomed hair has to be transferred to the changed model.
|
|
|
|
Conflicts:
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/particle_system.c
source/blender/makesrna/intern/rna_particle.c
|
|
|
|
shape instead of a brush tool.
The brush cutting tool for hair, while useful, is not very accurate and
often requires rotating the model constantly to get the right trimming
on every side. This makes adjustments to a hair shape a very tedious
process.
On the other hand, making proxy meshes for hair shapes is a common
workflow. The new operator allows using such rough meshes as boundaries
for hair. All hairs that are outside the shape mesh are removed, while
those cutting it at some length are shortened accordingly.
The operator can be accessed in the particle edit mode toolbar via the
"Shape Cut" button. The "Shape Object" must be set first and stays
selected as a tool setting for repeatedly applying the shape.
|
|
Added the select random functionality in particle edit mode for hairs or control points.
Reviewers: campbellbarton, lukastoenne
Reviewed By: lukastoenne
Subscribers: campbellbarton, kevindietrich, jezv
Projects: #quick_hacks, #bf_blender, #physics
Maniphest Tasks: T37873
Differential Revision: https://developer.blender.org/D809
|
|
|
|
In rB78c491e the `initialize_particle` function was split into 2 parts for particle texture initialization.
The texture init part however also initializes birth times, which is now missing in the main init function
in some cases (notably when setting start/end directly without a subsequent time step).
|
|
|
|
Opted to keep includes if they are used indirectly (even if removing is possible).
|
|
|
|
|
|
use_modifier_stack enabled
Issue here is complex (Of course, this is particles!)
First issue is that use_modifier_stack will use the num parameter of the
particles instead of num_dmcache, something the brush code did not
account for at all. Now correctly set DMCACHE_ISCHILD in that case.
Second issue is that make_derived_deform will return a mesh with less
indices than the particle system derived mesh. This would mean that
subsequent sampling of the particle derived mesh to initialize the
particles woould also produce garbage. This was being done for
optimization but in that case it broke the system.
Reviewers: lukastoenne
Differential Revision: https://developer.blender.org/D429
|
|
Normals for each kdtree node were allocated but never used,
and search args only use in particles/boids code.
|
|
rB57dba739176153e052d77611ff0e554f05984686 unified pixel distance values
but omitted a factor 100 for particle edit.
|