Commit Graph

78 Commits

Author SHA1 Message Date
Sergey Sharybin d13a53e71d Return truth when animation fix changed animation
This can be used to inform higher level modules that animation
is changed and that dependency graph likely requires relations
update now.
2018-11-23 17:03:14 +01:00
Campbell Barton 55e719ec35 Merge branch 'master' into blender2.8 2018-11-14 17:21:34 +11:00
Campbell Barton d7f55c4ff5 Cleanup: comment block tabs 2018-11-14 17:10:56 +11:00
Alexander Gavrilov 3b9700aa51 Remove AnimMapper: it has been left unimplemented for almost ten years.
It was supposed to be a feature for substituting RNA paths on the
fly, but has never been implemented, apart from a couple of structure
definitions and passing around some always-NULL pointers. Now it gets
in the way of refactoring NLA evaluation to use GHash for efficiency.
2018-11-12 19:36:31 +03:00
Bastien Montagne 4779165ca1 Fix dpesgraph wrongly refcounting NLA strip actions when duplicating IDs.
NLA strips are users of their action, so we need to pass along ID
management flags.

This commit also cleans up a bit things by passing along ID_CREATE/COPY
flags instead of dummy booleans...
2018-11-07 20:58:53 +01:00
Clément Foucault 8cd7828792 GWN: Port to GPU module: Replace GWN prefix by GPU 2018-07-18 11:49:15 +02:00
Campbell Barton 06a1a66a9b Merge branch 'master' into blender2.8 2018-06-17 17:10:19 +02:00
Campbell Barton 6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
Bastien Montagne c98b2e74df Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/object/object_add.c
	source/blender/editors/object/object_relations.c
2018-06-12 12:38:54 +02:00
Bastien Montagne 5508b572ea Cleanup: remove some G.main from ED's animsys.
The easy ones - there some much, much trickier to tackle there...
2018-06-12 12:28:14 +02:00
Campbell Barton bfe1d0e0dc Merge branch 'master' into blender2.8 2018-06-01 18:26:42 +02:00
Campbell Barton 75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
Sergey Sharybin cd702db338 Animation: Pass dependency graph to animation system
This way we allow animation system to make decisions based on which
context dependency graph is coming from, and whether it belongs to
an active edit window or not.
2018-05-31 18:07:55 +02:00
Brecht Van Lommel e4afccf388 Depsgraph: optimization of driver evaluation with many drivers. 2018-05-31 09:46:21 +02:00
Brecht Van Lommel 7c5e174871 Fix T55160: crash renaming view layer. 2018-05-23 13:52:51 +02:00
Sergey Sharybin e52dce6408 Animation: Don't user-copunter copy-on-written action block 2018-05-01 09:17:17 +02:00
Brecht Van Lommel 34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
Antonio Vazquez 272973804e Merge branch 'master' into blender2.8 2017-12-05 19:04:34 +01:00
Sergey Sharybin 3959ce0540 Types are to have explicit forward declaration 2017-12-05 16:54:39 +01:00
Campbell Barton 702c0a01b2 Cleanup: build warning 2017-12-06 02:25:10 +11:00
Germano 6734bb1faf Merge branch 'master' into blender2.8
# Conflicts:
#	source/blender/editors/mesh/editmesh_select.c
2017-12-05 11:19:47 -02:00
Joshua Leung 6ebf244ace Added BKE_fcurves_main_cb(), a wrapper around BKE_animdata_main_cb to make it easier to apply fixes to all F-Curves in a file 2017-12-05 17:16:05 +13:00
Campbell Barton 1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
Bastien Montagne 41830cc432 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 20:34:36 +02:00
Bastien Montagne 9da7dfa158 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
Campbell Barton b4d053efc7 Gawain API naming refactor
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
2017-06-19 20:18:04 +10:00
Bastien Montagne e0bc5b533c Cleanup: get rid of some now unused animdata ID management custom functions.
That's the kind of commit that are nice to do - getting rid of
half-working custom pieces of code, now that we have generic tools
to do same thing. ;)
2017-06-09 16:30:59 +02:00
Bastien Montagne df63195d2a Cleanup id->newid usage, initial work.
This aims at always ensuring that ID.newid (and relevant LIB_TAG_NEW)
stay in clean (i.e. cleared) state by default.

To achieve this, instead of clearing after all id copy call (would be
horribly noisy, and bad for performances), we try to completely remove
the setting of id->newid by default when copying a new ID.

This implies that areas actually needing that info (mainly, object editing
area (make single user...) and make local area) have to ensure they set
it themselves as needed.

This is far from simple change, many complex code paths to consider, so
will need some serious testing. :/
2016-11-30 15:27:59 +01:00
Campbell Barton 4e845e0670 Py-Driver: add 'self' option
Drivers can use this to refer to the data which the driver is applied to,
useful for objects, bones, to avoid having to create a variable pointing to its self.
2016-07-30 16:46:13 +10:00
Bastien Montagne b651812721 Cleanup/fix animsys 'id_type_can_have_animdata()'.
This func now actually takes an ID type as argument, added new 'id_can_have_animdata()'
to check whether a datablock may be animated or not.
2016-07-07 21:21:33 +02:00
Bastien Montagne 897e97f078 ID-Remap - Step one: core work (cleanup and rework of generic ID datablock 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-22 17:53:50 +02:00
Campbell Barton c6cc599311 Fix T48234: Glitch w/ action constraints sharing an action
FCurve evaluation depended on FCurve.curval, which isn't threadsafe.
Now only use this value for debug display,
and pass the value instead of storing in the FCurve for all but debug-display.
2016-06-04 00:57:44 +10:00
Sergey Sharybin a09341469e Depsgraph: Add evaluation callbacks for granular nodes update
This commit only adds callbacks which then later be used with major dependency
graph commit, keeping the upcoming commit more clean to follow.

Should be no functional changes so far still.
2015-05-12 16:06:37 +05:00
Campbell Barton 1c96a84320 Cleanup: use BKE_animdata_* prefix 2015-04-04 15:13:56 +11:00
Joshua Leung a730cda72f Fix: Joining armatures fixes up the drivers accordingly
Finally! At long last, I've gotten this working! This ended up being far trickier
to get right than anticipated; the normal remapping API's cannot be used as-is
as they will just clobber over subtleties whenever datablock changes are involved.
So, for now, we have to duplicate the logic a bit.
2015-01-23 02:33:32 +13:00
Joshua Leung 3df93d063e Fix: Joining armatures loses drivers
Currently, when joining two armatures, the drivers of the armatures being merged
in are lost. This commit introduces a new AnimData API function for merging
animation data into another AnimData block.

NOTE:
* For now, this only copies the drivers over. As a result, manual effort will
  still be needed to go through and fix the drivers.

  I am working on automating that process, but it's more important that the
  drivers don't have to be created from scratch for now (since this is needed
  for the Goosberry rigging work).
2015-01-22 02:09:16 +13:00
Campbell Barton 133f79e449 Cleanup: warnings, typos 2014-10-29 14:15:21 +01:00
Bastien Montagne 8cb1b35bee Fix T40350: Some texture prop did not have visual feedback they were driven.
This is only a (hacky) partial fix, actually, since `RNA_property_animated()` will still
not work in those cases... Better that than nothing, though.

Thanks to Campbell for review.
2014-10-06 17:08:24 +02:00
Campbell Barton a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
Joshua Leung df553892c9 Bugfix: Renaming bones now renames the corresponding F-Curves in actions used by
Action Constraints
2013-10-22 11:36:48 +00:00
Dalai Felinto d2e55cb282 bugfix [#32346] Node animation, removing nodes keeps FCurves.
The same bug happens for modifiers, but better to address it separately.
Contribution and review by Lukas Toenne and Brecht van Lommel
2013-10-01 16:15:52 +00:00
Campbell Barton 7d585ed475 patch [#34103] check_for_dupid.patch
from Lawrence D'Oliveiro (ldo)

- more comments
- more uses of bool type
- define symbol for length of in_use array in check_for_dupid
2013-03-10 05:46:24 +00:00
Bastien Montagne 55c210b57e Fix [#30709] Renaming a bone renames all drivers' targets using a bone of that name, regardless of the armature.
This fix adds a "ref_id" ID pointer to BKE_all_animdata_fix_paths_rename() & co, which is the ID against which prefix+oldName/NewName is "applied", currently only used for drivers' bones targets. Just pass NULL to get same behavior as previously. A bit annoying to make such a change for such a specific case, but there seems to be no other way to go... :/
2012-03-30 13:04:29 +00:00
Bastien Montagne a80b7d6129 Fixing several issues with keyingsets:
*Add a new idname to keyingsets, keeping name as label-only (using same string for both made lookup fail when using i18n other than english, as it tried to compare an untranslated static string id against a translated RNA name). Also adding a description string (can be helpful with custom keyingsets, imho).
*Fixed a few other bugs related to that area (namely, you can’t deselect current keyingset from the shift-ctrl-alt-I popup menu, and insert/delete key ops were using a rather strange way to get chosen custom keyingset…).
*Fixed UI code so that it always uses (RNA) enum, and simplified menu-creation code.
2012-03-08 14:04:06 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton 33accdb725 use (const char*) rather than (char*) where possible.
also removed some unused function definitons.
2011-11-05 11:04:28 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton 61389bba41 fix spelling mistakes in comments (and in some python error messages), nothing to effect translations. 2011-10-17 06:39:13 +00:00
Campbell Barton 54adf3de62 fix bad svn ID tags 2011-10-10 09:44:14 +00:00
Campbell Barton bc40f11093 header cleanup (no functional changes) 2011-10-10 09:38:02 +00:00