Commit Graph

1193 Commits

Author SHA1 Message Date
7fe3d1e7d7 Fix T57934: non-empty duplicators don't render
Convert non-empty duplicators to empties.
2018-12-11 15:02:58 +11:00
51dbf8d71a Fix T59087: Empty meshes have large bound-box
Initialize to default values for meshes w/o vertices,
note that zeroing for BKE_object_boundbox_calc_from_mesh
matches old derived mesh code.
2018-12-10 19:32:35 +11:00
79312c1912 Depsgraph: Remove duplicated sets of recalc/update flags
There were at least three copies of those:

- OB_RECALC* family of flags, which are rudiment of an old
  dependency graph system.
- PSYS_RECALC* which were used by old dependency graph system
  as a separate set since the graph itself did not handle
  particle systems.
- DEG_TAG_* which was used to tag IDs.

Now there is a single set, which defines what can be tagged
and queried for an update. It also has some aggregate flags
to make queries simpler.

Lets once and for all solve the madness of those flags, stick
to a single set, which will not overlap with anything or require
any extra conversion.

Technically, shouldn't be measurable user difference, but some
of the agregate flags for few dependency graph components did
change.

Fixes T58632: Particle don't update rotation settings
2018-12-07 11:37:38 +01:00
c8467ccc8d Fix T58310: Crash when removing multires modifier from sculpt object 2018-12-06 15:22:21 +01:00
2e392a0fdc Merge branch 'master' into blender2.8 2018-12-02 14:16:09 +11:00
c00e1f68e9 Cleanup: BKE_effect.h naming 2018-12-02 14:14:51 +11:00
8f8c238659 Merge branch 'master' into blender2.8 2018-11-30 15:11:32 +11:00
8c85f1316c Cleanup: name macros w/ matching BEGIN/END 2018-11-30 15:08:47 +11:00
Dalai Felinto
4c3ed98ca2 Local View
Bring back per-viewport localview. This is based on Blender 2.79.
We have a limit of 16 different local view viewports.

We are using both the numpad /, as well as the regular /.

Missing features:
* Hack to make sure lights are always visible.
* Make rendered mode with external engines to support this as well
  (probably just need to support this in the RNA iterators).
* Support over 16 viewports by taking existing viewports out of local view.

The code can use a cleanup pass in the future to unify the test to see
if an object is visible (or we can use TESTBASE in more places).
2018-11-25 09:50:34 -02:00
059c119719 Merge branch 'master' into blender2.8 2018-11-25 08:01:53 +11:00
Dalai Felinto
9be5b2d23f Pass viewport to BASE_ related tests, for viewport view/select restrictions
Note: functions like select all are still not respecting that.
I will fix this as part of the local view commit though.
2018-11-23 15:13:14 -02:00
ce6d1e890c Cleanup: Use proper module prefix in function names 2018-11-22 16:35:12 +01:00
4dc639ac99 Speedup rigs with multiple objects deformed by bbones
Previously each of the objects which has armature modifier will
request deformation matricies from bbones. Thing is, all those
deformations are the same and do not depend on object which is
being modified. What's even worse is that this calculation is
not cheap.

This change makes it so bbones deformation is calculated once
and stored in the armature object. After this armature modifiers
simply use it.

With a rigs we've got here dependency graph evaluation time
goes down from 0.02 sec to 0.012 sec.

Possible further optimization is to make bbone deformation
calculated at the time when bone is calculated. This will avoid
an extra threaded loop over all bones.
2018-11-20 15:53:59 +01:00
88d634ca05 Vertex parent: Remove CCGDM optimization
Currently we never return CCGDM from the modifier stack,
so the optimization was doing pretty much nothing.

Removing it completely for now, it needs to be re-done
with the new evaluated Mesh/Subdiv.
2018-11-20 14:53:41 +01:00
5f21030a81 Image Empties: Option to not display the backside of image empties
Reviewers: brecht

Differential Revision: https://developer.blender.org/D3964
2018-11-19 19:33:09 +01:00
51711fdcaa Revert "BKE object: Correct bound box of bezier curve objects not matching the object viewed."
This reverts commit 24677cf77b.
2018-11-19 10:28:31 -02:00
24677cf77b BKE object: Correct bound box of bezier curve objects not matching the object viewed. 2018-11-19 09:05:20 -02:00
34058c4ff1 Fix T57105: Baked Particles could not be rendered as expected
Same fix as for smoke (and is what caching proposal is AFAIK):
share cache between copied and original objects.

One thing which is still missing to be fixed is to make auto-cache
more reliable. It was already kind of broken, so don't think it
should be a stopping factor for this fix.
2018-11-13 11:39:02 +01:00
c121bc6219 Cleanup: use explicit 'select_and_set_active' API name
Selection should be separated from active state and handled by higher
level code (operators/editors) instead of happening automatically.
2018-11-08 08:31:11 +11:00
798cd8a723 Cleanup: style 2018-11-01 07:32:13 +11:00
a3802f66e2 Image Empties: More visibility settings
Support for showing images in background/foreground and only in perspective/orthographic view.

Internally the depth of the image is modified in the fragment shader by setting `gl_FragDepth` explicitly.

The UI still needs some work to improve usability, see D3863 for details.
Currently there is one duplicated function, not sure how to best deduplicate it yet. (`is_image_empty_visible`)

Reviewer: fclem, brecht, campbellbarton

Differential Revision: https://developer.blender.org/D3863
2018-10-31 13:42:33 +01:00
363a196ed6 BBox accessor: switch to switch, add missing gpencil case. 2018-10-29 16:37:27 +01:00
Dalai Felinto
4af280ac90 Refactor cleanup: BKE_object_is_in_editmode
Using switch and keep it concise.
2018-10-26 13:39:51 -03:00
541d07045b GP: Redesign drawing cache to support particles
Full redesign of the cache system used for drawing strokes and handle derived frame data.

Before, the cache was saved in bGPdata and a hash was used to manage several objects with the same datablock.

Old design made the use of particles very inefficient and prone to bugs and segment faults, and especially when this was mixed with onion skinning and multiple objects using same datablock. Also, there were some conflicts with the depsgrah logic (the old design was done before despgraph was in place) that made the use of hash not working.

The new design saves the data in the object runtime struct and avoid the use of any hash to find the right data. This improves the speed and reduce a lot the complexity of the code, memory allocation, hash overload and adds full support for particles and reused datablocks.

The particles can reuse the modifiers and shader effects of the original grease pencil object.
2018-10-20 09:08:34 +02:00
41216d5ad4 Cleanup: Remove more #if 0 blocks
Continuation of https://developer.blender.org/D3802

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3808
2018-10-18 15:43:06 +02:00
27389362a4 Mesh: remove DerivedMesh for boundbox calculation
Fixes edit-mesh not having a boundbox calculated for it.
2018-10-15 17:14:05 +11:00
62a3dfec78 Mesh: mostly remove DerivedMesh for vertex parent
The exception is for subdivision surface which still uses derived mesh.
2018-10-15 15:31:17 +11:00
86635402d5 Mesh: remove derivedFinal from various places 2018-10-12 19:29:40 +11:00
1b910082a0 Edit Mesh: replace DerivedMesh w/ Mesh
DerivedMesh is now removed from edit-mesh modifier evaluation.
2018-10-09 17:48:28 +11:00
04064fb186 Cleanup: use DRW_object_is_* for object checks
Also use const qualifier for object's.
2018-10-08 10:43:34 +11:00
280de3df07 Multires: Use proper subdivision level for reshape
Apparently, part of code got lost last minute prior to push.
2018-09-26 15:08:04 +02:00
6ed581c107 Multires: Allow changing sculpt level without loosing data
As the comment states, this is not really great solution, but
is good enough for now. Proper solution needs some more work,
and maybe reconsideration of what is stored where.
2018-09-25 12:37:00 +02:00
342e73f90f Spelling fixes in comments and descriptions (2.8 changes), patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 18:48:29 +02:00
253dce07d7 Merge branch 'master' into blender2.8 2018-09-24 17:42:52 +02:00
0cff044d84 Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 17:28:40 +02:00
de994d6b7b GP: Fix problem with mode opening 2D Animation template
The grease pencil does not need a toggle of mode.

This fix also the problem when open grease pencil files that did not keep the mode saved.
2018-09-20 13:47:59 +02:00
bb3ec3ebaf BLI_utildefines: rename pointer conversion macros
Terms get/set don't make much sense when casting values.

Name macros so the conversion is obvious,
use common prefix for easier completion.

- GET_INT_FROM_POINTER  -> POINTER_AS_INT
- SET_INT_IN_POINTER    -> POINTER_FROM_INT
- GET_UINT_FROM_POINTER -> POINTER_AS_UINT
- SET_UINT_IN_POINTER   -> POINTER_FROM_UINT
2018-09-19 12:12:21 +10:00
f35e9f047a Merge branch 'master' into blender2.8 2018-09-19 12:14:36 +10:00
0ddf3e110e Cleanup: comment blocks 2018-09-02 18:51:31 +10:00
ae57383648 Cleanup: comment blocks 2018-09-02 18:28:27 +10:00
e3c110e72e Fix T56619: Transform crash w/ curve deform 2018-08-31 11:15:09 +10:00
42f7767dab Cleanup: rename files from group to collection to match contents. 2018-08-29 16:25:50 +02:00
a6b65c75cd Fix T56360: metaball viewport checkbox crash.
Do same as for other geometry types to compute bbox, instead of blindly
returning NULL `ob->bb`...
2018-08-23 21:40:43 +02:00
1b53838548 Merge branch 'master' into blender2.8 2018-08-14 14:10:47 +02:00
932251caea Fix object copying not ensuring validity of material arrays.
Related to T56363, this is not fixing the root of the bug, but ID
copying should always be a good occasion to ensure sanity of our data
(and error checking is always better than a crash!).
2018-08-14 14:06:42 +02:00
f06884b18a Cleanup: style, duplicate includes 2018-07-31 20:11:55 +10:00
1fd27c2332 Respect ID user count when creating pose on object copy
This solves wrong user counter of custom shape when duplicating bone
few times and then undoing all the duplications.
2018-07-31 11:39:22 +02:00
66da2f537a New Grease Pencil object for 2D animation
This commit merge the full development done in greasepencil-object branch and include mainly the following features.

- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.

You can get more info here:

https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/

This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.

Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
2018-07-31 10:50:43 +02:00
a3b6ae9fb9 Cleanup/Refactor: Move CurveCache runtime data into Object.runtime struct.
Also, fix missing cleanup of Object.runtime when copying Object
datablocks!
2018-07-30 16:58:44 +02:00
4875958083 Cleanup: Remove occurances of GPULamp 2018-07-27 18:12:02 +02:00