Commit Graph

75472 Commits

Author SHA1 Message Date
Jacques Lucke
7c53bca1dd Fix T61702: obmat used incorrectly when calculating constant detail size
Reviewers: brecht

Differential Revision: https://developer.blender.org/D4372
2019-02-19 15:52:49 +01:00
Sebastian Parborg
655eb8eabd Fix T61690: Hidden curve vertices are drawn in edit-mode
When hiding the curve handles/points previously, the control points would still be drawn (loose verts).
Now we hide everything related to the handle if it is hidden.

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D4373
2019-02-19 15:45:40 +01:00
Brecht Van Lommel
38f0d5f75a Fix T61714, T61712: crash reloading images after recent changes.
Now that we are looping over all image users that were previously ignored,
it shows some scene pointers are invalid. Always clear them on load, and
don't keep scene permanently in the image user except for the image editor.
Otherwise the pointer can go out of date.
2019-02-19 15:40:04 +01:00
Vaishnav S
22eeae8104 Units: Fix some property subtypes
This commit only contains some of the changes in the diff.
Some require more discussion/work.

Differential Revision: https://developer.blender.org/D4337
2019-02-19 15:23:46 +01:00
Bastien Montagne
cba447966e Fix T61683: Linking the instance of a collection crashes Blender.
Do not instance linked object immediately in scene, this was never a
good idea and is doomed to fail nowadays, with complex relations between
objects, collections and scenes.

Instead, this commit refactors a bit linking code to add loose objects
to current scene *after* everything has been imported, and ID pointers
have been properly remapped to new ones - i.e. once new linked data is
supposed to be fully valid, just like we were already doing with
collections.

As a bonus, it means we do not have to pass around scene, view3d etc. to
`BLO_library_link_named_part_ex()` and co.
2019-02-19 13:49:54 +01:00
Sergey Sharybin
4df8896062 Playanim: Fix heap use after free on exit
Was caused by the wrong de-initialization order, here is
an ASAN log just in case P916.
2019-02-19 13:08:22 +01:00
Sergey Sharybin
bab2d2ba43 Fix T61594: Frame playback is blank
Viewport and scissor were never initialized prior to
window move/resize.
2019-02-19 13:01:36 +01:00
Bastien Montagne
a8bbe140fd Cleanup: remove needless comment ;) 2019-02-19 10:23:23 +01:00
Campbell Barton
eb4acd5064 Cleanup: return specific handler types 2019-02-19 16:57:36 +11:00
Campbell Barton
e617e6395b Cleanup: remove unused default handler type 2019-02-19 16:18:58 +11:00
Campbell Barton
bb6692be8a WM: move keymap handler to it's own type
Illuminate dead code, using wmEventHandler_KeymapFn from gizmo handler
type where it was never set.
2019-02-19 16:18:23 +11:00
Campbell Barton
d718338828 WM: move dropbox handler to it's own type 2019-02-19 16:17:21 +11:00
Campbell Barton
f88ea20285 WM: move operator handler to it's own type 2019-02-19 16:17:21 +11:00
Campbell Barton
eae2942474 WM: move UI handler to it's own type 2019-02-19 16:17:21 +11:00
Campbell Barton
55ac296358 WM: move gizmo handler to it's own type 2019-02-19 16:17:21 +11:00
Campbell Barton
0767b63f1b WM: move wmEventHandler.type to a boolean
Currently it's effectively a boolean for file-select handlers.

Prepare for refactoring event handlers into their own types (keymap,
operator, gizmo, ui & dropbox) to help make logic easier to follow.
2019-02-19 16:14:51 +11:00
Campbell Barton
790cb7799d Cleanup: rename parent_origin_eval to parent_display_origin
The term 'eval' is often used by depsgraph result,
where this is just used for drawing.
2019-02-19 11:38:25 +11:00
Campbell Barton
ec57d76db8 Fix edit-curve display for hidden handles
When the first handle was hidden, all others would show as hidden too.
2019-02-19 10:04:15 +11:00
Campbell Barton
53e95a982c Cleanup: remove unused Object.smoothresh 2019-02-19 09:50:00 +11:00
Campbell Barton
53b484d081 DNA: rename select_color -> select_id
The term color is misleading, it's an integer id that happens to be
written to a color in some cases, then converted back to an integer.
2019-02-19 09:45:48 +11:00
Campbell Barton
fc10e89918 DNA: rename Object.col -> color
Was confusing, unrelated to:
colbits, col_mask, col_group, actcol & totcol.
2019-02-19 08:48:15 +11:00
Bastien Montagne
ecdd1864d1 Fix (unreported) broken-by-design code in depsgraph's deg_backup_object_runtime()
Committing this since it does fix broken logic (previously in that
condition obdata would always be set to NULL, since
`BKE_object_runtime_reset()` is called before).

However, this has presumably been broken that way since 05/2018, so
maybe that whole condition is not needed anymore? Or NULL pointer was
working as well here?

@sergey eyes are required here I guess ;)
2019-02-18 18:21:44 +01:00
Bastien Montagne
16a290bb6f Fix Object bbox memleak in depsgraph code.
Caused by rBae2b677dcb5a70f5, Object.runtime has lot of weird specific
handlings in depsgraph...

For now modified `deg_backup_object_runtime()` and
`deg_restore_object_runtime()` to mimic previous behavior regarding
Object bbox (i.e. pass it around, instead of wiping it clean).

Reported in T61660.
2019-02-18 18:15:00 +01:00
Bastien Montagne
49c7b34547 Cleanup some Object's bbox code.
Now that bbox is in runtime, no need to explicitely clear it when we
call BKE_object_runtime_reset() two lines below.
2019-02-18 17:55:44 +01:00
Bastien Montagne
aed631fa47 Fix (unreported) wrong handling of some parameters combination in bpy.data.user_map()
Would add undesired keys...
2019-02-18 17:16:33 +01:00
Bastien Montagne
1414c4496c ID Management Py API: Fix (unreported) crash in some cases.
Would crash when passing some kind of invalid parameters, e.g.:

   >>>D.user_map(key_types={'brush'})
2019-02-18 17:16:33 +01:00
Bastien Montagne
b8ec2c9559 ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
Bastien Montagne
b36f78abf4 ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
Bastien Montagne
4977321c5a ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
Bastien Montagne
ff7165957f ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
Bastien Montagne
0951778eba ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
Bastien Montagne
00d2e9096f ID management: use FOREACH_MAIN_ID in some places. 2019-02-18 17:16:33 +01:00
Bastien Montagne
4c2330bd53 BKE_main: FOREACH macros: fix shadowing 'i' variable. 2019-02-18 17:16:33 +01:00
Bastien Montagne
614a0a47e5 BKE_main: make FOREACH new macros working when deleting some IDs. 2019-02-18 17:16:33 +01:00
Clément Foucault
28901820a4 Wireframe: Fix selection broken since recent wireframe refactor 2019-02-18 17:03:10 +01:00
Sergey Sharybin
f2a21472c4 Fix T61473: Crash particle system is updating
Original and localized particle settings were sharing some
of the runtime pointers.
2019-02-18 17:00:50 +01:00
Brecht Van Lommel
0e3a2acbfa Fix T57457: animated image sequences not working in Eevee.
The dependency graph now handles updating image users to point to the current
frame, and tags images to be refreshed on the GPU. The image editor user is
still updated outside of the dependency graph.

We still do not support multiple image users using a different current frame
in the same image, same as 2.7. This may require adding a GPU image texture
cache to keep memory usage under control. Things like rendering an animation
while the viewport stays fixed at the current frame works though.
2019-02-18 16:52:01 +01:00
Brecht Van Lommel
286c34b4ab Fix image filepath changes not refreshing all image users. 2019-02-18 16:38:17 +01:00
Brecht Van Lommel
a6443b5d1e Fix BKE_image_walk_all_users not including all image users. 2019-02-18 16:38:17 +01:00
Brecht Van Lommel
8f7ae20f79 Cleanup: rename tpageflag to gpuflag, make it purely runtime data. 2019-02-18 16:38:17 +01:00
mano-wii
c94b3b19a2 Fix T61373: Crash when selecting the edit mode
Some GPUs complain about `error C7011: implicit cast from "int" to "uint"` even if the cast is explicit.
2019-02-18 11:35:17 -03:00
Sergey Sharybin
abb147e609 Fix T61636: Drivers don't update on viewport using curves 2019-02-18 16:35:56 +01:00
Sergey Sharybin
582ae0c122 Fix crash toggling edit mode of curve with animation
The issue was caused by original f-curves being re-allocated
without informing dependency graph about this.

Was reported in T61636#622757
2019-02-18 16:29:04 +01:00
Sergey Sharybin
d02ad52b2d Depsgraph: Make node an owner of its name
The initial idea of using char pointer was to save some
memory since the dependency graph was kind of the one
with the main database.

Nowadays dependency graph should be separatable from the
main database and being self-sustainable.

Other issue which was caused by this pointer is the
re-tagging of operations during relations update: it is
possible to have node which as tagged for update but had
the owner of the name removed (i.e. driver or bone was
removed).
2019-02-18 16:24:51 +01:00
Sergey Sharybin
c3ceefb671 Cleanup: Remove unused field 2019-02-18 16:08:05 +01:00
Clément Foucault
11b8d8a838 DRW: Fix Crash when enabling object wireframe option 2019-02-18 16:02:27 +01:00
Clément Foucault
d62f8a3176 Overlay: Remove extra contour drawing in wireframe mode
This removes the overhead of rendering the object one more time.
2019-02-18 16:02:27 +01:00
Bastien Montagne
5d58b7f073 Fix T61660: Wrong user counter on curves with shared material.
Patch by @sergey.

Note that this is really a bad thing actually, ideally we should never
get that situation (IDs in Main referencing temp IDs outside of it).
That can lead to many possible similar cases...

Fixing that is not trivial though, so for now we'll have to live with
it, until we have migrated *all* of our temp datablocks generation
outside of Main's.
2019-02-18 15:27:29 +01:00
Bastien Montagne
2c12c9b61e ID management: forbid refcount of used IDs when user ID is outside of Main.
This is related to T61660, but actually does not fix that specific issue
(which is even worse - outside-of-Main ID using inside-of-Main IDs... yuck).
2019-02-18 15:27:29 +01:00
Jacques Lucke
a0d0d37ecd Fix T61666: missing NULL_UNIT that stops iteration over units 2019-02-18 14:25:34 +01:00