Commit Graph

32 Commits

Author SHA1 Message Date
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Campbell Barton 88a80fcec8 Cleanup: commas at the end of enums
Without this clang-format may wrap them onto a single line.
2019-01-16 00:03:03 +11:00
Campbell Barton 5a43406e1b Cleanup: move DNA comments before struct members
Needed for clang-format in some cases, see: T53211
2019-01-08 00:43:00 +11:00
Campbell Barton b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
Campbell Barton 78fbd146f3 Cleanup: trailing space for DNA headers 2018-06-17 17:04:09 +02:00
Campbell Barton c77179a3c2 code cleanup: comment/remove unused defines 2013-05-28 01:15:59 +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 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
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
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Chris Want 5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Joshua Leung ab02e9140e == NLA - Scale Setting for Strips ==
NLA-Strips now have a new setting: Scale. 

It determines how much the action-range is scaled for each repeat, instead of the scaling being implicitly determined based on repeats + strip-length. 

One of the instant benefits of this, is that when increasing the number of repeats, the strip length increases by the right amount. Thus, increasing the number of repeats retains a constant speed.

Hopefully we can prevent weirdly scaled actions this way. (i.e.  0.00001 frames long action * 10000 or so)

Todo:
- Transform code needs to be able to set the scale setting (it doesn't yet)
- Add a new option to "apply scaling", to fix up problems with old files that have really bad scaling. Situations when this is needed could get indicated in the interface too... (red background for "Scale" field?)
2007-12-07 04:24:02 +00:00
Joshua Leung ecaafbb70c == SDNA - Code Comments ==
Added a few comments about various Animation-System Related structs. Hopefully, these will be helpful for people trying to get familiar with the code.
2007-07-19 11:46:37 +00:00
Campbell Barton 6789b8fd82 added commends to some DNA_*.h files - as well as some TODO's for removal.
header_view3d.c was doign an implicit declaration also.
2007-07-19 00:42:01 +00:00
Joshua Leung 185a7799a0 == NLA Editor - Auto-Blending for ActionStrips ==
This is just a little time-saver for NLA-workflow. With the 'Auto-Blending' option
turned on in the Transform Properties (NKEY) for an ActionStrip, that strip's blendin/blendout values are determined based on the number of frames that the previous and/or next actionstrip(s) on overlap over the start and end of it.

It is turned on by default for new actionstrips added using the Shift-N hotkey.

Caveats:
* Only the actionstrips immediately on either side of the strip being evaluated, will
 have any effect
* A strip that is longer-than, and extends over the sides of the strip being evaluated,
 will have no effect

Additional Notes:
* Blendin/Blendout have been renamed In/Out in UI for brevity
* Button layout in NLA Transform Properties has changed slightly again, but hopefully that shouldn't be too much of an issue.
2007-04-15 09:48:53 +00:00
Joseph Eagar 048c7879fa =Forward cycling fix=
Commit of patch #5385, to make forward cycling more
user-controllable.  Previously it only worked on one axis,
which was auto-detected from movement.  This allows forward
cycling to work in more situations, such as stair
stepping.
2007-01-19 10:05:17 +00:00
Ton Roosendaal 6dd4f6020e Patch #4848, Joshua Leung
NLA Strip "Mute" option, to temporally disable a strip. Option only in
Properties panel still, should be in menus and hotkey.
2006-11-01 15:33:45 +00:00
Ton Roosendaal 35d6c6e695 Two wonderful new NLA & Armature editing features!
- FORWARD CYCLING & MATCHING

Up to no now, adding multiple actions in NLA with walkcycles required to
animate them standing still, as if walking on a conveyor belt. The stride
option then makes the object itself move forward, trying to keep the foot
stuck on the floor (with poor results!).
This option now allows to make walk cycles moving forward. By
indicating a reference Offset Bone, the NLA system will use that bone to
detect the correct offset for the Armature Pose to make it seamlessly going
forward.

Best of all, this option works as for cyclic Action Strips as well as for
individual Action Strips. Note that for individual strips, you have to set
the strip on "Hold". (Might become automatic detected later).

Here's an example edit image for NLA:
http://www.blender.org/bf/nla_match-cycle.jpg
And the animation for it:
http://download.blender.org/demo/test/2.43/0001_0150_match.avi
Blender file:
http://download.blender.org/demo/test/2.43/mancandy_matching.blend

Using this kind of cycling works pretty straightforward, and is a lot
easier to setup than Stride Bones.

To be further tested:
- Blending cycles
- matching rotation for the bones as well.

- ACTION MODIFIERS (motion deformors)

The above option was actually required for this feature. Typically walk
cycles are constructed with certain Bones to be the handles, controlling
for example the torso or feet.
An Action Modifier allows you to use a Curve Path to deform the motion of
these controlling bones. This uses the existing Curve Deformation option.
Modifiers can be added per Action Strip, each controlling a channel (bone)
by choice, and even allows to layer multiple modifiers on top of each other
(several paths deforming motion). This option is using the dependency graph,
so editing the Curve will give realtime changes in the Armature.

The previous walkcycle, controlled by two curves:
http://download.blender.org/demo/test/2.43/0001_0150_deform.avi
Blender file:
http://download.blender.org/demo/test/2.43/mancandy_actiondeform.blend

Action Modifiers can be added in the NLA Properties Panel. Per Modifier you
have to indicate the channel and a Curve Object. You can copy modifiers from
one strip to another using CTRL+C (only copies to active Object strips).

Setting up a correct Curve Path has to be carefully done:
- Use SHIFT+A "Curve Path" in top view, or ensure the path is not rotated.
- make sure the center point of the Curve Object is at the center of the
  Armature (or above)
- move the first point of the curve to the center point as well.
- check if the path starts from this first point, you can change it using
  (in Curve EditMode) the option Wkey -> "Switch Direction"
- Make sure alignment uses the correct axis; if the Armature walks into
  the negative Y direction, you have to set in Object Buttons, "Anim settings"
  Panel, the correct Track option. (Note; option will probably move to the
  Modifier later).

This is a good reason to make such paths automatic (on a command). Is on the
todo list.

Also note this:
- the Curve Path extends in beginning and ending, that's (for now) the default,
  and allows to use multiple paths. Make sure paths begin and end horizontal.
- Moving the Curve in Object Mode will change the "mapping" (as if the landscape
  a character walks over moves). Moving the Curve in Edit Mode will change the
  actual position of the deformation.
- Speed (Ipos) on paths is not supported yet, will be done.
- The Curve "Stretch" deform option doesn't work.
- Modifiers are executed *after* all actions in NLA are evaluated, there's no
  support yet for blending multiple strips with Modifiers.
- This doesn't work yet for time-mapping...

This commit is mostly for review by character animators... some details or
working methods might change.
This feature can also be used for other modifiers, such as noise (Perlin) or
the mythical "Oomph" (frequency control) and of course Python.

Special thanks to Bassam & Matt for research & design help. Have fun!
2006-10-31 15:51:57 +00:00
Ton Roosendaal e506a34bf8 Orange:
For some ancient reason, the stride option only worked on a single strip,
and extended always. This made it nearly impossible to integrate it well
with other actions in NLA.
This commit changes it as follows;

- As any strip, the striding-strip also stops at the end of a strip
- This allows to put multiple different actions on a single path, and if
  all of these have the striding option set, the actions will each do their
  own individual stride.
- To match the different actions, a new "Action Offset" button was added
  in the NLA Panel, which allows to internally cycle the action.
- Of course, blend-in and blend-out works nicely too.

Here's a quick AVI test with 2 actions. There's some slipping of the feet
between actions still, because of the stridebone blending. I might look
at that later, for now you can correct it with a simple Ipo on Armature too

http://www.blender.org/bf/0007_0151.avi
2005-12-17 10:08:57 +00:00
Ton Roosendaal d7bee8c117 Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
   enables to control the entire animation system of the Group.

Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
   to override NLA/action of any Grouped Object.

For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.

Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.

Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.

-> Recoded entire duplicator system

The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.

By centralizing the code for duplicating, more options can be easier added.
Features to note:

- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too

Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.

-> Library System

- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.

-> Fixes

- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
  causing unnecessary slowdown on reading.

Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
Ton Roosendaal 8906e4ec98 Three new features:
1) Stride Bone

For walkcycles, you could already set an NLA strip to cycle over a path
based on a preset distance value. This cycling happens based on a linear
interpolation, with constant speed.
Not all cycles have a constant speed however, like hopping or jumping.
To ensure a perfect slipping-less foot contact, you now can set a Bone
in an Armature to define the stride. This "Stride Bone" then becomes a
sort-of ruler, a conveyor belt, on which the character walks. When using
the NLA "Use Path" option, it then tries to keep the Stride Bone entirely
motionless on the path, by cancelling out its motion (for the entire
Armature). This means that the animation keys for a Stride Bone have to be
exactly negative of the desired path. Only, at choice, the X,Y or Z Ipo
curve is used for this stride.

Examples:

http://www.blender.org/bf/0001_0040.avi
The top armature shows the actual Action, the bottom armature has been
parented to a Path, using the Stride Bone feature.

http://www.blender.org/bf/0001_0080.avi
Here the Stride Bone has a number of children, creating a ruler to be
used as reference while animating.

Test .blend:
http://www.blender.org/bf/motionblender1.blend

Notes:
- Note that action keys for Bones work local, based on the Bone's
  orientation as set in EditMode. Therefore, an Y translation always
  goes in the Bone's direction.
- To be able to get a "solvable" stride, the animation curve has
  to be inverse evaluated, using a Newton Raphson root solver. That
  means you can only create stride curves that keep moving forward, and
  cannot return halfway.
- Set the Stride Bone in the Editing Buttons, Bone Panel. You can set
  change the name or set the axis in the NLA Window, Strip Properties Panel.
- Files in this commit will move to the blender.org release section.

2) Armature Ghosting

In EditButtons, Armature Panel, you can set an armature to draw ghosts.
The number value denotes the amount of frames that have to be drawn extra
(for the active action!) around the current frame.
Ghosts only evaluate its own Pose, executing it's Actions, Constraints and
IK. No external dependencies are re-evaluated for it.

3) NLA/Action time control

If you click in the NLA window on the action (linked to Object), it makes
sure the Timing as drawn in the Action editor is not corrected for NLA.
If you also set the Object to "Action", this timing will be executed on the
Object as well (not NLA time).
(It's a bit confusing... will make a good doc & maybe review UI!)
2005-11-01 12:44:30 +00:00
Ton Roosendaal 2d960cea74 NLA & Action goodies;
-> Locked Strip length
When changing time of the animation curves in an Action, the strips in NLA
just remained the same length, causing very confusing situations.
By setting the strips to Locked (Nkey NLA window), it always updates the
strip length to make sure all keys are included, and not more. From now on
(not on old files) this is the default strip method.

-> ALT+C clear size
This menu has 2 options, the first clears the size, the 2nd remaps the
action (only when you didnt use the new Lock feature).
Both options are in the Pulldown menu too

-> Key drawing
The weird beveled button in Action/NLA didn't accurately show what time it
was actually on. I've replaced it with an Icon now, diamond shaped, in a
design derived from the TimeLine markers.
2005-10-27 16:25:35 +00:00
Ton Roosendaal 4bd9775936 Stupid me! Committed in wrong console with wrong dir... here's the rest of
all files for the Ipo/Action/NLA makeover...
2005-10-10 18:05:30 +00:00
Daniel Dunbar b03a20d272 - got rid of silly #define ..._BIT, #define ... (1<<..._BIT) stuff
- switched almost all uiDefBut(..., TOG|BIT|..) to use UiDefButBit and the
   name of the actual bit define instead of just a magic constant, this makes
   searching the code much nicer. most of the credit here goes to LetterRip
   who did almost all of the conversions, I mostly just checked them over.
2005-08-03 18:48:22 +00:00
Kent Mein f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
Kent Mein b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
Kent Mein 01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont 12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00