Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-12-12Cleanup: use colon separator after parameterCampbell Barton
Helps separate variable names from descriptive text. Was already used in some parts of the code, double space and dashes were used elsewhere.
2018-11-30Cleanup: ensure '_END' macros end with a semicolonCampbell Barton
Missing these breaks auto-indent for editors that don't expand macros.
2018-11-30Cleanup: name macros w/ matching BEGIN/ENDCampbell Barton
2018-03-20Fix missing ID pointer handling in materials in ID remapping code.Bastien Montagne
2018-02-07Cleanup: add _types.h suffix to DNA headersCampbell Barton
2018-01-08Fix T53713: User remap failed w/ texface imagesCampbell Barton
2017-11-06Rename ID_IS_LINKED_DATABLOCK to ID_IS_LINKED.Bastien Montagne
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.
2017-11-05Cleanup: spellingCampbell Barton
2017-06-26Fix T51902: Severe problem with relocating linked libraries when using proxies.Bastien Montagne
Fix is a bit ugly, but cannot think of another solution for now, at least this **should** not break anything else. And now I go find myself a very remote, high and lonely mountain, climb to its top, roar "I hate proxies!" a few times, and relax hearing the echos...
2017-05-05Add a new LOOPBACK flag to libquery's callbacks.Bastien Montagne
That one tags those ugly little 'from' ID pointers (shape keys and proxies), which point back from used to user ID, and require a lot of special care in data-block management...
2017-04-24Cleanup: styleCampbell Barton
2017-04-19Fix (unreported) missing handling of GPencil Layer's parent Object pointer ↵Bastien Montagne
in BKE_library_query. Grrrr... still finding missing pointers here... :/
2017-04-13Datablock ID PropertiesAlexander Romanov
The absence of datablock properties "will certainly be resolved soon as the need for them is becoming obvious" said the [[http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes|Python Nodes release notes]]. So this patch allows Python scripts to create ID Properties which reference datablocks. This functionality is implemented for `PointerProperty` and now such properties can be created with Python. In addition to the standard update callback, `PointerProperty` can have a `poll` callback (standard RNA) which is useful for search menus. For details see the test included in this patch. Original author: @artfunkel Alexander (Blend4Web Team) Reviewers: brecht, artfunkel, mont29, campbellbarton Reviewed By: mont29, campbellbarton Subscribers: jta, sergey, campbellbarton, wisaac, poseidon4o, mont29, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov, fjuhec, sharlybg, cardboard, duarteframos, blueprintrandom, a.romanov, BYOB, disnel, aditiapratama, bliblubli, dfelinto, lukastoenne Maniphest Tasks: T37754 Differential Revision: https://developer.blender.org/D113
2017-01-31Cleanup: use 'cb_flag', not 'cd_flag' for library_query callbacks.Bastien Montagne
`cd_flag` tends to be used for CustomData flags in mesh area, while for library_query those are rather callback flags...
2017-01-31Cleanup: Rename callback flags from library_query to `IDWALK_CB_...`Bastien Montagne
Better to have clear way to tell whether flag is parameter for BKE_library_foreach_ID_link(), parameter for its callback function, or return value from this callback function.
2017-01-31Optimization: pass Main to BKE_library_foreach_ID_link() and use its relations.Bastien Montagne
Use Main->relations in BKE_library_foreach_ID_link(), when possible (i.e. IDWALK_READONLY is set), and if the data is available of course. This is quite minor optimization, no sensible improvements are expected, but does not hurt either to avoid potentially tens of looping over e.g. objects constraints and modifiers, or heap of drivers...
2017-01-31Fix missing non-ID nodetrees in ID relationships built from library_query.cBastien Montagne
This shall fix both existing code (bpy mapping, and local/lib usages checks), and new Main->relations generation.
2016-11-12Minor naming cleanup.Bastien Montagne
2016-11-12Enhance BKE_library_make_local() to make it much quicker in complex cases.Bastien Montagne
Basic idea is to split first loop in two, and run checks before making anything actually local, to detect data-blocks that we can directly make local (because we are sure they are only used by already/future local datablocks). This allows to avoid a lot of overhead in later 'cleanup' steps of this function, here with barbershop shot it's four times quicker (from 190s to 48s). We are still far from the instantaneous results of MakeLocal in 2.77, but in that version main characters lose their connection to their armature and remain static after makelocal, so guess new code is still better. ;) There are probably more optimizations possible here, but would rather polish this area of code once we get rid of proxies, those really make it a nightmare to work on.
2016-11-12Minor optimization to BKE_library_tag_unused_linked_data().Bastien Montagne
2016-10-19Fix T49775: Appending data with internal dependency cycles prevents correct ↵Bastien Montagne
clearing of linked data-blocks. This is not a simple fix, but imho still needs to be backported to 2.78a...
2016-10-07Datablock management: remove 'proxy_from' pointer from 'is ID used' checks.Bastien Montagne
Pretty much same reason as for the 'from' pointer of shapekeys - runtime data creating loops and 'ghost' dependencies between datablocks. We need to handle them in cases like remapping, but whall not take them into account to check dependencies between datablocks... :/
2016-10-04Fix T49553: Blender 2.78 crashes when File->Data Previews ->Refresh ↵Bastien Montagne
Datablock Previews New recursive iteration over IDs in BKE_library_foreach_ID_link() was broken by the infamous nodetree case. We cannot really recusively call this function in that case, so better to deffer handling of non-datablock NodeTrees as if real IDs here. Also fixed initial ID not being stored as handled, in rare cases this could also lead to infinite looping. To be backported to 2.78a.
2016-09-30Fix T49489: Pose marker in camera action + marker bound to camera -> crash.Bastien Montagne
'camera' Object pointer of TimeMarkers is a 'temp' hack since Durian project... Would need to be either made definitive now, or removed/reworked/whatever. But since we intend to use that object pointer for other needs, and current code could lead to crashing .blend files, for now let's fix that mess (was missing some bits in read code, and also totally ignored in libquery code). Should be safe for 2.78a.
2016-09-22Fix T49427: Drivers of Shapekeys break when Append a group.Bastien Montagne
Optimization attempt with BKE_library_idtype_can_use_idtype() was not taking into account the fact that drivers may link virtually against any datablock... Has to be rethinked, but for after 2.78 release, this commit is safe to backport.
2016-08-06Cleanup: add missing ID types to BKE_library_idtype_can_use_idtype().Bastien Montagne
2016-08-06Basic Alembic supportKévin Dietrich
All in all, this patch adds an Alembic importer, an Alembic exporter, and a new CacheFile data block which, for now, wraps around an Alembic archive. This data block is made available through a new modifier ("Mesh Sequence Cache") as well as a new constraint ("Transform Cache") to somewhat properly support respectively geometric and transformation data streaming from alembic caches. A more in-depth documentation is to be found on the wiki, as well as a guide to compile alembic: https://wiki.blender.org/index.php/ User:Kevindietrich/AlembicBasicIo. Many thanks to everyone involved in this little project, and huge shout out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the custom builds and compile fixes. Reviewers: sergey, campbellbarton, mont29 Reviewed By: sergey, campbellbarton, mont29 Differential Revision: https://developer.blender.org/D2060
2016-08-05Cleanup: add missing entries to library_query.c ID types switch case.Bastien Montagne
2016-07-31Support limiting collisions by group for softbody and particlesAlexander Gavrilov
This feature is extremely useful for layering multiple cloth objects, and there is no reason there shouldn't be the same kind of feature for softbody.
2016-07-29Fix T48971: Append creates linked image textures if object has shape keys.Bastien Montagne
Hating all those not-so-real ID types... Here there were two causes for the issue: 1) Linked shapekey ID was made local twice (once from mesh's make local, once by itself). Solved by not explicitely making shapekeys (nor any other non-linkable datatype) local. 2) Key->from 'back pointer' to its owner was messing 'still in used' detection of linked data after localization. Fixed with a hack for now, thinking correct solution might actually be to not consider this pointer at all in libquery ID looper, since it's nothing like and actual usage of mesh/lattice/curve. Again, shapekeys as ID is a joke, those should be mere struct, they have absolutely nothing to do in Main, period. :( Point 2) still demonstrates the need for better handling of IDs dependencies though, so far we only hit corner cases, but think there could also be valid cases generating those 'dependency cycles' between IDs (ID a using ID b which uses ID a), this will have to be addressed some day...
2016-07-26Fix issues in ID usages checks - we are not interested in self-usages here.Bastien Montagne
Drivers or constraints referencing self object could break deletion of proxy objects (due to their ambiguous, half-local, half-linked status).
2016-07-22Fix broken proxy object deletion.Bastien Montagne
Check to ensure we do not delete last instancing of an indirectly used object (forbidden because it creates 'ghost' objects user have no real way to re-instance) was defeated by the backward pointer 'proxy_from', which generated a 'false' indirect usage of (local) proxy object itself (the one we are trying to delete). Fixed by actually considering that ID usage as local if proxy object itself is local (because that pointer actually does not 'pertain' to the object holding it, but to its proxy). Yeah, it's... complicated, twisted and ugly - it's proxy.
2016-07-19Cleanup: style, spellingCampbell Barton
2016-07-08Initial fix for proxy issues regarding new libquery/libremap ID handling code.Bastien Montagne
libquery now passes an extra flag info to the callback, in case that specific ID usage is considered as indirect. In most cases, it's just set from ID_IS_LINKED_DATABLOCK() result on datablock owner, but in proxy object case we also consider ob->data, materials and pose usages as indirect. Does not fixes all issues yet, but should already make behavior with proxy object saner.
2016-07-08Fix own very stupid mistake in BKE_library_idtype_can_use_idtype() usage ↵Bastien Montagne
(inverted arguments).
2016-07-08Libquery: fix missing image pointers from Mesh's UV layers.Bastien Montagne
Not really happy with this, could lead to a **lot** of callback executions... But libquery foreach looper must go over **all** ID pointers, otherwise remapping & co is broken! A possible fix for future would be to have 'image slots' defined at root of poly/facetex layers, and just a (short) index in each face/poly item - would also save a reasonable amount of memory...
2016-07-07Make use of new 'idtype can use idtype' check (in ID usages code, and ID ↵Bastien Montagne
remapping one too). Reduces calls to BKE_library_foreach_ID_link() from 312 to 105 when relocating a library in a rather simple lib reload test...
2016-07-07libquery: add new 'BKE_library_idtype_can_use_idtype()' helper.Bastien Montagne
This should allow us to avoid a lot of useless processing when iterating over the whole main database (unlink/remap/usages checks/etc.). Note that some ID types report they can use any type for now, due to fuzzyness/indefined nature of some usages (like constraints/modifiers/game logic, or ID pointer of nodes...). Maybe we could address this (like e.g. adding defines in relevant headers to restrict ID types used by constraints, by modifiers, etc.). But don’t think this is top priority for now.
2016-07-07Extend libquery checks to test wether an ID is used locally and/or indirectly.Bastien Montagne
2016-07-07Cleanup: spelling, styleCampbell Barton
2016-07-06Replace of (id->lib != NULL) check by meaningful macro.Bastien Montagne
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
2016-07-01"Fix" crash when deleting linked object which has indirect usages.Bastien Montagne
This is in fact very hairy situation here... Objects are only refcounted by scenes, any other usage is 'free', which means once all object instanciations are gone Blender considers it can delete it. There is a trap here though: indirect usages. Typically, we should never modify linked data (because it is essencially useless, changes would be ignored and ost on next reload or even undo/redo). This means indirect usages are not affected by default 'safe' remapping/unlinking. For unlinking preceeding deletion however, this is not acceptable - we are likely to end with a zero-user ID (aka deletable one) which is still actually used by other linked data. Solution choosen here is double: I) From 'user-space' (i.e. outliner, operators...), we check for cases where deleting datablocks should not be allowed (indirect data or indirectly used data), and abort (with report) if needed. II) From 'lower' level (BKE_library_remap and RNA), we also unlink from linked data, which makes actual deletion possible and safe. Note that with previous behavior (2.77 one), linked object would be deleted, including from linked data - but then, once file is saved and reloaded, indirect usage would link back the deleted object, without any instanciation in scene, which made it somehow virtual and unreachable... With new behavior, this is no more possible, but on the other hand it means that in situations of dependency cycles (two linked objects using each other), linked objects become impossible to delete (from user space). Not sure what's best here, behavior with those corner cases of library linking is very poorly defined... :(
2016-06-22ID-Remap - Step one: core work (cleanup and rework of generic ID datablock ↵Bastien Montagne
handling). This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock was pretty much impossible, except for a few special cases. Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite a few ID usages were missed or wrongly handled that way). One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling by using library_query utils to allow generic handling of those, which is now the case (now, generic ID links handling is only "knwon" from readfile.c and library_query.c). This commit also adds backends to allow live replacement and deletion of datablocks in Blender (so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one, or NULL one in case of unlinking). This will allow nice new features, like ability to easily reload or relocate libraries, real immediate deletion of datablocks in blender, replacement of one datablock by another, etc. Some of those are for next commits. A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core. Though it was tested rather deeply, being totally impossible to check all possible ID usage cases, it's likely there are some remaining issues and bugs in new code... Please report them! ;) Review task: D2027 (https://developer.blender.org/D2027). Reviewed by campbellbarton, thanks a bunch.
2016-06-16Fix/cleanup BKE libquery's ID looper.Bastien Montagne
Some area were still not in sync with readfile.c, now should be better. Note that readfile.c has been used as référence here re us refcounting, not sure how accurate it is, time will say :|
2016-03-30libquery foreach looper: in recursive case, do not bother with NULL id pointers!Bastien Montagne
2016-03-26Fix own regression in rBc08924bf94f2dff - foreach ID looper was broken due ↵Bastien Montagne
to missing initialization. Quite unbelievable this could slip in... tons of shame on me :/
2016-03-24Rework library_query foreach looper - add optional recursivity.Bastien Montagne
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
2016-01-17Cleanup: spellingCampbell Barton
Also use doxy formatting for warning/note.
2016-01-16Fix (unreported) missing scene->gm.dome.warptext in libquery looper.Bastien Montagne
2016-01-06'users of ID' py API.Bastien Montagne
This mainly adds bpy.data.user_map() method, which goes over the whole Main database to build a mapping (dict) {ID: {users_of_that_ID}}. Very handy to check and debug ID usages, but could also be really valuable for py addons creating temporary scenes, or some exporters, etc. Note: current code in master's libquery misses some IDs (and reports some it should not, like nodetrees), this is fixed in id-remap but still needs serious review before going to master. This basically means that current bpy.data.user_map() **will not** report a complete and exhaustive state of dependencies between IDs. Should work OK in most cases though. Original work/idea comes from id-remap branch, was heavily reworked by @campbellbarton and myself for master. Reviewers: campbellbarton, sergey Differential Revision: https://developer.blender.org/D1678