Commit Graph

45 Commits

Author SHA1 Message Date
669c4dbecb Fixes, as reported by Basse
- Softbody Mesh didnt update when it was child of armature-posing
- Bone Stick drawing didn't draw selected in Solid + Object mode.
- WeightPaint + Subsurf (nice that it works!) didn't update on Bone
  selection
2005-08-26 17:48:46 +00:00
a978c122ee Making compiler happy;
- removed unused variables
- #if 0 around unused calls
- init of uninitialized vars
2005-08-24 20:26:28 +00:00
e12e2469c8 Bretch's patch for 2D transform. Thanks
Using new transform code to handle UV window.

With the ground work done, Transform could more easily be extended to handle IPO window now.

Tracker item: http://projects.blender.org/tracker/?func=detail&atid=127&aid=2946&group_id=9
2005-08-23 18:13:30 +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
29429d73f2 A couple of smaller fixes;
- Modifier Panel, name label for "Virtual" modifiers was too short
- On extrude Bones, "soft distance" now is always set based on length
  of the bone (also on CTRL+click, also when Envelope drawmode is not set)
- Added undo-push for "Apply Bone Envelopees to VertexGroup" in WeightPaint.
- Menu-buttons in floating panels sometimes gave drawing error
- InfoWindow buttons were always allocated & drawn, even when window was
  zero sized... waste of cpu, tsk!
2005-08-20 09:55:11 +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
b45ecb43ef New! When weight-painting a Mesh, and select a Bone, you can use transform
options on the Bone (G, R, S). The manipulator doesn't show btw.
Is usful to get immediate feedback on how painted weights behave with Bones.

Martin; I had to change the T_POSE behaviour in code a bit... it now
stores in TransInfo the actual posed armature being transformed. Maybe,
some day, we'll get mixed posechannel/object transform? Not much required
at the moment though. :)
2005-08-16 10:17:02 +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
184e4fdaae Two armature fixes;
- PoseMode selection accidentally always selected first bone as well (on
  multiple clicks)
- Hinge Bone didn't have correct inverse matrix in transform, for local
  rotations.
2005-08-13 18:55:24 +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
59672145a9 Cleanup & goodies for rigging geeks! :)
- PoseMode: Wkey menu, "Flip Left/Right Names". On selected bones, it flips
  the L/R tags in names, and calls the proper code to rename everything
  that's related (constraint targets, bone-childs, etc).
- PoseMode: Shift+S snapmenu: snap cursor to selected now works
- Outliner: select bones now correctly sets 'active' flag for bones,
  updating the UI as well.
  Also made sure you cannot select hidden bones in outliner.
- 3DWindow: in PoseMode/EditMode draws name of active Bone too (with user
  option "Draw active object name" set.
- Added the new Armature/PoseMode options in View3D pulldowns.

Cleanup:

- moved Pose code from editaction.c to poseobject.c
- removed BSE_editaction.h and BSE_editaction_types.h, moved contents of
  it to BIF_editaction.h. One include per C file should be fine. :)
  I know the src/ structure would require more elaborated includes, but
  we don't have that now...
2005-07-27 10:37:20 +00:00
13e6257ddf - switch displistmesh_to_mesh to just dupalloc the mface's
- added verteCos argument to sbObjectReset, lack of this was
   causing softbody objects to not be initialized with deform
 - made convert-to-mesh option call DAG_scene_sort, prevents
   crashes due to obsolete object pointer
2005-07-24 18:16:40 +00:00
0e2302bfa5 Big Transform Manipulator Merge
*NOTE*: Some UI decision done in this commit will most likely be revised, all flame shall go in /dev/null. Constructive discussions of course welcomed.

This commit merges manipulator orientation selection back in "traditional" transform.
That's how it works:
	- The dropdown in the 3D view header is always visible
	- The orientation chosen will be used when choosing an axis with MMB and for the *second* key press of X,Y,Z
		However, Local orientation doesn't use the one calculated by the manipulator. This is to ensure that multiple object local and armatures in pose still works as before.
	- Alt-Space (to change the orientation) works during transform


New Transform orientation: View, using the view axis.

Fixes for the following bugs:
	- Constraint projection code "jammed" if input vector was <0,0,0>, reported a couple of times on IRC. Thanks to Basse for the example file.
	- Transform on texspace crashed on objects without texspace data (camera, lamp, ...). This was reported in tracker.
	- Numinput with lock constraints didn't work correctly. Reported on elysiun

	Probably some others that I'm forgetting

I also moved a couple of functions around in an attempt to make things clearer.
2005-07-24 06:25:00 +00:00
1516381df1 - Armature editmode now supports lasso. Please be aware that in editmode,
armatures actually only consists of points, flushing bone selection
  based on points that are selected.

Renamed the "Lines" drawmode for bones to "Sticks". Thanks Basse! :)

- Fix; crash in selecting in editmode armature (commit 1 hour ago)
- Fix; in editmode, bones didn't transform (same commit)
- Fix; in drawmode "Sticks", names could go weird in editmode (commit
  two days ago)
2005-07-23 20:56:40 +00:00
fb651ddb4a - change mesh_calc_normals to set vertices with len(no)==0
to normalised coordinate (convention in blender, helps with
   halo)
 - removed vertexnormals(), vertexnormals_mesh()
 - removed CTX_NO_NOR_RECALC (always assume already calculated)
 - change NMesh.c to call mesh_calc_normals
 - chance load_editMesh to call mesh_calc_normals after done
   converting instead of using editmesh normals
 - update recalc_editnormals to also calc vertex normals (whats
   4 more adds and a sqrt among friends)

Its hard to believe, but it just might be the case that there
are only two places mesh normals are calculated now (renderer
and kernel)
2005-07-23 19:03:43 +00:00
948f27c0d8 Killed silly modal PoseMode mode! :)
- PoseMode now is a state Armature Objects can be in. So, while in PoseMode
  for an Armature, you can just select another Object or Armature.
- The old PoseMode options (transform, insert keys etc) are accessible
  with making the Armature Object 'active' (and have object in PoseMode).
- At this moment no multiple Poses can be transformed/edited at the same
  time.
- The old hotkey CTRL+TAB, and view3d header menu, still work to set an
  Object's PoseMode

It was quite a lot recode, so tests & reports are welcome.

Oh, as a bonus I added Lasso Select for Bones in PoseMode! It selects using
only the line between root and tip of the Bone.
2005-07-23 18:52:31 +00:00
19abd72baa Couple of fixes combined;
- With Actions on a Pose, ESC in transform restored wrong.
  This is solved similar to ipos now, storing a 'last time evaluated'.
  Could be extended to ghosting... soon.
- Moving the little yellow 'key blocks' in Action window didn't update
  3d window. ALso the 'lock' option didn't work, and flashed header.
- Pose Transform: noticed there were still errors in cases, especially
  with actions. Painfully tried to build the desired matrix now.
- Removed obsolete Bone pointer from TransData
2005-07-19 16:12:56 +00:00
e700b79587 Removed last remainder of old transform. The function is still called
special_aftertrans_update() though...
2005-07-19 11:21:01 +00:00
1baf64cd45 Bug fix; pose mode transform didn't count # of selected bones correctly,
skipping selected bones with parent but without "IK to Parent"
2005-07-19 08:02:27 +00:00
a8a69f5f63 - The "in" and "out" interpolation values for B-Bones were not copied to
and from editmode Armature

- Altered 'axismat' for PoseMode bone transform. Fix for bug #2769, bone
  rotations using hotkey-constraints (R, Y, Y) didn't work well.
2005-07-17 08:56:51 +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
70271db367 Corrected the Armature option "Delay deform", which doesn't update its
children during transform... to make it work, had to trick the nice
depgraph code... <sob> :)
2005-07-11 13:59:02 +00:00
5b24b2d31e Two little bugs showing up in workshop;
- update_for_new_frame() (on frame advance, alt+a) crashed when no 3d view
  was opened ever (NULL pointer)
- using proportional mode on Curve editing wrote beyond end of a malloced
  block. Just a minus one needed here...
2005-07-08 06:55:10 +00:00
6a2cf42b7d Well, it's better if the spelling is corrected everywhere the variable is used... (why must I make that kind of error?!) 2005-07-06 08:14:13 +00:00
167110c3aa After much debate on IRC, it was decided to spell "cancelled" properly... 2005-07-06 08:09:51 +00:00
f0ae48dfe5 Pressing ESC on armature posemode now restores position correctly again. 2005-07-06 07:31:43 +00:00
a4e959b369 Merging error... rotating bones in pose-mode, with an action inserted
accidentally flushed recalc of Pose. So it popped back to the action state,
preventing editing new keypositions.
2005-07-04 17:41:58 +00:00
71f3e88293 Fixing pose mode transform.
With new system, very easy to do in the end (figuring it out was less so).
	No need to go down parent chains or anything of the sort, just apply parent pose and we're all set.


Ton's commit reverted back before my include files cleanup in transform, recleaning.

Also, as mentionned by bjornmose, declaration after instruction choked MSVC. Fixed.
2005-07-04 05:16:54 +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
Nathan Letwory
c91355f3b6 Rollback of http://projects.blender.org/pipermail/bf-blender-cvs/2005-June/003769.html (which I in my commithappyness did before properly checking) 2005-06-11 16:30:36 +00:00
ac30fd8b3e Fixed crash on transform_conversion with PET and hidden CV in a curve.
It now deals correctly with hidden CVs in Connected mode (creates a "segment" on each side of the hidden CV).
2005-06-11 02:01:26 +00:00
Nathan Letwory
07fb86d355 * fix for bug #2733 2005-06-10 13:55:09 +00:00
bb4710d2c9 Fixing bug #2707 : Local Axis constraints in transform working incorrectly on objects that have object constraints.
http://projects.blender.org/tracker/index.php?func=detail&aid=2707&group_id=9&atid=125

Problem was as suspected (axismtx defined after clearing constraints), so very easy to fix.
2005-06-06 12:23:47 +00:00
1d7a8cf86f Two more fixes in Transform:
- Ipokeys didnt have 'selected' flag, so were not included in center
  calculus
- Multiple keys transform didn't apply this center even...

ALso took extra work time to add credits in splash. Frédéric Van der Essen!
2005-05-29 23:21:56 +00:00
f26e4ca150 While making TransData, with mixed selection of objects and ipokeys, the
transdata pointers were increased wrong, creating empty gaps (NULL)
2005-05-29 22:39:49 +00:00
b1bd69c6f1 Changed 2 mallocs for object transdata to calloc. TransData->flag was
undefined... and somewhere else in code it thought there was a quaternion.

No idea why these mallocs... just asking for troubles!
2005-05-29 22:12:12 +00:00
505ab0bf78 Bug fix #2617
Using ipokeys with rotate crashed... caused by bugfix in ESC on ipokeys I
did before. Got confused by non-initialized (malloc) transdata...
2005-05-24 10:03:53 +00:00
8077caa96e Bug fix #2528
Transform on "ipo keys" gave crash on ESC, due to non initialized pointer.
(Martin; that idea to not calloc new data... grumble!)
Note; that's another Margarita for Randall, at the Figueroa pool. :)
2005-05-08 20:44:59 +00:00
b33536cdaa Two little issues for Timeline window;
- Using Arrowkeys to change frames didn't give proper redraw
- Option "Record" now tied to the User-preset "Auto key insert". It is
  no user preset anymore even, I thought to leave a button in the User-
  presets for the time being though...
2005-05-05 18:31:39 +00:00
3b2c30dae4 Another big cleanup, thanks to transform recode. Could do this stage
because Martin recoded the Mirror().

- removed old globals like 'tottrans' or 'centre' or 'centroid' as used
  by old transform
- removed a lot of code from editobject.c
- moved all transform related code to transform_conversions.c
  (Note for Martin; sorry that's a mess... it now has all the weird
   functions for finding posemode dependencies... thats for the depgraph
   phase to remove)
2005-05-04 12:53:35 +00:00
c1a7b8b7a1 Local axis constraints for pose mode. Added
Camera rotation fix (was off centered because it used persinv instead of viewinv. Now rotation center is always center screen in camera mode. (Still need to fix the helpline not showing)
Numinput constraint function was no good, didn't check if a constraint was even on... Fixed.
Rotation was missing constraint text in header print. Fixed.
2005-04-22 01:14:15 +00:00
425f295604 Patch submitted by Jorge Bernal (lordloki) and Jonathan Merritt.
This will add Minneart diffuse and WardIso specular to our shader menu.
Minneart gives nice control over darkness/brightness areas, the wardIso
over 'plastic' style sharp or fuzzy specular.

Webpage is being made with nice samples. Will be in release log.

Jorge: one change is in the do_versions, you inserted it on wrong location.
2005-04-17 17:43:07 +00:00
78939c0cc0 - It is possible to scale radius of MetaElem again.
- It is possible to change dx, dy and dz params in 3Dview with manipulators
    or with some shortcuts (S-X, S-Y, S-Z).
 - User can scale stiffness when green circle is selected.
 - MetaElem is selected with RMB click at green or red circle, then user can
    grab or rotate with MetaElem as usual.

 - Screenshot:
    http://e-learning.vslib.cz/~hnidek/pics/scale_stiffness.jpg

 - Captured video:
    http://e-learning.vslib.cz/~hnidek/captured-videos/scale_stiffness.avi
2005-04-11 19:31:05 +00:00
bb9548fd16 Silly pointer set on wrong place in code, caused Bones transform in
PoseMode not to work on branched armatures with multiple selected.

Thanks Richie for the test file!
2005-04-11 15:14:07 +00:00
4ea8947ea7 Merged all the internal transform includes into transform.h and moves it to /src to /include.
Split the conversion fonctions and sorting functions from transform.c into transform_conversions.c
Update MSVC 6.0 projectiles and SConscript accordingly.
Editview still included transform.h, replaced that for BIF_transform.h, the external include.
2005-04-10 18:33:19 +00:00