Age | Commit message (Collapse) | Author |
|
|
|
|
|
This commit:
* Fixes bad handling of 'stop iteration' (by adding a status flag, so that we can actually
stop in helper functions too, and jumping to a finalize label instead of raw return, to
allow propper clean up).
* Adds optional recursion into 'ID tree' - callback can also decide to exclude current id_pp
from recursion. Note that this implies 'readonly', modifying IDs while recursing is not
something we want to support!
* Changes callback signature/expected behavior: return behavior is now handled through flags,
and 'parent' ID of id_pp is also passed (since it may not always be root id anymore).
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1869
|
|
|
|
increase 'real' user count.
This has several benefits:
* User count remains coherent, regardless of the order in which you use 'user_one' & real refcounting users
(i.e. if you add to group, and then link in scene, or the reverse, you now always get same final user count).
* Avoids the need to check for potential 'user_one' extra user in count in several places in code (e.g. when
making IDs single users...).
* Users won't wonder why they cannot make 'single user' and ID even though its user count shows '2'!
* readfile.c now always uses code from BKE's library.c when modifying id->us. Which means we can consider
(asside from assignment during initialization) that id->us is read-only outside of library.c context.
Note that this commit reverts previous one (rB6b1d77a8052b) - please **do not** backport this one in 2.77.
|
|
object.
Also re-reported through IRC by Thomas Beck (@plasmasolutions), thanks.
Though it's not ideal in theory, we have quite poor handling of object datablock currently
from user PoV - before this commit, it was not easily possible to get fully rid of an object
anymore if you did not removed it from all its groups before deleting it.
So for now, restore 2.76 behavior (namely, unlink an object from avaerything in Blender
once it is no more used by any scene).
Better handling of all this is TODO for later (also related to much more heavy changes
done in id-remap branch regarding sanitizing our ID deletion process).
|
|
decrementing usercount.
Ended up not handling at all 'userone' case, now it increments usercount correctly when needed.
|
|
BKE_main_id_tag_/BKE_main_id_flag_ were horrible naming now that we split those
into flags (for presistent one) and tags (for runtime ones).
Got rid of previous 'tag_' functions behavior (those who were dedicated shortcuts
to set/clear LIB_TAG_DOIT), so now '_tag_' functions affect tags, and '_flag_'
functions affect flags.
|
|
|
|
This fake tag is zero, so it does not set anything - and it does not clear
indirect/extern ones either...
|
|
reopening project.
Code 'localizing' the node of an ID (a material, here) was kind of a joke,
setting id.lib to NULL is not enough, by far! Now calling ntreeMakeLocal().
And ntreeMakeLocal was also missing indirect->extern switch for its directly used IDs,
which explains why they were lost after a save/reload.
Note that here again, a big part of this 'localizing' code should be made generic
using library_query stuff, but this is for id-remap, not current master...
|
|
Note that this has little impact on current master - yet it allows to fix the 'Image Editor' bug
(open image in editor, use same image in texture, delete image from texture, image us is 0 and
red in image editor...) and probably a few other similar cases.
But that change is mandatory to get a proper handling of ID deletion/reamapping/reloading/etc. as done in id-remap branch.
Instead of just adding a user if none already present, new code use two new ID tags to get a three-states status:
- Normal: nothing changes.
- Needs extra user: we know that ID needs an extra user, so we take of never going down to 0 in 'real' usercount handling.
- Has extra user: we do have increased that ID usercount to get our needed extrauser.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1696
|
|
|
|
each newly appended item except Groups and Objects.
|
|
- test_idbutton -> BLI_libblock_ensure_unique_name (not only used from UI)
- BKE_rename_id -> BKE_libblock_rename (always pass valid main)
also rename:
- name_uiprefix_id -> BKE_id_uiprefix
|
|
* Don't copy name before entering new_id function. new_id does that for
us already.
* Take a main argument to make the function possible to use with
different databases
* Append BKE_ to rename_id
|
|
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
|
|
|
|
We have currently a gooseberry file (scenes/01_island/01_meet_franck/01_01_01_A/01_01_01_A.anim.blend)
that links against two -pre repo libs, which are hence not available for common mortals,
and generate warnings and placeholders during load step.
Issue is, among those missing (directly) linked datablocks, we have two shapekeys!
This should never happen nor be possible at all. I tried understanding how this could happen,
with no luck at all, best bet would be some wild/bad call to `id_us_plus()` over those skeys
at some point...
Anyway, this commit:
- Handles a bit better those 'cases that should never happen' at load time.
- Adds several checks in ID handling code (and save/load code) to try to detect where/when
a non-linkable datablock becomes LIB_EXTERN (i.e. directly linked).
|
|
|
|
|
|
expected.
|
|
|
|
Since it also involves usercount manipulation, safer and cleaner to do it in BKE_library...
|
|
|
|
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
|
|
|
|
Unused since 2.4x and unlikely to be reintroduced as ID-types.
|
|
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.
That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.
Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.
Future plans are also to be able to relocate missing libs and reload them at runtime.
Code notes:
- Placeholder ID is just a regular datablock of same type as expected linked one,
with 'default' data, and a LIB_MISSING bitflag set.
- To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
+ Allocation of memory itself.
+ Setting of all internal data to default values.
See also the design task (T43351).
Reviewed by @campbellbarton, thanks a bunch!
Differential Revision: https://developer.blender.org/D1394
|
|
Duplicate wasn't updating links,
so duplicatinvg a objects would still point to the originals for curve-taper, texmesh, drivers.
Use generic id-looper to handle replacing data.
|
|
BKE_main_free() code.
|
|
them when reading in background mode.
Primary goal of this commit is to fix an annoying issue - when processing and saving .blend
files in background mode you lose their thumbnails, since it can only be generated with
an OpenGL context.
Solution to that is to read .blend thumbnail while reading .blend file (only done in background
mode currently), and store it in Main struct.
Also, this lead to removing .blend file reading code from thumb_blend (no need to have doublons).
We now have a small interface in regular reading code area, which keeps it reasonbaly light
by only reading/parsing header info, and first few BHead blocks.
This makes code reading .blend thumbnail about 3 to 4 times slower than previous highly specialized
one in blend_thumb.c, but overall thumbnail generation of a big .blend files folder only grows
of about 1%, think we can bare with it.
Finally, since thumbnail is now optionally stored in Main struct, it makes it easy to allow user
to define their own custom one (instead of auto-generated one). RNA API for this was not added though,
accessing that kind of .blend meta-data has to be rethought a bit on a bigger level first.
Reviewers: sergey, campbellbarton
Subscribers: Severin, psy-fi
Differential Revision: https://developer.blender.org/D1469
|
|
- Add blentranslation `BLT_*` module.
- moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`).
- moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
|
|
|
|
|
|
The issue was caused because of the following circumstances:
- Making All Local will just iterate all IDs and clear linked flags
- It will not do anything with objects which are already local (and
since proxy rig is local nothing will be changing it).
This commit makes it so id_clear_lib_data() takes care of clearing
all related proxy pointers, avoiding situations when proxy rig will
point to a local armature.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1276
|
|
|
|
|
|
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:
- More granular dependency relation nature, which solves issues with fake cycles
in the dependencies.
- Move towards all-animatable, by better integration of drivers into the system.
- Lay down some basis for upcoming copy-on-write, overrides and so on.
The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.
It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.
There are number of assorted documents related on the design of the new system:
* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph
There are also some user-related information online:
* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/
Kudos to everyone who was involved into the project:
- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
|
|
|
|
Assumed the `reference` pointer is an ID, currently true, but may not always be.
Add a callback specifically for this purpose since cleaning up notifiers and space-types are different operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
|
|
paths in new copies.
Simply have to rebase onto main filepath when copying, if source datablock is lib and path is relative.
Afaict, only affected Image and Text datablocks. MovieClip would also be a candidate, but has
no copy implemented currently.
|