Commit Graph

181 Commits

Author SHA1 Message Date
85efe767f0 Integration of new IK lib features in Armature Poses.
Best is to forget yesterday's commit and old docs. New docs are underway...

Here's how IK works now;

- IK chains can go all the way to the furthest parent Bone. Disregarding
  the old option "IK to Parent" and disgregarding whether a Bone has an
  offset to its parent (offsets now work for IK, so you can also make
  T-bones).
- The old "IK to Parent" option now only does what it should do: it denotes
  whether a Bone is directly connected to a Parent Bone, or not.
  In the UI and in code this option is now called "Connected".
- You can also define yourself which Bone will become the "Root" for an IK
  chain. This can be any Parent of the IK tip (where the IK constraint is).
  By default it goes all the way, unless you set a value for the new IK
  Constraint Panel option "Chain Lenght".
- "Tree IK" now is detected automatic, when multiple IK Roots are on the
  same Bone, and when there's a branched structure.
  Multiple IK's on a single chain (no branches) is still executed as usual,
  doing the IK's sequentially.
- Note: Branched structures, with _partial_ overlapping IK chains, that don't
  share the same Root will possibly disconnect branches.
- When you select a Bone with IK, it now draws a yellow dashed line to its
  Root.
- The IK options "Location Weight" and "Rotation Weight" are relative,
  in case there's a Tree IK structure. These weights cannot be set to
  zero. To animate or disable IK Targets, use the "Influence" slider.
- This new IK is backwards and upwards compatible for Blender files.
  Of course, the new features won't show in older Blender binaries! :)

Other changes & notes;

- In PoseMode, the Constraint Panel now also draws in Editing Buttons, next
  to the Bones Panel.
- IK Constraint Panel was redesigned... it's still a bit squished
- Buttons "No X DoF" is now called "Lock X". This to follow convention to
  name options positive.
- Added Undo push for Make/Clear Parent in Editmode Armature
- Use CTRL+P "Make Parent" on a single selected Bone to make it become
  connected (ALT+P had already "Disconnect").

On todo next; Visualizing & review of Bone DoF limits and stiffness
2005-08-28 12:23:06 +00:00
eb1f65768a IK work-in-progress commit;
- Removed old convention that only allowed one "IK" connection for Bones
  in a joint. Was highly frustrating for editing trees or branches.
  In a next commit, there will be a different method to define IK target
  and IK root, so this option actually will become "Connect Bone" or so.

- the IK group name is gone, now is just an option "Tree IK". When IK
  chains share a root they'll form a tree.
  Todo is preventing conflicts here (will be for editor to define IK Root)

- Adding new IK constraint with CTRL+I activates Constraint
2005-08-27 17:04:29 +00:00
8f5bff6051 Make IK DOF stiffness work in range 0.0-1.0, for consistency. 2005-08-27 14:27:05 +00:00
ac619bace6 Third and last commit for Brecht's IK work.
Full logs for changes will be added later. Worth to note now;
- support for 'tree IK' added
- DOF and stiffness per IK bone (in pose only)
- Orientation IK support (target rotates -> chain follows)

This is still WIP. Buttons might change, button ranges will change, and the
way 'IK groups' are working will change. You can play with this, but don't
expect saved files to work still by end of this day! :)
2005-08-27 12:48:45 +00:00
a51896b591 Move the settings in the Mesh Tools panel to the new toolsettings struct in Scene. These settings are now saved per scene. 2005-08-24 20:37:25 +00:00
dfb654ba60 Huge commit, but not much features... had to shuffle a lot of code around.
Main target was cleanup of editconstraint.c and removal of the ugly
ob->activecon (active constraint channel), which was set by the "Show"
button in the Constraint Panel.
Better is to introduce an 'Active Constraint' itself, which stores in
the Constraint itself. By using this setting, and by checking the active
Bone, the UI can update reliably now. This only shows now in IpoWindow
btw (for constraint ipos). The active Constraint is drawn in the Buttons
with a slightly brighter backdrop. Any action in that Panel selects a
constraint now (even click in backdrop).

So now we have pose channels & constraint channels nicely behaving. Now the
darn Action channels... :)

Further in this commit:

- interface.c: Button ROUNDBOX now does button callback too.
               Button NUMSLI didn't do the callback on a click only

- Cleaned up include files in yafray, got annoyed it compiled over all the
  time.

- removed unused variables from Constraint struct
2005-08-24 20:18:03 +00:00
81f995b741 - disabled incremental subsurf support (during object mode) for the
time being, misses features for texture/color drawing and I don't
   have time to finish at the moment. can return once UV/colors are
   incorporated into subdivision.
2005-08-23 20:39:58 +00:00
6ad0c922af Control over Armature deform. Three new options are added for it;
Armature Panel
- "Vertex Groups"
- "Envelope"

Bones Panel
- "Mult"

The logic works as follows;
- Set "Vertex Groups" will enable vertex group based deform (default)
- Set "Envelope" will enable Bone Envelopes to deform
- Set both will apply Envelope deform on vertices without VertexGroups

- Set the per-Bone "Mult" option to have Envelopes work on top of a
  VertexGroup
- The per-Bone "Deform" option (was called "Skinnable") will dis/enable
  the Bone to deform for all situations.

The old convention was that, without any vertex groups, the Bones deformed
with bone-distances. I can't patch that... so you have to enable it by
hand in older files. Not too bad, since this option was unusable before
anyway. :)
2005-08-21 18:53:12 +00:00
7804860cf6 - added mesh_strip_loose_faces, works in conjunction with make_edges
to get rid of faces with MFace.v3==0
 - change all Mesh's to have ->medge now. This is forced by make_edges
   on readfile, and in the various exotic important routines, and on
   conversion back in python.
 - make python NMesh structure always have medges now (needs testing)
 - with above two changes it is guarenteed that mf->v3 is never ==0
   in main blender code (i.e., all MFace's are actually triangles
   or quads) and so I went through and removed all the historic tests
   to deal with MFace.v3==0. Equals lots of deleting, I am in heaven!
 - removed MEdge edcode flag, no longer needed
 - added experimental replacement for edge flag system

Still are some inconsistencies in FACESELECT mode edge drawing to
be ironed out.

NOTE: This commit adds an experimental edge flag calc system, based
on 10-seconds-of-thought algorithm by yours truly. Would appreciate
feedback on how this system works, esp compared to old one and esp
on complex or interesting models.

To Use: New system is enabled by setting G.rt to a value between
1 and 1000 (Value of 0 uses old system). Value 1000 is reserved for
"auto" edge, which is more or less identical to old system but also
makes sure that at least 10% of edges are drawn (solves errors for
super subdivided meshes). Values between 1 and 999 act as percent
(out of 1000) of edges that should be drawn, starting with "most
interesting" edges first. Please try it and comment!
2005-08-21 07:19:20 +00:00
dd5410162a New feature; User definable Clipping Planes.
Press ALT+B in 3d window, draw a rect, and it becomes a clipping
volume of 4 planes. You then can rotate the view anyway you like.
Works for each 3d window individually.

Disable it with another ALT+B press.

Commit is huge because it had to change all selection code as well.
The user-clipping planes are in 'eye space', the other clipping
happens in projected 'viewport space'.

Nice to notice is that the 'x=3200' convention (to denote a coordinate
is clipped) now is a define. Define value is still a number though... but
we now can get up to screens of 12000 pixels without issues!

Known issue; here it refuses to draw the 'object centers' or Lamp icons
within the clipping region. Can't find any reason for it... however, we
might move to non-pixmaps for it anyway.

Testing might reveil numerous issues, will be standby for it.

Curious? Check this http://www.blender.org/bf/rt4.jpg
2005-08-20 19:18:35 +00:00
9e05d6efb5 Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;

http://www.blender3d.org/cms/Armature_Envelopes.647.0.html

Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).

Also part of this commit is:

- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
  keep the PoseMode hidden Bones separate from EditMode.
  (In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
  mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
  data. Sounds logical, but remember that VertexGroups are partial on a
  Mesh, partial on Object. Weird design decision though...
  Anyhoo, at this moment the only way to have Bone Envelopes deform, is
  by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
  depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
  set.
2005-08-19 12:35:15 +00:00
55b5abe2c9 - bug fix, free bake didn't work
- bug fix, force free of bake data on exit editmode, can't
   give user a choice
2005-08-16 22:58:31 +00:00
2abd79b491 - readded DL_VERTS type to store lattice deformed verts
- new feature, twiddled with lattice resizing to try to maintain
   existing vertex changes... much nicer than just resetting the
   lattice if you decide you need more detail in the lattice.
 - modifiers work with lattices now. yes, that does mean you
   can make a chain of lattices effecting each other 8 miles
   long.
 - some cleanup of softbody code, was rather splintered and call
   path was twisted and confusing. reworked main object step
   routine to do things in a more obvious and consistent manner
   and without duplicate code
 - added ob->softflag OB_SB_RESET instead of sbObjectReset
   call
 - modifier changes reset softbody now
 - moved curve_getVertexCos/curve_applyVertexCos into curve.c
 - update curve modifier eval to work with virtual modifiers
 - update modifier apply to work with curves/surfs
 - update make parent to also recalc object data

NOTE: Although you can turn SB on for curve/font objects at the
moment it doesn't really work because they call deform in
multiple steps and this confuses SB. Not sure how to deal with
atm.
2005-08-15 10:30:53 +00:00
91cd2d8138 Crash bug! Reading older files with follow-path constraints failed... 2005-08-15 09:45:48 +00:00
e0e6e2fe4a do_versions() for 2.37 was reading a library data pointer that wasn't set
yet. Crashed in windows...
Thanks Desoto for finding it!
2005-08-14 16:03:22 +00:00
93aeb6b318 - added make_orco_curf, even does keys!
- removed {lattice,curve}_modifier functions
 - changed render code to use displist for curve rendering
   instead of making its own. required adding a bevelSplitFlag
   field to DispList. I also fixed the bevel face splitting
   which did not work correctly in many situations.
 - changed so all curve data creation happens in makeDispListCurveTypes,
   includes making bevel list and filling polys
 - changed render code to use displist for surface rendering
 - removed Curve.orco variable, built as needed now
 - removed stupid BLI_setScanFill* functions... why use a function
   argument when you can use a global and two functions! Why indeed.
   (this fixed crash when reloading a file with filled curves and
   toggling editmode)
 - bug fix, setting curve width!=1 disabled simple bevel for no
   apparent reason
 - cleaned up lots and lots of curve/displist code (fun example:
   "if(dl->type==DL_INDEX3 || dl->type==DL_INDEX3)"). Hmmm!
 - switched almost all lattice calls to go through lattice_deform_verts,
   only exception left is particles
 - added DBG_show_shared_render_faces function in render, just
   helps to visualize which verts are shared while testing (no
   user interface).
 - renamed some curve bevel buttons and rewrote tooltips to be
   more obvious
 - made CU_FAST work without dupfontbase hack

Also by the way I wrote down some notes on how curve code
works, nothing spiffy but it is at:

http://wiki.blender.org/bin/view.pl/Blenderdev/CurveNotes
2005-08-14 06:08:41 +00:00
74dc0e191d - more nurbs fixes... as it turns out, rendering of cyclic UV didn't
really work at all. Fortunately no one actually *USES* nurbs so
   no one noticed. This is bug from NaN days (strubi, I am looking at
   you here) which I guess says a lot (or a little) about NURBS usage.
   And as usual, the correct code is shorter.
 - added do_version copy of ME_OPT_EDGES flag
2005-08-13 05:05:18 +00:00
7b1dcf4c42 - readded Subsurf "optimal" edge drawing/rendering
- added ME_EDGERENDER flag, barely changes things atm except makes
   sure plain meshes with FasterDraw/etc set still render all edges.
   The edge drawing system needs a bit of a revamping - it is a cool
   feature but could use several improvements:
     (1) The algorithm could be better in choosing the best edges to
         draw.
     (2) The drawflags should interact well with modifiers. It is wierd
         to have a large grid with a deformer that draws no edges because
         flags are only calculated based on base mesh.
     (3) Drawflags should not be destroyed by editmode. Better design
         would be a "Draw % of edges" button.

   Of course, could also be the feature is not worth it and we
   should just drop. Feel free to comment if you have an opinion.
2005-08-12 21:55:50 +00:00
0fba0e6b4b - update displistmesh_to_mesh to free existing mesh data (including
sticky, dvert, and keys if number of verts don't match)
 - changed modifier panel to not allow manual addition of hook or
   softbody modifiers
 - changed apply modifier to apply to existing mesh (fixes bug with
   materials) and to warn about loss of tface/mcol/keys/dvert/sticky
   for all modifier types
 - changed modifier UI to not display disclosure triangle for virtual
   modifiers
 - changed softbody ui to allow enable/disable
2005-08-11 07:11:57 +00:00
75bcb4cd98 - added modifiers_getVirtualModifierList, returns pointer to first modifier
but including "virtual" modifiers (for example, an object skel-parented
   to a lattice has a virtual first lattice modifier)
 - removed mesh_modifier(), all functionality has been incorporated into
   modifier stack (well, keys still don't exist as a modifier, but I am
   not sure if they should).
 - added interface option to convert a virtual modifier into a real modifier
 - added option to parent to lattice object or lattice with deform
 - bug fix, patch of hook indices patched all hooks (oops) not just ones
   for edited mesh

NOTE: Files saved with 2.38 that include an object parented to a lattice
will not load correctly, because it will look like the object is parented
only to the object (i.e. without deform). Can be simply fixed by reparenting
or adding a lattice modifier. Older files are handled automatically.
2005-08-11 03:31:33 +00:00
ac3ed0f92a - switch to using softbody modifier, controls enabling but does not have
variables, these are still in same place. enable button automatically
   makes/enables modifier.
 - changed hook to hook modifier conversion to happen on direct link,
   required to make sure we don't forget to free any memory for files
   saved with 2.38 that have hooks.
 - update modifier interface to enforce modifiers with the require-original-
   data flag to not move beyond deforming modifiers.
 - enforce only one softbody modifier allowed

NOTE: Once again, no modifier stack for lattice yet means softbody for
lattice does not work atm.
2005-08-11 02:23:52 +00:00
9030e5f686 - added eModifierTypeFlag_RequiresOriginalData for modifiers that
can only follow deform (for example, they store mesh vertex
   indices)
 - added ModifierType.foreachObjectLink for iterating over Object
   links inside modifier data (used for file load, relinking, etc)
 - switched various modifiers_ functions to take object argument
   instead of ListBase
 - added user editable name field to modifiers
 - bug fix, duplicate and make single user didn't relink object
   pointers in modifier data
 - added modifiers to outliner, needs icon
 - added armature, hook, and softbody modifiers (softbody doesn't
   do anything atm). added conversion of old hooks to modifiers.

NOTE-THE-FIRST: User name field is not initialized on loading 2.38 files
so if you have saved stuff with a cvs blender you will see blank names.

NOTE-THE-SECOND: Since modifiers aren't evaluated yet for non-Mesh
objects, hooks for lattices and curves are broken. Don't updated if
you actually, say, *use* Blender.

NOTE-THE-THIRD: Old hooks used a quirky weighting system during
deformation which can't be extended to modifiers. On the upside,
I doubt anyone relied on the old quirky system and the new system
makes much more sense. (Although the way falloff works is still
quite stupid I think).
2005-08-10 22:05:52 +00:00
8319b3d1fa - modifier UI update (aka, find the modifier buttons!!)
- moved back to editing buttons, where life is now cramped... switched
   to constraint style foldout panes, still a WIP. In particular not
   sure what buttons should be in header (and if current toggles stay
   in header if they should also be in an expanded pane). Also need
   new icons for move up/move down (and drag and drop would of course
   be nice). Finally current plane is to make it so modifiers will
   expand out in modifier pane for horizontal orientations instead of
   just going down down down to goblin town.
 - added error field to modifiers that is displayed in UI, need to have
   some way for modifiers to return errors back to interface (esp. important
   for python)
 - tweaked cage determination and handling, currently the editmode cage
   is determined by last modifier with OnCage set that is preceeded completely
   by modifiers that support mapping or are disabled in editmode. it is
   kinda confusing, but the interface only lets you toggle OnCage for modifiers
   that support it - it just might not be clear all the time why you can't
   toggle a certain modifier OnCage.
 - update displistmesh_copy to only copy edges if non-NULL

There is a display bug that already existed but is more obvious with
new modifiers where parts of the pane get drawn in a different area
after toggling editmode. It has to do with drawing parts of the interface
using GL instead of 100% buttons. I try to keep my grubby little toes
out of the interface code so this can wait for Ton to return.
2005-08-04 07:25:43 +00:00
d501f56e96 Bugfix #2875
Removed old code that was used when the global undo still saved files. It
was restoring pointers in the UI based on names, which gave confusing
results when loading the quit.blend file (actually undobuffer).
Instead it should treat the quit.blend same as "Load without UI" option.
2005-07-28 11:05:21 +00:00
8828aa060a - move zlib.h around to make windows happy
still having linking issues with zlib, grumble grumble
2005-07-27 21:31:44 +00:00
4b1588e277 - update storage.c to use standard time codes (should fix issue
with MSVS 8)
 - broke mesh_create_shadedColors out of shadeDispList, used to
   build vertex colors for mesh in vpaint as well (also fixed
   bug where they were not initialized correctly for subsurfs)
 - added modifier_copyData and modifier_findByType functions
 - change editmode modifiers to only calculate if Realtime and
   Editmode bits are both set, makes more sense for copying
   modifiers
 - update object_copy to correctly copy modifiers
 - removed duplicate redefinition of ME_ attributes in python,
   this is a horrible idea, why was it done in the first place?
 - update armature auto vertex group code to check for subsurf
   in modifier stack
 - fixed flip_subdivision to work with move to modifier stack
 - added copymenu_modifiers, can copy all modifiers or just
   data from first modifier of a certain type (not sure how
   to deal with multiple modifiers of same type... not
   a big issue though I think)
2005-07-27 20:16:41 +00:00
410512e265 Patch provided by Shaul Kedem: Compressed files are back!
He even made a nice doc in wiki:
http://wiki.blender.org/bin/view.pl/Blenderdev/Blendgz

Usage: set the option "Compress File" in the main "File" pulldown menu.
This setting is a user-def, meaning it is not changed on reading files.
If you want it default, save it with CTRL+U.

The longest debate went over the file naming convention. Shaul started
with .blend.gz files, which gave issues in Blender because of the code
hanging out everywhere that detects blender files, and that appends the
.blend extension if needed.

Daniel Dunbar proposed to just save it as .blend, and not bother users
with such details. This is indeed the most elegant solution, with as
only drawback that old Blender executables cannot read it.
This drawback isn't very relevant at the moment, since we're heading
towards a release that isn't upward compatible anyway... the recode
going on on Meshes, Modfiers, Armatures, Poses, Actions, NLA already
have upward compatibility issues.
We might check - during the next month(s) - on a builtin system to
warn users in the future when we change things that make a file risky
to read in an older release.
2005-07-27 19:46:06 +00:00
dacfebb115 Made do_versions() have proper arguments to do linked-library version
conversions as well, with proper check for each version of each linked
file.
2005-07-26 18:46:28 +00:00
951a4934b0 - added wave modifier & removed old wave effect
- added decimate modifier & removed old decimate interface
   (currently lacks warning about destroying data, and there needs
   to be a way for modifiers to return errors back to the interface)
 - allow applyModifier to return NULL to indicate error
 - unfortunately new decimate modifier means it does not know exact
   number of faces in mesh (other modifiers may come before) and so
   instead interface uses a percentage. if people need exact face
   count slider then I will have to think of some hack to fit this
   in. note that it does display the output face count so its possible
   to tweak the pct to get what you want regardless.
 - removed python Wave object

If you are bored now how much easier it is to implement something
like decimate as a modifier. Very few changes to interface, very
few entry points.
2005-07-26 02:44:59 +00:00
cb988ff8a9 - fix some error handling in blend loader, correct error codes
were not always returned.
2005-07-25 18:35:49 +00:00
9e502dae6f - bug fix, old files with me->subdiv==0 crashed, fix to make sure they
don't crash and also changed patch to properly init SubsurfModifierData
2005-07-22 15:09:54 +00:00
451161c29e - bump blender version
- warning fixes (unused vars)
 - added do_lib_versions for patches that need to happen
   after linking and updated some patches.

There are still issues where patches can go wrong, particularly
if an Object is linked from another file. However, this should
fix all crashes.
2005-07-21 22:34:01 +00:00
33709bf6e2 - shuffled editmesh derived function name/function
- added ModifierTypeInfo.freeData function
 - added modifier_{new,free] utility function
 - added ccgSubSurf_getUseAgeCounts to query info
 - removed subsurf modifier faking (ME_SUBSURF flag is no
   longer valid). subsurf modifier gets converted on file load
   although there is obscure linked mesh situation where this
   can go wrong, will fix shortly. this also means that some
   places in the code that test/copy subsurf settings are broken
   for the time being.
 - shuffled modifier calculation to be simpler. note that
   all modifiers are currently disabled in editmode (including
   subsurf). don't worry, will return shortly.
 - bug fix, build modifier didn't randomize meshes with only verts
 - cleaned up subsurf_ccg and adapted for future editmode modifier
   work
 - added editmesh.derived{Cage,Final}, not used yet
 - added SubsurfModifierData.{mCache,emCache}, will be used to cache
   subsurf instead of caching in derivedmesh itself
 - removed old subsurf buttons
 - added do_modifiers_buttons to handle modifier events
 - removed count_object counting of modifier (subsurfed) objects...
   this would be nice to add back at some point but requires care.
   probably requires rewrite of counting system.

New feature: Incremental Subsurf in Object Mode

The previous release introduce incremental subsurf calculation during
editmode but it was not turned on during object mode. In general it
does not make sense to have it always enabled during object mode because
it requires caching a fair amount of information about the mesh which
is a waste of memory unless the mesh is often recalculated.

However, for mesh's that have subsurfed armatures for example, or that
have other modifiers so that the mesh is essentially changing on every
frame, it makes a lot of sense to keep the subsurf'd object around and
that is what the new incremental subsurf modifier toggle is for. The
intent is that the user will enable this option for (a) a mesh that is
currently under active editing or (b) a mesh that is heavily updated
in the scene, such as a character.

I will try to write more about this feature for release, because it
has advantages and disadvantages that are not immediately obvious (the
first user reaction will be to turn it on for ever object, which is
probably not correct).
2005-07-21 20:30:33 +00:00
bacb560634 - readfile incorrectly increased user count for Lattice & Curve
modifier objects
 - make unlink_object clear Lattice & Curve Modifier object references
 - add expand_modifiers for liblinking

There really needs to be a more consistent and unified way of dealing
with datablock references between objects. It should be possible to
make this generic so that lib_link, expand_, DEP graph, unlink,
oops and maybe outliner can use a single API. The code to deal with
this is too bulky and error prone at the moment.
2005-07-20 18:04:50 +00:00
259c7b6cad - added modifier_dependsOnTime to check if modifier needs updating
based on time change. would be nice if dep graph could handle this.
 - made dep check if modifiers need update on time change
 - fix render crash (access null)
 - added new Build Effect modifier type. compared to old one works as
   a full member of modifier system, means can apply subsurf, etc on
   it, reorder, what have you. and it is all nice and self contained.
 - removed old Build effect, old files convert to new style on load
 - couldn't help myself, added a randomize feature to build effect
 - removed Python BuildEffect support
2005-07-20 04:14:21 +00:00
1df154d140 - split {curve,lattice,armature}_deform_verts out of mesh_deform
- removed mesh_deform (merge into mesh_modifier)
 - switch python lattice_apply function to use object_apply_deform,
   this isn't exactly equivalent but the python system shouldn't
   have been calling that deep into the kernel anyway.

New feature: Modifier stack
 - added Object.modifiers (list of ModifierData elements)
 - added DNA_modifier_types.h
     o contains type definition for the file data for the various
       modifier types
 - added BKE_modifier.h
     o contains modifierType_get_info (access to modifier type registry)
     o structs and defines for runtime modifier usage
 - updated mesh_calc_modifiers to evaluate modifier stack (note that
   for the time being it also evaluates the old style modifiers so files
   should load and work as normal).
 - add file handling modifier code (todo: don't replicate on object copy)
 - add modifier stack UI code (lives in object panel)


Only real new feature at the moment is that you can apply lattices and
curves *after* a subdivision surface which was never possible before.

Todo:
 - DEP graph updating does not work correctly yet, so you generally have
   to tab cycle to see results.
 - editmode calculation does not use modifier stack.
 - bug fixes (there must be a few in there somewhere)
2005-07-19 20:14:17 +00:00
09b5272639 - split mesh_deform off from object_deform
- changed mesh_modifier, sbObjectStep, object_deform to take vertexCo
   argument instead of operating on mesh
 - fixed bug where a derived mesh would not be returned in editmode
 - removed object_wave, replaced by init_wave_deform and calc_wave_deform
 - moved cached DerivedMesh to Object, not Mesh... fixes heisenbugs
   with linked objects
2005-07-19 02:36:21 +00:00
b58f7d0c55 - change mesh_get_derived_render to mesh_create_derived_render (always
builds new DerivedMesh... caching can come later)
 - split DerivedMesh returning functions into editmesh and mesh groups
 - got rid of DL_NORS displist type (get built on fly for mesh when
   needed)
 - got rid of Mesh.disp (yay!)
 - started to punch DerivedMesh returning functions into shape to introduce
   modifier stack
2005-07-19 00:21:01 +00:00
37fe347a59 - removed orco pointer from struct Mesh
- switch renderer to store orco's in a hash table instead of
   caching in mesh (I don't like the renderer caching data
   in the actual mesh structure)
 - added mesh_create_orco[_render] function
2005-07-18 18:28:16 +00:00
581df16520 - add DerivedMesh *derivedDeform to struct Object, this is temporary
until fullblown modifier system comes in, need it now to move forward.
2005-07-17 05:34:35 +00:00
e67ba0ae33 More armature goodies;
The B-Bones!
(where the B can be read as 'block' or 'bezier' or 'b-spline')

- set option on/off in edit buttons, armature panel
- scaling of B-bones only works in editmode, use ALT+S to make bones fatter
  or thinner. Also works for constrainted transform
- In pose mode, you now have a buttons panel with per-bone settings too
  Here you can find the "segments" button, which allows bones to
  interpolate between previous/next bones, including roll.
- Buttons to control interpolation ("In" and "Out" are disabled, doesn't
  work satisfying yet

NOTE: this doesn't give deform yet! Main purpose for now is to test if this
drawing method serves to animate/pose armatures well.
Still need to review proper interpolation methods... maybe bezier is too
limited.
2005-07-16 19:07:02 +00:00
5332854a7b - more warning killing: unused vars, double -> float constants, signedness 2005-07-14 22:21:12 +00:00
40bfa5c7a1 Appending armature crashed... nasty stuff, but works again :) 2005-07-14 22:04:57 +00:00
e5a639a161 New:
- XRAY draw for armatures now is generic "Draw Extra" option for any
  Object type. This feature just moves drawing to the end, after clearing
  the zbuffer again.
- Solid draw mode now displays materials with Alpha, with the new
  "Draw extra" option "Transp" set. This also moves drawing transparent to
  the end, but it doesn't sort the transparent faces. Still looks OK.
  Note: this is not enabled in mesh editmode. Here all the fancy extra
  drawing just makes it nearly impossible to do OK.
- Re-ordered Object Buttons -> "Draw" panel

Fixes:

- do_versions had check for the UserDef in it (new ogl texture cache).
  that can't be there, should be in usiblender.c (stupid exception).
- same error caused reading older files to not always fix version
  changes on armatures (commit yesterday).
- Outline select drawing happened also on picking-select draw, needless
  slowdown.
2005-07-14 12:44:33 +00:00
542358265b Couple of small fixes;
- cleaned up 'version correction' a bit. There was code slowing down
  current files even (armatures were evaluated all, even when not in
  current layer, was added to make sure they get converted OK).
  Send me old files that crash now! :)
- on reading older files with path-constraints, a fix had to be added.
- error "badd call to addqueue' found when using header-less window for
  filewindow
2005-07-13 13:30:51 +00:00
227a67e105 Bug fix #2774
Using linked library files with relative paths, didn't set the correct
relative root... so it only worked with files in the same directory.
ALso fixed the button-lock in material buttons, it didn't allow to see
which materials were linked to the mesh/object.
2005-07-10 11:00:27 +00:00
c8f195d00c - Fix for action constraints; for Bone targets (target is input bone
actually) only the relative rotation is used.

- Added scale=1.0 initializer in saving files, this fixes a little  bit
  better upward compatibility

- Still there are cases where bones flip 180 degrees when you read it with
  older Blenders... not sure what it is caused by
2005-07-09 13:41:01 +00:00
c68a0ea7c3 Image garbage collection settings init was in the wrong do_version branch (236 instead of 237). 2005-07-06 05:10:31 +00:00
22a18ecdb8 3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
	Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html


Image Memory Grabage Collection
	This adds memory handling to the image code. An image is tagged each time it is used.
	During a collection cycle (frequency of cycles is user defined), if an image is older
	than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
	Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.

	Notes:
		Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
		I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
		Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
		Collecting is called in draw_object, most likely not the best place to do it.
		Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)


Userpref DNA changes:
	I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.


Info window changes:
	I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
	Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.


Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
28a1e8277b Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs

A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;

- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes

Armatures;

Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!

Important to note is;

1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.

- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.

TODO NOW;

- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.

TODO LATER;

We now can do loadsa new nifty features as well; like:

- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...


Bugfixes;

- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change

-Ton-
2005-07-03 17:35:38 +00:00