Commit Graph

89 Commits

Author SHA1 Message Date
Campbell Barton 5e347c4f71 code cleanup: typos 2013-05-26 12:02:29 +00:00
Joshua Leung ac6c218cf4 Invalid Driver Targets are now indicated appropriately (using Red Backgrounds)
in the UI

This is the second part of the fixes for [#32492], making it easier to identify
which part of a driver (i.e. which of its targets) is causing problems

A number of additional/related changes needed to be made:
* Red-alert status for layouts is now propagated down to child layouts when they
are created. This is needed as otherwise some of the templates used in the Graph
Editor driver settings won't actually get the red-alert status flushed down to
them. Also, note that this status needs to be set before any widgets are added
to the layout, or else the settings aren't applied when the relevant widgets get
created.

* "Single Property" RNA-Paths resulting in out of bounds array access will now
trigger an error status and appropriate warnings

TODO:
* The error tagging doesn't get applied immediately after variables are created,
or their types changed
* There was also some other weirdness involved when a higher-value flag (1<<10)
was used for this setting, which needs further attention
2013-02-28 07:13:33 +00:00
Campbell Barton f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
Campbell Barton 32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
Campbell Barton 32478997ec style cleanup 2012-06-27 18:29:47 +00:00
Sergey Sharybin fb278a501e Ensure enums in DNA files has got explicit values
See http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Macros.2C_Enums.2C_Inline_functions
2012-06-15 14:11:05 +00:00
Campbell Barton 4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +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 9d49fa0e63 style cleanup - spelling corrections & update some incorrect comments. 2012-03-03 11:45:08 +00:00
Campbell Barton ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +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 ca629d5ccc minor dna header cleanup 2011-12-30 07:25:49 +00:00
Joshua Leung db72192c22 Bye bye vile relics of extinct version control systems,
Causing a flurry of refresh file prompts post-commit,
Confusing local diffs and causing merge conflicts,
Stating the obvious; redundant and useless...

We shall not miss thou, blasted expand $keywords$
2011-08-12 07:20:49 +00:00
Joerg Mueller 13249b925e 3D Audio GSoC:
Speaker objects fully functional!

Minor changes:
* Fixed three memory bugs found via valgrind.
* Fixed bug with jack transport crashing after file loading.
* Sound NLA Strips now start at CFRA instead of 0.
2011-08-09 08:38:14 +00:00
Joshua Leung 022e815fbd Sound clip NLA Strips for Nexyon
These are basically just for specifying when a speaker should fire off
it's soundclip, and as such, many NLA operations are irrelevant for
it. They can only be specified on object-level for speaker objects.

I've still got some UI tweaks I'll need to work on in order for these
to be able to be added even when the speaker doesn't have any NLA
tracks yet. (EDIT: while typing this, I had an idea for how to do
this, but that'll be for next commit). In the mean time, you'll need
to add a single keyframe for the object, snowflake that action and
delete the NLA strip before you can start editing.
2011-08-07 12:27:20 +00:00
Joshua Leung 900928f8bf Bassam Feature Request: "Auto Clamped" handles can now be set per
handle/key

This used to be a weird per-curve setting which would happen to get
applied/work correctly if handles were set to "auto", and was a source
of constant confusion for both old and new animators. The main effect
of this handle-type/option was really to just ensure that auto-handles
stayed horizontal, instead of tilting as the keys were moved.

This commit simply changes this from a per-curve to per
keyframe/handle setting.
2011-08-04 14:13:05 +00:00
Joshua Leung a4216cb1d4 Transformation Channel Driver Variables - "Proper Localspace"
By popular demand, the "Transformation Channel" driver variable type
now has a "local space" transform space option which uses the same
magic that constraints use for defining local-space. This is what many
bug reporters and feature requesters have moaned about for a while
now, so after reviewing several of the bug reports which lead to the
current situation, here is what has been much-wanted for so long!

In order to implement this, I've:
- renamed the old "Local Space" option here to "Transformation Space",
in order to prevent old rigs breaking. This has also been kept, as it
is useful for #21384 (though perhaps with this new option it isn't
needed anymore)
- reviewed my fix for #20870 (IIRC, a Durian-era bug), which related
to the non-uniqueness of matrix->euler decomposition
2011-06-13 13:54:21 +00:00
Joshua Leung 185663b52b FModifier Influence/BlendIn-Out
Following on from my commit to introduce frame ranges for FModifiers,
those frame ranges can now have blend in/out values. By setting a
blendin or blendout value, you're specifying the number of frames for
the modifier's "full influence" to take effect or fade out relative to
the start/end frames.

The "full influence" above needs a little clarification.

When the "use influence" setting is enabled, "full influence" is taken
from the "influence" slider (a new setting). Otherwise, it uses 1.0
(i.e. unmodified influence, same as old behaviour before the
introduction of influence controls). The influence slider basically
says how much the modifier's effects are allowed to contribute to the
final result.

---

Notes:
- This opt-in "Use Influence" approach is really forced upon us
because there are heaps of old files for which we cannot easily
version patch without spending some effort going through all the data
in the file, hunting out the F-Modifiers.
- interpf() seems to use a backwards order compared to everything else
2011-06-04 06:22:01 +00:00
Joshua Leung 05a1c144ad Experimental Feature: Frame Range Masks for FModifiers
Using this feature, it is now possible to for example have different
noise-profiles for different parts of a curve, which makes it possible
to do animate camera shake for example.

Or perhaps, for having greater control of mixing and matching
different parts of F-Modifier effects, such as combining several
generator modifiers to get multi-case functions for instance.

See http://aligorith.blogspot.com/2011/06/gsoc11-fmodifier-range-
masks.html for details.
2011-06-03 13:34:02 +00:00
Campbell Barton d8e6dd705f fix [#26607] blender won't duplicate or assign new drivers on duplication 2011-03-25 07:34:44 +00:00
Nathan Letwory 22dbae84e5 DNA header files are now grouped under the same module. No further documentation done. 2011-02-17 20:48:12 +00:00
Joshua Leung 71da1e96d1 Drivers Code Cleanups and UI Tweaks:
- Adding drivers from the UI (not from py-scripts though) will now
automatically add a "Transform Channel" driver variable to the newly
created drivers. This makes setting up drivers a bit more convenient
for the most commonly used case.

- Drivers now report their errors using the Reports system instead of
writing these directly to the console.

- Clarified some comments to be more insightful about the "why's" of
some design decisions, and related formatting/cleanup tweaks
- Reduced scope of "path" vars to just the scope they're required in

- Removed some unused defines from a failed experiment in the original
Keying Sets code ("templates" and "template flags") which was
superseeded by the more flexible + nicer "Builtin KeyingSets"
2010-12-28 05:45:15 +00:00
Campbell Barton b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
Joshua Leung db4609eb08 Animation Editors: Channel Reordering
This commit restores the ability to reorder channels in the animation editors (DopeSheet/Action/etc., Graph/Drivers, NLA). The hotkeys for this are:
- Shift-PageUp = Move Up
- Shift-PageDown = Move Down

- Ctrl-Shift-PageUp = Move to Top of List
- Ctrl-Shift-PageDown = Move to Bottom of List

Do note that only animation data can get reordered using this. 
So, do not expect to be able to change the object order (that is actually taken from the order that Blender actually evaluates them per update/frame).

---

In the process, I've fixed a couple of other bugs:
* Removed 'optimisation step' check in anim_filter.c for dopesheet with no filtering options modified, since this meant that the ANIMFILTER_ANIMDATA data filter was not getting processed (and potentially there were other maintenance problems with that).

* Made NLA Editor's channel list not totally duplicate the basic Animation Channels keymap. Instead, the "NLA Channels" keymap now only defines the parts that are different, and this then gets specified before the standard one so that these different parts will override the standard ones.

* Attempted to fix BorderSelect on NLA Channels list. Still not totally working correctly yet though.

* Moved "Euler Discontinuity" menu entry from "Channels" to "Keys". It really belongs in the latter, since it affects the keyframe values, rather than some aspect of the channel (i.e. ordering of channels or how they're displayed)
2010-11-07 12:09:15 +00:00
Campbell Barton 391cc2d004 merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
Joshua Leung d89a8c34f3 More F-Modifier Tweaks:
This commit started out aiming to make the "Stepped" F-Modifier (committed last night) even more useful, but ended up fixing a few other finer-points of how F-Modifiers work.

Firstly, the new stuff:
I've addded options to the Stepped F-Modifier to not affect frames before and/or after specified values, and renamed the 'start offset' to 'offset' for clarity. 

The main objective of this is to allow Stepped F-Modifiers to only affect certain time ranges, so that by layering/using multiple instances of the F-Modifier, it can be possible to have multiple stepping-sizes.

This allows for effects like:
http://www.pasteall.org/blend/2230
or in words, it provides a convenient mechanism for animators to specify whether sections of the animation is shown "on twos", "fours", or even "forty-second-ths plus a smidgen", as can be easily done with 2D.

Assorted changes to support this:
* Properly fixed up how F-Modifiers that work with time, evaluate the time to evaluate the curve at. Now layered time effects like this should be possible in a much nicer way.

* Added proper value range validation/clamping to many properties. There are still a lot more that need checking, but at least more properties now do "the right thing".
2010-03-19 03:38:14 +00:00
Joshua Leung 618b459e8b F-Modifier Goodies (as requested by @ndy):
* Copy/Paste operators for F-Modifiers
Available in Graph and NLA Editors. Use the Copy/Paste buttons beside the 'Add Modifier' buttons.

Copy copies all the modifiers of the ACTIVE F-Curve or Strip depending on the editor.
Paste pastes modifiers from the buffer to all the selected F-Curves or Strips, adding the new modifiers to the ends of each list.

* 'Stepped Interpolation' F-Modifier
This modifier holds each interpolated value from the F-Curve for several frames without changing the timing. 

This allows to preview motions 'on-twos' for example without altering the timing, or having to go through setting heaps of keyframes. In this case, Andy wanted to use this for CG <-> StopMo.
2010-03-18 13:04:46 +00:00
Joshua Leung ea4a987fd4 == Massive Keying Sets Recode ==
After a few days of wrong turns and learning the finer points of RNA-type-subclassing the hard way, this commit finally presents a refactored version of the Keying Sets system (now version 2) based on some requirements from Cessen.

For a more thorough discussion of this commit, see 
http://sites.google.com/site/aligorith/keyingsets_2.pdf?attredirects=0&d=1

------

The main highlight of this refactor is that relative Keying Sets have now been recoded so that Python callbacks are run to generate the Keying Set's list of paths everytime the Keying Set is used (to insert or delete keyframes), allowing complex heuristics to be used to determine whether a property gets keyframed based on the current context. These checks may include checking on selection status of related entities, or transform locks.

Built-In KeyingSets have also been recoded, and moved from C and out into Python. These are now coded as Relative Keying Sets, and can to some extent serve as basis for adding new relative Keying Sets. However, these have mostly been coded in a slightly 'modular' way which may be confusing for those not so familiar with Python in general. A usable template will be added soon for more general usage.

Keyframing settings (i.e. 'visual', 'needed') can now be specified on a per-path basis now, which is especially useful for Absolute Keying Sets, where control over this is often beneficial.

Most of the places where Auto-Keyframing is performed have been tidied up for consistency. I'm sure quite a few issues still exist there, but these I'll clean up over the next few days.
2010-03-16 06:18:49 +00:00
Joshua Leung 7790780006 Animation Editors: DopeSheet filter for Object-level animation
Added a new option to filter the out Object-level (i.e. transforms, object visibility/settings, and also bone animation) animation data from the channels list. As most of these settings are transforms, I've used the transform manipulator icon and named the RNA setting display_transforms. 

This is useful when trying to filter out only material animation data for example, as requested by Colin.
2010-02-17 12:03:23 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Joshua Leung 14d4feca57 Radians vs Degrees: The Second Attempt
F-Curves now internally store radians again instead of degrees. 
- This solves problems with inconsistencies when working with drivers.
- No need to version patch old files, potentially screwing them up. As such, removed the version patching for F-Curves.
- Is better suited to optionally showing radians throughout the UI instead or degrees.

As a result, values are now converted on the fly in the Graph Editor for display and operators that operate on values. I've made the conversion system for this rather general, so that other unit type conversions can also be hooked up with the type conversion backend.

Also, made some tweaks to F-Curve RNA wrapping to make it represent the data better.

TODO:
- Transform code currently still needs to be corrected to work with these changes. Currently moving keyframes for rotation curves will make them change too rapidly vertically when using degrees.
2010-01-26 03:16:14 +00:00
Matt Ebb 0c5998e799 Radians -> Degrees (in UI)
Rotations are now stored internally as radians, while exposing degrees in the UI - 
in the graph editor and UI controls. This is done in two areas:
1) Using the unit system to convert RNA data to display as degrees in the UI controls
2) FCurves now use degrees for rotation, so you can edit in the graph editor what 
you see in the UI.

All rotation data is consistently accessible in DNA and RNA as radians, degrees are only 
used for the UI controls and graph editor.

This commit includes conversions will convert old files (stored data and also fcurve data) 
to the new units, hopefully everything should go smoothly!

Part of this also changes a few properties that were hard-coded as degrees before (such 
as IK pole angle and brush texture rotation) to also use the same consistent system of 
radians (dna/rna) and degrees (ui).

Thanks to Joshua for hints and review here too.
2010-01-25 06:24:05 +00:00
Joshua Leung a8855e2caf Drivers UI: Debug Info
Feature request for ZanQdo, which shows the intermediate values used in driver calculations (i.e. current value of driver, and current value of variables), allowing drivers expressions to be debugged. This is a per-driver setting...
2010-01-19 23:38:26 +00:00
Campbell Barton d3a718dc2f fix for own but in recent driver optimization [#20580] Driver Crasher rev [25763]
recalculate names when needed
2010-01-06 22:42:13 +00:00
Brecht Van Lommel 9a3362c84f BUGFIX: revision 25736 (about 3 hours ago) introduced a problem in SDNA
for drivers, which will cause files that include drivers and saved since
then to crash on load, and loading existing files to crash as well. This
commit fixes that problem. So, don't use builds from revision 25736-25743.

The problem is this line, SDNA does not support parsing #defines:

DriverTarget targets[MAX_DRIVER_TARGETS];
2010-01-05 14:56:48 +00:00
Joshua Leung 6fb1d0e6a3 More Driver Fixes:
* Fixed Driver version-patching code to work correctly again with the new system.

* Fix for bug #20484, by adding a new driver variable type ('Transform Channel') which makes it easier to use object/bone transforms as in the past. The main differences with using this (compared with the 'Single Prop' type) are that this allows for 'final' transforms to get used instead (i.e. constraints are also taken into account), and also that this variable type can only be used for transforms (more limited scope -> less flexibility -> point-n-click goodies can follow). Mancandy now loads correctly again.

* Added toggle for local vs worldspace transforms when working with Rot/Loc Diff variable types, and also for the newly added Transform Channel

* Removed some dead code from sequencer...
2010-01-05 11:59:12 +00:00
Joshua Leung a9861e3381 Durian Request: Drivers Recode
Highlights:
* Support for Multi-Target Variables
This was the main reason for this recode. Previously, variables could only be used to give some RNA property used as an input source to the driver a name. However, this meant that effects such as Rotational Difference couldn't be used in conjunction with other effects and/or settings to achieve the powerful results. Now, a variable can take several input targets, perform some interesting operations on them, and spit out a representative value based on that.

* New Variable Types
With the introduction of multi-target variables, there are now 3 types of variable that can be used: single property (i.e. the only type previously), Rotational Difference (angle between two bones), and Distance (distance between two objects or bones).

* New Driver Types
In addition to the existing 'Average', 'Sum', and 'Expression' types, there is now the additional options of 'Minimum' and 'Maximum'. These take the smallest/largest value that one of the variables evaluates to.

* Fix for Driver F-Curve colouring bug 
Newly added drivers did not get automatically coloured in the Graph Editor properly. Was caused by inappropriate notifiers being used.


Notes:
* This commit breaks existing 2.5 files with drivers (in other words, they are lost forever). 
* Rigify has been corrected to work with the new system. The PyAPI for accessing targets used for the variables could still be made nicer (using subclassing to directly access?), but that is left for later.
* Version patching for 2.49 files still needs to be put back in place.
2010-01-04 21:15:45 +00:00
Joerg Mueller a2b0020e11 Reverted the addition of the f-curve sound modifier (was added in revision 24759) due to unusability and performance issues. The ability to use a sound as animation source will be added as an import operator later that renders a sound to an f-curve which brings the advantage that you can edit the generated curve later and the disadvantage it is not automatically updated when the sound changes. 2009-12-24 14:01:22 +00:00
Joshua Leung da5025d46d Bugfix #20463: In graph editor bone channels cannot be selected with 'A' or 'B' border select
This bug was caused by my recent commit to get bone select -> selection syncing working. The selection flushing was occurring too readily, blocking any selection tools from having any visible effect. Now this syncing is only triggered when appropriate notifiers+flags have been set.
2009-12-23 11:22:30 +00:00
Joshua Leung 6b7544bfda Durian Request: Default F-Curve Auto-Colour Modes
Added option to KeyingSets+Keyframing Functions which makes newly added F-Curves for Transforms + Colours to use the colour mode which uses the array index to determine the colour of the F-Curve. 

The main implication of this is that when this option is enabled for a KeyingSet, all sets of XYZ F-Curves (i.e. location, rotation, scale) for transforms will be shown in Red/Green/Blue instead of some automatically determined "rainbow" colour. Useful for animators far too used to Maya's Graph Editor :P

This setting is named, "XYZ to RGB", though that doesn't make its purpose entirely clear.
2009-12-10 10:40:28 +00:00
Campbell Barton 0391b1ab78 compile python driver expressions for faster re-evaluation.
approx 15-25x speedup
2009-12-08 10:36:46 +00:00
Campbell Barton 47416c725c driver type 'Sum' 2009-12-07 19:59:04 +00:00
Joerg Mueller 8e877c1f9f Added a first version of the Sound F-Curve Modifier, not really usable yet, but you can play around with it. 2009-11-22 12:10:45 +00:00
Joshua Leung 1ef163f1e0 UI Templates: ('Any ID' Selector)
Added new template for choosing to use any type of ID-block. The first combo box allows you to choose the type of ID-block that gets used, and the second box allows you to choose the ID-block of the type specified by the first one.

This is currently used for setting the ID-block used for Keying Sets, but the main user for this was intended to be the Drivers UI. However, I still need to clear up a few button-event issues there before I can port this over.


Additional Bugfixes:
* Adding new Keying Set path was setting the active path wrong, meaning that you had to click on the list to get some response after adding
* Bone Groups list was being drawn too long by default (when empty)
2009-10-14 09:08:53 +00:00
Joshua Leung f4c697cf7f Keying Sets UI:
Added a way to view and edit Keying Sets via the Scene Buttons. These are still some tweaks needed to make this really workable, but should still work well enough for simply viewing and tweaking existing Keying Sets created using other means.

Additional bugfixes:
* Adjusted the size of labels on properties that had a 'label' for their name. Now it uses 1/3 of the total width instead, which looks much better for most cases.
* Added missing entries for adding Force Fields from the Info-header 'Add' menu. At some point we should unify this menu with the popup operator's one, since this is exactly the kind of situation we had hoped in avoid with new UI architectures.
* Moved all the operator defines for keyframing stuff to the 'intern' anim header instead
2009-10-03 04:21:38 +00:00
Joshua Leung 7d2fd5449e Durian Feature Request: Rotation Modes for Objects
This (biggish) commit generalises the rotation modes functionality added for Bones, allowing Objects to use the various Euler Rotation orders, Axis-Angle, and Quaternion rotation representations.

I've also cleaned up the nomenclature of the rotation-related settings so that the naming styles are more consistent with each other. Unfortunately, this will break all files involving object or bone rotation animation made in 2.5 versions (2.4x will still get correctly converted).

General Notes:
* By default, Objects still default to using Eulers, while Bones will use Quaternions by default still.
* I've fixed all areas that I'm currently aware of to work with these changes. However, there are probably a few places where I've missed a few changes (i.e. auto-keyframing will need attention later).
* Removed the old "IPO-Keys" stuff from Transform code. I'm unlikely to restore this in the near future, and trying to fix that to include support for this commit would have been too much work.
2009-09-28 10:19:20 +00:00
Joshua Leung fbfa8d2f81 2.5 - Assorted Animation UI/Editing Tweaks
Main Feature:
* It is now possible to choose which AnimData block is the 'active' one for editing, and/or select them too. AnimData blocks are generally the dark blue and lighter-blue expanders (i.e. Scene, Object, Camera, Lamp, Curve, Armature, etc.)

* Objects are no longer selected/deselected when AKEY is used to toggle selection of channels. This was getting a bit annoying. 

* Following on from selection of AnimData blocks, it is now possible to select/make active an AnimData block in the animation editors, and change the active action for that block via the 'Animation Data' panel in NLA Editor's properties region.
--> Be aware that user-counts are not totally handled correctly there yet, so some funky behaviour might be seen...
--> It is possible to assign a new action, or to assign an existing one, allowing to switch between actions as in the past with Actions/IPO Editors...

Other tweaks:
* Some code tweaks towards making the 'Euler Filter' feature for Graph Editor working sometime soon
* Added some backend code for snapping the values of keyframes to a single value. Still need to work out some UI for it though.
* Shuffled the code for ACT_OT_new() around, and removed the poll() callback so that it worked in NLA too.
* Fixed some more notifier bugs with deleting bones and a few other editmode operations for Armatures.
2009-09-27 04:22:04 +00:00
Joshua Leung 9a8b01218f 2.5 - Bones with "Euler" rotations can now have their rotation keyframed properly using built-in keyingsets (i.e. the IKEY menu in 3D-View) 2009-08-02 23:31:18 +00:00
Joshua Leung a1eef5bb4d Animato - NLA + Realtime Animating Goodies
* When doing realtime recording of animation (i.e. transforming objects + bones while animation playback is running, and auto-keying is enabled), animation will be added to a new NLA Track+Strip combo everytime a single 'loop' of the frame range has finished. This will allow 'passes' over the animation to be less destructive.

* Made the evaluation of the active action (when NLA data is present), be handled as part of the normal NLA system evaluation code (as if it were just another strip in a track at the end). The immediate benefit is that there are now some settings (available in the "Animation Data" panel in the NLA Editor with a strip selected) which allow for the way the active action is combined with the NLA stack results. For instance, the way that the action extrapolates is used in the recording tweaks above.
2009-07-31 07:43:47 +00:00
Joshua Leung b3d0753467 2.5 - Small tweaks to order of buttons for Animation Editor header buttons to have more consistent layout 2009-07-29 11:59:21 +00:00