Commit Graph

283 Commits

Author SHA1 Message Date
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
Alexander Ewering
5a7a2e8f78 Fix drawing of text frames inside editmode, stupid error. 2005-06-17 23:30:39 +00:00
Alexander Ewering
97df61a7e5 Initial commit for new text object.
Important notes:

 - Full compatibility with old text objects not fully restored
   (word spacing will be 0.0, need to set it manually to 1.0), will
   either need version upgrade to 238 or a hack. Will check.

 - lorem.c (about to be committed) contains BF copyright notice, but as
   BF did not exist a few hundred years ago, probably best to remove it :)

 - If you notice any cross-platform issues (especially beloved windows),
   please report

 - A few tiny warnings left, I will fix those issues still.

The rest has been said already - so have fun testing. And please do!

=== Reminder:
=== Documentation at http://blender.instinctive.de/docs/textobject.txt ===
2005-06-17 21:04:27 +00:00
25a4b8fa07 Bug #2661
Drawing face stats in editmesh didn't work... a typo caused using the 2nd
point of a face as third one.
2005-06-01 18:36:58 +00:00
53082cf0f1 Bug fix #2575
VertexPaint, FaceSelect draws with 'culled faces' but should therefor
check for negative scaling as well, set the glFrontFace() OK.
2005-05-26 21:00:50 +00:00
563af2aac1 - stiffness circle of MetaElem isn't paint in Object mode now 2005-05-22 19:16:04 +00:00
422b69fe1e UI cleanup work;
Proportional edit:

- Proportional mode added to header as button/menu. Including new option
  to have only connected geometry influenced.
- Added icons for proportional & proportional modes
- Make proportional edit data part of Scene, so all gets saved.
  The Global flag G_PROPORTIONAL was removed
- Made sure #defines get used properly, also tweaked order for proportional
  so it starts with regular 'smooth' by default.
- Use ALT+O in editmode to switch to new proportional 'connected' mode

Other UI stuff:

- in EditMode, the layer buttons get hidden... the amount of icons in
  3d header grows to fast. :)
- made less ugly icons for the Manipulators. Still can be better.
- Added alpha-filter for pre-processing Icon-image, giving nicer display
  of icon-antialising on dark or bright backdrops
- disabled Manipulators when in editmode, and current layers don't show
  the edited data.
- Added the value used to define Normal size (editmode draw) in Scene too,
  so it gets saved.
2005-05-03 10:54:42 +00:00
42126cb5fc Added baking for softbodies.
Works as follows;
- press the 'show bake settings' button (no space left... :)
- define start/end frame for bake, and an interval step.
  The baked result interpolates nicely (Bspline, 4 keys) so in general a
  step size of 2 or 3 still gives OK results.
- Press "BAKE". This will do a full animation + playback. Press ESC if it
  you don't want it.

Once Baked, the BAKE button becomes a FREE BAKE. As reminder the softbody
buttons get blocked with error() menu.

This saves OK in a file. Renders any frame, including fields and moblur.
You can also set a "Timeoffs" for the softbody. And yes, this should be
in the NLA once... :)

NOTE! With this commit, files saved with the old (first commit) version by
Jens Ole won't read the settings back... he stored all sofbody variables in
Object, which was moved to a new struct when I did my first commit on SB
(over a month ago)

Also note that I moved particle deflecting & softbody to a new include.
2005-05-02 13:28:13 +00:00
b7a927cc95 More stats-junk stuff!
Added in Nkey panel (transform properties) option to show in editmode
at choice the global or local coordinate values.
Same option works for the "Tech draw" options. :)
2005-04-29 18:43:17 +00:00
73f88ae286 To please the stats-junkies: the "tech stat" drawing now displays all
values that change during transform().
For the rest drawing sticks to actual selection, making the view quite
less cluttered. Hope this gets approval. :)
2005-04-28 15:41:09 +00:00
3dbae624d3 * Brought over a 'mode' parameter to drawcircball to prevent
further loss of Hos' hair during tuhopuu merges.

This doesn't change any user functionality. 'Mode' can be
GL_LINE_LOOP for a circle outline (as it currently is), GL_POLYGON
for a filled circle, or whatever gl mode you like.
2005-04-20 08:26:22 +00:00
71f619cd23 - make sure object outline doesn't get drawn in faceselect mode 2005-04-14 13:46:49 +00:00
9b354599e0 - fix for bug #2385, mesh outline wasn't drawing in potatoe mode 2005-04-13 11:46:46 +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
6fabf998e8 - bug fix #2433, mesh not drawn correctly when only edges
(and Mesh.medge).
2005-04-10 14:31:04 +00:00
b1675a345a - made shadedisplist not free all object displist data...
this messed with data caches which messed with assumptions made
   by drawing code (and was just silly not to mention). here
   be dragons...
2005-04-10 00:00:34 +00:00
7a377bcb05 - Made SoftBody work with Particle Force Fields.
- Added new (Particle) Deflector; type Wind.
  Wind gives constant directional force. It is animatable (Ipos) and reacts
  to Object scaling. Also uses FallOff. Works for particles and SoftBody
  quick movie check; http://www.blender.org/bf/0001_0250.avi
  test file is in download.blender.org/demo/test/wind_soft.blend

- Added MaxDist option for forcefields, to control its influence better.
  Is drawn as circle in 3d window.

Forcefields are a bit weak still... should react to scaling, or not; in
that case drawing should indicate it (done for spherical field now).
2005-04-04 18:09:47 +00:00
ec577aafaa - hidden edges were being drawn when DRAWEDGES was off 2005-04-03 15:13:38 +00:00
0d78b56c5b - mesh was drawing edges underneath selected edges in optimal mode,
waste of time!
 - made solid face drawing respect hidden faces
 - made selection work for hidden face drawing when select visible is on
2005-04-02 18:21:50 +00:00
d4b9ace5ae - adapt to reprototyping in BKE_DerivedMesh.h 2005-03-31 15:57:18 +00:00
aa41e1ddc3 Bug in new drawing code; hack with storing stuff in editvertex->prev did
not get restored OK. :)
2005-03-30 10:12:05 +00:00
347619f501 - fix silly bug in mesh DerivedMesh tex drawing func (only was drawing
first face.
 - change DerivedMesh callback prototypes to help eliminate errors
2005-03-30 05:57:40 +00:00
ae07d869a6 - strange drawing bug, wierd vertices were showing up (wrong
DerivedMesh call)
2005-03-30 05:35:01 +00:00
cfd90889e2 - made some DerivedMesh drawing functions more generic (take callback
to determine if element should be drawn and to set draw options),
   which meant some could be combined - eases implementation of new
   DerivedMesh types and keeps more app specific logic out of DerivedMesh
   implementations.
2005-03-30 00:32:10 +00:00
e229722d5b - added Mesh->derived and Mesh->decimated DerivedMesh pointers
- removed DL_MESH displist type!!!! Now store a DerivedMesh directly.
 - May still be some issues left having to do with releasing this
   at the right time (old code just splashed free_displist all
   over the place).
2005-03-29 16:43:39 +00:00
29aae3452e - added getMappedVertCoEM and drawMappedVertEM to DerivedMesh with
implementations (slightly redundant, could implement draw in terms
   of first... can be cleaned later)
 - switch to use of new APIs... all uses of EditVert->ssco are now
   clean (read: ready to die as soon as a proper DerivedMesh implementation
   is swapped in with ccgsubsurf)
2005-03-28 07:10:32 +00:00
8acfd730cf - added drawMapped{Verts,Edges,Faces}EMSelect calls to DerivedMesh with
implementations
 - updated drawobject selection code to use DerivedMesh (last DispListMesh
   usage in drawobject.c that needs to be replaced! Woot!)
 - interface could still be a lot cleaner, mostly calculating indices for
   the various things to pass to selection color routine is hacky.
2005-03-28 06:46:21 +00:00
a0feaebfa5 - added set_framebuffer_index_color (shortcut for
cpack(index_to_framebuffer(index)) but that is all that is ever
   used.
2005-03-28 05:55:45 +00:00
21a4e28fb3 - non-optimal subsurf was drawing regular mesh faces 2005-03-28 01:21:27 +00:00
35aa81cd2c Scary commit!
- Switch to using DerivedMesh interface for draw_mesh_object.
 - Code builds a "fake" DerivedMesh for Mesh/EditMesh which ends
   up making code a lot clearer.

Plenty of work to be done - the DerivedMesh is still very specialized
to how the code draws which means it is not a very general interface
and is a little messy. Should work though I hope.
2005-03-27 20:39:28 +00:00
577f822a40 - lamp line was drawing in wrong location 2005-03-26 21:41:39 +00:00
f102ee24e1 - shademodel wasn't being set correctly for normal mesh face draw 2005-03-26 19:47:22 +00:00
b92e0d1723 - remove some unused variables from cleanup
- fix for when mesh has no medge (would draw as points always)
2005-03-26 19:42:37 +00:00
5c87aefa4b - integrated get_mvert_weight and color_temperature
into drawobject.c (just used for calculating weight
   map)
 - removed two_sided (replace with glLightModeli calls)
 - huge rewrite of drawobject.c for meshes, extracting simple
   drawing functions and then reworking to bring some order
   and clarity back to the code.

   A lot was changed here so it is likely I missed a few
   things in testing although I tried to be very careful.
   Please let me know if you find any changes in drawing.
2005-03-26 17:29:37 +00:00
727a056de4 A couple of wee transform featurettes;
- center of rotation for camera in cameraview rotate has to remain the
  camera center itself, drawing the dashed helpline then doesn't work,
  since it's behind the camera clipplane. Just disabled that line.

- made MMB switch for cameraview grab to become quadratic, for a dolly
  this feels OK, and makes it possible to move in small and large scenes.

- restored SHIFT modifier for translation and scaling. This based on old
  convention that allowed precision editing on top of the transform you
  already applied before pressing SHIFT.
  Solved it with a new flag (T_SHIFT_MOD), since the G.qual cannot be
  used. Transform() innerloop has to detect the SHIFT event itself.
  Also coded it with storing the mouseposition while SHIFT event happened.
  Hope Martin can approve! :)

- Martin's last commit made Manipulator Translate not work, it passed on
  a zero translation to the constrainter, causing NaN's. Nicely catched the
  exception.

- Fixed 'Trackball' to accept number input too
2005-03-25 11:17:59 +00:00
aab0b1535f Transform stuff for TEST!
- 4th rotation widget styling, activate with Scene buttons, Anim panel, "rt"
  on "4".
- drawing constraint lines replaced with widget compatible styling.
  (functionality unchanged)

Fix;
- click on center for Rotate widget didn't switch to local/normal in all
  cases
2005-03-23 11:49:54 +00:00
8e92ee8684 - remove all obsolete inclusions of BLI_winstuff.h (due to recent changes)
NOTE: BLI_winstuff.h was meant to be a wrapper around windows.h to handle
undefining various crap that windows.h defines. Platform specific headers
should only have to be included in a few places. This reduces the number
of inclusions of BLI_winstuff.h to 16 which is a much more reasonable
number (than the 144 or whatever it used to be)
2005-03-19 21:08:13 +00:00
35ab8a32a1 Global G.moving got nice define flags, and additional meaning.
- move object mode
- move editmode/pose mode
- move with widgets
2005-03-19 20:27:13 +00:00
a2ed880c9f Transform widgets; Scale and Rotate versions
To use; press the (temporal) icon in header. Switching widget types is by
pressing G, R or S once, if current widget type is different it switches,
otherwise it goes to normal Transform().

Widgets need a bit test for picking accuracy, correct drawing etc.
The rotate widget has a center button for 'trackball' rotate. That latter
can also be used for hotkey-based rotate.

In current code, all widgets remain in "Global" space, also in editmode.
Also widget updates while using normal transform has to be done.

2 Bugfixes:
- rotate in PoseMode had error for 2d 'around' center
- transform in postemode could crash, due to typo (& or |)
2005-03-19 12:17:06 +00:00
e9381e61aa Bug fix #2320
Silly 2.36 bug! In FaceSelect mode, other solid objects didn't show. Bad!

Additional; when using Halo material, and setting 'X Alpha', and disabling
Halo option, the 'Only Shadow' option turned on... uses same bit...
No time for real fix here, so for now the bit is always cleared after
disabling Halo.
2005-03-15 12:30:58 +00:00
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
118e4bcf7b Transform project. Daily update:
- Pose Mode restored
- Dependencies work again as usual (mainly copied old code)
  so grabbing a Hook deforms, etc
- Made main transform loop idling nicely (save CPU)
- removed proportional mode for Objects (Martin OK'ed)
- code style: renamed "tv" into "td" variable names (trans-data now)

TODO:
- Ipo Key-mode editing
- texture space grab/scale
- correct inverse for scaling children offset
- actually, loadsa testing needed. :)
2005-02-22 16:50:04 +00:00
09f21e45d7 First commit for the transform coding for me!
- fixed warnings in compile (transform.h struct defines)
- drawPropCircle was on wrong location in editmode
- removed prop circle drawing for old transform (sorry, but we're going to
  move soon anyway!)
- removed spaces from transform.c
2005-02-19 16:37:48 +00:00
996374bb5a Fixed old annoyance; enabling true Ortho render in Blender.
It used to be a simple hack, scaling lens with 100, and moving the camera
to the back with an equivalent amount.
Because of the hack, making it 100% compatible with older files I could not
achieve (yet?). To help reminding users, I've added a print when reading
old files with Ortho cameras.

Full description of how it works can be found here;
http://www.blender3d.com/cms/Render_changes.515.0.html
2005-01-30 11:25:27 +00:00
912ef80bdc big softbody commit
some vertex group , weight painting stuff too
/me crosses fingers it does not break anything
2005-01-12 22:28:13 +00:00
3c921cc8e8 The "teac" (measurement info) patch from Campbell Barton
Cleaned code somewhat (half the size!) and applied some changes:
- made it compatible with selection flags for new mesh editing (edge/face)
- renamed 'face angles' to 'edge angles' and made it display angles for
  2 selected edges too
- removed the confusing convention that always drawed the info if one
  of the vertices of edge/face/angle was selected. now it only displays on
  minimum of 1 full edge or face selected.
- made it react to "zbuf occluded selection" option (for zbuffered text)
- made it also colorize text for white theme color (TH_TEXT)

On larger meshes this info still draws very confusing. The idea of displaying
the info on 1 vertex selected was probably to show values while grabbing,
although that didnt really work for angles. One idea could be, for transform,
that it draws all lenghts/angles/areas that get changed during transform

All in all, still useful addition tho!
2005-01-08 21:16:24 +00:00
7b3768138c Small fix:
- if object mode && G.vd==OB_TEXTURE, drawing mesh objects did not check
  object's max drawtype (ie. dt).
2004-12-31 10:48:42 +00:00
610cec55c7 Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
  Currently only works with alternating scanlines, but gives excellent
  performance. For both normal render as unified implemented.
  Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
  getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
  OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
  with chars or shorts.
- Made normal render and unified render use same code for sky and halo
  render, giving equal (and better) results for halo render. Old render
  now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
  after render. Using PostProcess menu you will note an immediate re-
  display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options

- Render module is still not having a "nice" API, but amount of dependencies
  went down a lot. Next todo: remove abusive "previewrender" code.
  The last main global in Render (struct Render) now can be re-used for fully
  controlling a render, to allow multiple "instances" of render to open.

- Renderwindow now displays a smal bar on top with the stats, and keeps the
  stats after render too. Including "spare" page support.
  Not only easier visible that way, but also to remove the awkward code that
  was drawing stats in the Info header (extreme slow on some ATIs too)

- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
  defines.

- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
d109dc7685 Two small fixes;
- on exit editmode, displist for subsurf was not made, causing static
  particles to calculate wrong
- static particles were not selectable
2004-12-03 23:22:21 +00:00
8896a50807 Selection on faces now includes the facedots in solid/visible-only mode. 2004-12-02 16:01:15 +00:00