Commit Graph

157 Commits

Author SHA1 Message Date
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
a7e250e85c Bug fix #1937
In unified render, halos can give black/colored overflows. Found it this
happens with halos that are behind the camera clipping range. Halo clip
just had some weird code for panorama corrections...

In the provided .blend of report found 3 more glitches;

- after render particle system with Material Ipo, values for material were
  not restored correctly
- Meshes with particles didn't draw axis (draw extra) on correct location
- Same as above, axis didn't draw in selected color.
2004-12-02 14:52:40 +00:00
8fc85d9c8f Three little fixes as reported by Campbell;
- Mesh editmode; SHIFT+F fill didnt set default vertex color
- Parented spotlight had wrong (black) dashed line to parent when selected
- Constraint line draw while transform wasn't reset, causing sometimes to
  draw when using the (ugly) G.moving flag...
2004-12-01 22:35:42 +00:00
4ef448cc51 Small tweaks to make 3d drawing a tad more interactive, and; something
for our interactive 3d artists!

- AL+Z (potato) texture view now draws objects without Texture Faces
  compliant with (new) default in engine. Meaning lit faces, using
  Material RGB for diffuse and specular. It used to draw these as 'shaded'
  which is quite useless.
  Per definition, Potato mode is supposed to show what engine draws.
  (Note; this only for Mesh objects)

- Added a couple of more calls to ensure Shaded drawmode updates on
  changing RGB sliders, moving lamps to layers, or switch layers

This based on feedback from Mal, who'll also give it all good tests.
2004-11-25 21:52:07 +00:00
5989da1442 Bugfix 1781
Small draw error in camera objects from camera view (one from 1995 or so!)
Camera size depended on clipsta...
2004-11-11 23:55:16 +00:00
1197c4842a Forgot that me->mface is void pointer (bad!)... fix found by Nathan. thnx! 2004-11-09 12:16:00 +00:00
b00b82ca73 Fix for #1749
In solid drawmode, objects with wires didn't show nor were selectable
2004-11-08 22:25:34 +00:00
0eb05b9d25 Three cosmetic fixes;
- Mesh editmode, draw 'bleeding edges' works again for subsurf (not optimal)
- New draw method (again!) for armature-add-bone loop. Should work now! Is
  also nice for cpu this version
- Draw screen edges (black lines inbetween windows) should not draw leftmost
2004-11-08 18:39:09 +00:00
02e838c99b - Pending Hook work; falloff value for soft hook deformation.
Falloff= distance where influence becomes zero.
2004-11-06 21:59:35 +00:00
b169abb4cf Bug fix #1678
Deformed meshes (by armature for example) didn't get drawn correctly
for vertex paint, weightpaint, UV faceselect. Was OK in 2.34 :)

Additional to that I found out vertex paint doesn't correctly use the
'Area' option, when a mesh was deformed. That was an oldie.

Plus; made tooltips for 'Area' and 'Normals' in Paint Panel clear.
2004-11-05 12:58:12 +00:00
0ad6944283 - MBall displays smooth again in 3d win (coding nice smooth for curves
borkened this... )

- Improved rule for adding face (FKEY); it now checks first for existance
  of 4 connected edges, if that exists a face is created anyway, otherwise
  it does the convex test. Alexander correctly noted that for subsurfs
  non-convex quads should be allowed anyway. Hope this rule satisfies it.
2004-11-04 15:35:24 +00:00
a89a4f531c - Bug #1714; editmode undo error when ESC after extrude (missing undopush)
- Curve Join now moves all curves to 2D (if its 2D)
- FGon extrude keeps FGon flags correctly
- After Append undo-push added
- In almost all Ipo editing commands; undo-push added
- Icons in outliner now all consistant grey
- Zoffs button had to 20 high (hmetal :)
2004-10-31 21:11:03 +00:00
6c04fe887e Just some nice updates in drawing (extruded) Curve objects;
- display of 'smooth' or 'solid' is correct now
- standard bevel and extrude displays in 'smooth' correctly now (with sharp
  edges where you expect it)
2004-10-31 13:51:36 +00:00
d292541cac For solid display of curves in editmode; found fix (thnx intrr :) that
hopefully prevents weird results in grabber... error was that the
editNurb was not used for triangulating.

Also; added drawing the wire as extra in solid display editing curves...
that for unfilled curves as well.
2004-10-30 20:46:10 +00:00
d149a79ad1 Wybren report #1709:
Deleting only-faces from fgon still draws wires hidden in editmode.

Added extra: when mesh has no faces, it draws wire in solid view, also
doesn't draw the 'fat' outline for selection.
2004-10-30 13:42:49 +00:00
408702009e Finally something new!
- in Solid draw mode, curves without faces draw as wireframe now
- in Solid draw mode, curves without faces don't get fat outline on select
- in Solid draw mode, editing curves shows filled now!
2004-10-29 15:39:01 +00:00
f33f2abe39 Two more wavk bugs (help he's pestering me!)
- 1702; edge selection should be evaluated properly before adding face
- 1704; crash in separate, two causes here:
        - separate didnt make selection flags consistant (needed badly
          there because of evil code)
        - after adding quad (Fkey) the face was not selected, but its
          vertices were... that can give bad bad crashes
2004-10-29 14:30:20 +00:00
55478b2616 New 'visible only' select didnt work correct when parts of faces were
hidden. The drawing function needs to return the actual face total, not
the amount that was drawn
2004-10-28 14:13:46 +00:00
0512a1032c Bug #1686
Subsurf, optimal; the outline-selected-draw now uses a normal wireframe
(not optimal) giving a nicer outline.
2004-10-27 09:25:55 +00:00
070d01dd68 Two fixes!
- undo system didn't work in editmode AT ALL!!! (stupid me)
- Lattice deform on non-subsurfed objects did not update
2004-10-22 14:03:20 +00:00
4c827e73e2 Four new extrude possibilities;
- Individual faces
  Keeps Mesh manifold, so removes old faces always. Also uses a
  transform based on different vectors per vertex.

- Only edges
  Just extrudes the edges (not really 'individual', the edges still
  share the vertices. Uses same transform as normal extrude for that
  reason

- Only Vertices
  Uses normal transform after extrude

Also changed code a bit, to detect whether to call a normal-based
transform after extrude, or whether to call normal grabber. For example
when you just extrude 1 edge, it uses normal grabber.

Note; extruding an entire sphere goes OK with 'individual faces'. for
other extrudes you should press 's key' when in transform. Just cannot
predict (yet) when one method has preference over another.
2004-10-18 22:47:26 +00:00
0f95db92c6 Draw Seams in subsurf optimal mode. They were already subdivided correctly,
just needed to be drawn.
2004-10-12 15:23:00 +00:00
42ecc3c56d Face selection in uv face select mode, with hidden faces, was broken:
there was no check for hidden tfaces in backbuffer draw.
2004-10-12 15:15:10 +00:00
acf754e9e2 Fixes in editmesh:
- ALT+B loop edge select loop
- SHIFT+R loop face select loop
(both work with ALT+select too)

- CTRL+R loop cut
- Kkey menu, loop select/cut and knife

- and ALT+select on edge always selects a loop now
2004-10-10 19:41:43 +00:00
7b99fb79c3 Fix for reported Mesh+Subsurf+Optimal+particles, make linked duplicate, and
editmode crashed.

Cause: the stricter rules for when displaylists should be made failed on
the check for Effects (like particles).
2004-10-10 16:54:25 +00:00
d5e0c065bc Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.

After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.

The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.

I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:

- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
  extra things:
  - activates a scene
  - selects/activates the Object
  - enters editmode (if clicked on Mesh, Curve, etc)
  - shows the appropriate Shading buttons (Lamp, Material, Texture)
  - sets the IpoWindow to the current IPO
  - activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view


TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
04f5baee3a OK. Here's the long awaited first step (V0.01!) of SoftBody. It is called
from within mesh_modifiers (kernel deform.c). It copies vertices to a
temporal particle system (struct SoftBody with BodyPoint structs) to do
physics tricks with it.

For each frame change the delta movements (based on standard ipo anim or
even other deforms (later) are applied to the physics system. How to apply
and calculate satisfying results is not my thing... so here I'll commu-
nicate with others for.

Since it's in the modifier stack, the SoftBody code can run entirely on
original data (no displists!).

Right now I've implemented 2 things;

- "Goal" which is a per vertex value for how much the current position
  should take into account (goal=1 is without physics). This is a powerful
  method for artists to get control over what moves and not. Right now i
  read the vertex color for it.
- And some spring stuff, which now only works based on force moving it to
  the originial location. This doesnt work with 'goal'... erhm.

- You can re-use physics vars from engine, used right now is (in Object)
  - damping
  - springf (spring factor)
  - softflag (to set types, or activate softbody for it

- The SoftBody pointer in struct Object is only runtime, nothing saved in
  file

To prevent all users going to complain it doesn't work, I've hidden the
functionality. :)
The buttons to set softbody 'on' only show now (psst psst) when the object has
name "soft" as first 4 characters. You can find the buttons in the F7 Particle
Interaction Panel (which should be renamed 'physics properties' later or so.

Demo file:
http://www.blender.org/bf/softbody.blend
2004-10-01 14:04:17 +00:00