Commit Graph

268 Commits

Author SHA1 Message Date
78918995a4 Replace inefficient use of strstr with STRPREFIX macro 2014-05-10 09:29:35 +10:00
31849cafc2 Fix for random crashes when grabbing (rmb-drag) NLA strips
Although these crashes were quite sporadic, they seemed to happen most when
rmb-dragging strips randomly in quick succession. The most likely cause seems
to be a null check I accidentally took out during one of my commits yesterday.
2014-05-10 00:19:07 +12:00
56df85b227 Bugfix T40082: NLA Meta strips were no longer evaluating correctly
It seems that since the changes to how new NLA strips are handled, accumulating
these in a temporary buffer and then trying to combine the results didn't
work that great anymore.
2014-05-08 21:01:32 +12:00
182179a44b Cleanup: redundant NULL checks 2014-05-07 04:35:55 +10:00
91f90f61d3 NLA Eval Bugfix: Influence settings on active action didn't work
* The automatically calculated influence was overriding the value we were passing
  into the dummy strip, making this seem like it doesn't work

* Made some tweaks to prevent some potential memory-related bugs
   - nlastrips_ctime_get_strip() actually saves off references to the list of strips
     it gets, so declaring dummy_strip in an inner scope like this could potentially
     be quite dangerous
   - Prevented a potential memory leak for the early abort when there are no strips
     for whatever reason (it shouldn't occur though)
2014-05-04 16:35:12 +12:00
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
ea01b24bba Fix T39623: deleting an object crashes 2014-04-07 20:25:52 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
53b03eff96 Fix T36496: unwanted behavior with NLA strip blend mode Replace.
If you have two overlapping NLA strips it automatically blends between them.
However it was also blending between the first strip and the rest pose
(e.g. 0,0,0 for locations and 1,1,1 for scale).

This is ok if the blend mode is Add or Multiply since then you are adding onto
the rest pose, but for Replace you want to be able to mix between two poses
and not take the rest pose into account at all.

What this does is that to not do any blending for the first strip if it has
blend mode Replace. If someone wants the old behavior (from bugfix commit
27d792fa9c) they can still make an action with the rest pose and use that
as the first strip.
2014-03-03 16:34:10 +01:00
b7fa08f88a Code cleanup: style 2014-02-22 11:14:15 +11:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
2aeb49204d Fix T38306: dupliframes causing viewport render to continually restart.
Evaluating the animation is causing the object to get tagged as changed, but in
this case it's not a permanent change so no one should be notified. Also found
a case where the persistent ID for duplis wasn't unique, fixed that as well.
2014-01-21 21:03:49 +01:00
fe00175c35 Fix crash happening in Cycles fcurve modifier
Summary:
Crash was happening because of fcurve modifier stack
used modifier's DNA to store temporary data.

Now made it so storage for such a thing is being
allocated locally per object update so multiple objects
which shares the same animation wouldn't run into
threading conflict anymore.

This storage might be a part of EvaluationContext,
but that'd mean passing this context all over in
object_where_is which will clutter API for now without
actual benefit for this.

Optimization notes: storage is only being allocated
if there're Cycles modifier in the stack, so there're
no extra allocations happening in all other cases.

To make code a bit less cluttered with this storage
passing all over the place added extra callbacks to
the FModifier storage which runs evaluation with the
given storage.

Reviewers: brecht, campbellbarton, aligorith

CC: plasmasolutions

Differential Revision: https://developer.blender.org/D147
2014-01-01 22:32:48 +06:00
8cf39603f7 replace IS_EQ -> IS_EQF for use with floats. 2013-11-10 12:56:50 +00:00
2cfe64cd10 Correcting a few typos 2013-11-05 10:57:52 +00:00
5c0a8ca73f Quick test commit - fixing what looks like a typo in a comment 2013-11-02 13:08:48 +00:00
df553892c9 Bugfix: Renaming bones now renames the corresponding F-Curves in actions used by
Action Constraints
2013-10-22 11:36:48 +00:00
4627f9d92c style edits and use macro for prefix check 2013-10-01 16:40:11 +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
abb37f4152 replace RNA_property_array_length with RNA_property_array_check where the length of the array is only used to check if the property is an array or not.
(this isnt reliable since arrays can be zero length).
2013-09-16 01:35:52 +00:00
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
64bc3ce89a Bugfix [#35856] Bones gets scaled chaotically when during NLA Strip Blend In/Out
This was one of the consequences of r.57333 (i.e. influence shouldn't be ignored
on the first strip that animates a channel), as scale should really default to a
base value of 1 (instead of things being blended against 0 as per all other
properties). The end result was that bones were getting scaled to zero here when
the influence of their strip fell to zero.

Now, we use the RNA default values of properties to initialise their initial
values. This may/may not work well in all cases:
1) For properties which don't have the appropriate RNA defaults set, this will
be problematic. But, most properties people are likely to animate here I think
are already set up correctly.
2) It may not always be nice to have values "snapping back" to default values.
In this case, you should still be defining a strip at the bottom of your NLA
stack which defines what the appropriate rest poses *should* be for your shot.
2013-07-01 13:57:00 +00:00
c5ba912a3d Bugfix [#35382] NLA "Multiply" Blend Mode calculated incorrectly
The "Multiply" blending mode for NLA strips worked incorrectly. Instead of
modulating the influence of the current strip, it was in fact scaling the result
of the entire stack (with the strip applied). This caused problems when
influence = 0, as it was in fact muting everything instead of just controlling
the strip we are interested in.
2013-06-10 11:58:57 +00:00
252e7431f6 Made blender compilable with strict flags again.
Maybe Joshua would want to check on arguments for nlaevalchan_verify.
2013-06-10 09:45:55 +00:00
27d792fa9c Bugfixes [#35263], [#35382] NLA Animated Influence is ignored if strips below
have zero total influence

Previously, when evaluating the NLA stack at a particular point in time, if a
channel hadn't been encountered before, influence values were simply ignored
when accumulating the values contributed by each strip to the overall stack.

This behaviour simplified the handling of the problem of what "baseline" to
blend relative to (i.e. influence basically scales the magnitude of a scalar
around 0, but we may not exactly want a property to get it's value set to 0 as
baseline). However, the problem was that this meant that you'd get popping
artifacts when the a lower strip finally reaches influence=0 but your upper
strips haven't fully reached maximum yet ([#35382]). Another problem was that
you'd end up with less ability to scale the influence of all strips (as in
[#35263]).

So, as a stop-gap fix now, we will allow influence scaling to work on these
strips too. This still doesn't fix some of the other problems regarding
baselines/rest-poses and deterministic behaviour when some channels are only
keyed in one strip which isn't set to extend it's influence... Fixing those
issues is a bit more involved, and would require a bit of refactoring of how we
keep track of accumulation channels.
2013-06-10 05:10:58 +00:00
5e347c4f71 code cleanup: typos 2013-05-26 12:02:29 +00:00
9465ecf634 use string escaping when renaming animation paths - BKE_animdata_fix_paths_rename() 2013-04-23 20:24:10 +00:00
7dde355185 fix [#34958] keyframe many items would fail if there was a (") in the text. 2013-04-23 20:10:22 +00:00
5580b56876 Bugfix [#34836] Crash when driver variable has path == 'data'
Most of the places which relied on RNA_path_resolve() did so believing that if
it returned true, that it had found a valid property, and that the returned
pointer+property combination would be what the path referred to. However, it
turns out that if the property at the end of the path turns out to be a
"pointer" property (e.g. "data" for Object.data), this would automatically
become the pointer part, while the prop part would be set to null. Hence, if a
user accidentally (or otherwise) specifies a path for the single-property driver
variable type like this, then Blender would crash.

This commit introduces two convenience functions - RNA_path_resolve_property()
and RNA_path_resolve_property_full() - which mirror/wrap the existing
RNA_path_resolve() functions. The only difference though is that these include a
check to ensure that what was found from resolving the path was in fact a
property (they only return true iff this is the case), and make it explicitly
clear in the name that this is what they will do so that there's no further
confusion. It is possible to do without these wrapper functions by doing these
checks inline, but the few cases that had been patched already were pretty
hideous looking specimens. Using these just make it clearer and simpler for all.

I've also beefed up the docs on these a bit, and changed these to using bools.
2013-04-22 13:22:07 +00:00
fabbc5b1fa White space fixes (to make a diff from the trunk cleaner). 2013-04-05 16:53:24 +00:00
18d2dd7e3a Merging r55547 through r55594 from trunk into soc-2008-mxcurioni 2013-03-26 09:09:31 +00:00
6926596174 More new data names translation (most cases should be covered now).
Also done a few cleanup here and there...
2013-03-25 08:29:06 +00:00
62cede96d3 A major code update for making the DNA file specification of Freestyle settings
and RNA for it independent of the build flag for enabling Freestyle.  Suggested
by Sergey Sharybin through a code review of the branch.

* Many #ifdef WITH_FREESTYLE blocks were removed to always have Freestyle-specific
DNA file specification and RNA for it built in Blender.  This will allow Freestyle
setting survive even when a non-Freestyle build is used for loading and saving
files.  It is noted that operations are still conditionally built through #ifdef
WITH_FREESTYLE blocks.

* To this end, new blenkernel files BKE_freestyle.h and intern/freestyle.c have
been added.  All API functions in FRS_freestyle_config.h as well as some of those
in FRS_freestyle.h were moved to the new files.  Now the relocated API functions
have BKE_ prefix instead of FRS_.
2013-03-23 03:00:37 +00:00
c1ceab1281 Merged changes in the trunk up to revision 55357.
Resolved conflicts:
release/datafiles/startup.blend
source/blender/editors/space_nla/nla_buttons.c

Also updated source/blender/blenkernel/intern/linestyle.c as a follow-up of
recent changes for the use of bool.
2013-03-18 00:48:59 +00:00
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
ac9ec06ec1 Merged changes in the trunk up to revision 54421.
Conflicts resolved:
release/datafiles/startup.blend
release/scripts/startup/bl_ui/properties_render.py
source/blender/SConscript
source/blender/blenloader/intern/readfile.c
2013-02-10 10:17:59 +00:00
fdfa5910b5 Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
Issue was caused by couple of circumstances:

- Normal Map node requires tesselated faces to compute tangent space
- All temporary meshes needed for Cycles export were adding to G.main
- Undo pushes would temporary set meshes tessfaces to NULL
- Moving node will cause undo push and tree re-evaluate fr preview

All this leads to threading conflict between preview render and undo
system.

Solved it in  way that all temporary meshes are adding to that exact
Main which was passed to Cycles via BlendData. This required couple
of mechanic changes like adding extra parameter to *_add() functions
and adding some *_ex() functions to make it possible RNA adds objects
to Main passed to new() RNA function.

This was tricky to pass Main to RNA function and IMO that's not so
nice to pass main to function, so ended up with such decision:

- Object.to_mesh() will add temp mesh to G.main
- Added Main.meshes.new_from_object() which does the same as to_mesh,
  but adds temporary mesh to specified Main.

So now all temporary meshes needed for preview render would be added
to preview_main which does not conflict with undo pushes.

Viewport render shall not be an issue because object sync happens from
main thread in this case.

It could be some issues with final render, but that's not so much
likely to happen, so shall be fine.

Thanks to Brecht for review!
2013-02-05 12:46:15 +00:00
fe26492538 Merged changes in the trunk up to revision 54171. 2013-01-29 03:42:19 +00:00
004d0a3a9a Whitespace 2013-01-29 01:23:29 +00:00
a462d69bbf Another big patch set by Bastien Montagne, thanks a lot!
* Made Freestyle optional (turned on by default).

* Fix for missing bpath.c updates in the previous merge of trunk changes.
2012-12-20 07:57:26 +00:00
53d845ba69 A big cleaning patch by Bastien Montagne (thanks a lot!)
* Split and moved Cycles’ render layers panels into the render_layer
context as well (would be nice to hide this context when not needed,
e.g. with the BGE, but this is not so easy to do nicely...).

* Fixed some inconsistencies with trunk (probably due to svn merge
glitches) using r52858 as reference.  Also recovered the missing
release/bin/blender-softwaregl file.

* A bunch of style code fixes in Blender's own code (not Freestyle
itself yet): line lengths, spaces around operators, block formatting,
headers, etc.  In rna_linestyle.c, color_blend_items was replaced by
ramp_blend_items (exported from rna_material.c).
2012-12-11 22:00:22 +00:00
7fa096261a Merged changes in the trunk up to revision 52118.
Conflicts resolved:
source/blender/makesrna/intern/rna_scene.c
2012-11-12 00:30:55 +00:00
dc5ba03945 Fix #33123: lamp nodes drivers not working, now uses same hacks as material
to work around dependency graph limitations.
2012-11-09 13:57:09 +00:00
a8a2782d34 Merged changes in the trunk up to revision 51985. 2012-11-07 22:12:19 +00:00
83a22ec16e Harmless formatting tweaks 2012-11-06 06:29:40 +00:00
15ed834343 Merged changes in the trunk up to revision 51718.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/makesrna/intern/rna_scene.c
release/datafiles/startup.blend
2012-10-29 01:09:12 +00:00
91ceb8f552 Tooltip/Description fixes for recent "tweaks"
1) "AnimData" is a technical term used for a specific entity in the system.
"anim data" is mangled fluff.
2) Old tooltip for DopeSheet.source is no longer valid. It's nearly always used
to represent the current scene now.
2012-10-22 02:20:41 +00:00
26d0492653 A final bunch of UI messages fixes and tweaks, and some BKE_report()<->BKE_reportf() fixes. 2012-10-21 14:02:30 +00:00