Commit Graph

182 Commits

Author SHA1 Message Date
0574768f88 Animated UI for TimeLine "Play"
Using the Play button in timeline, now uses an event-driven system to
update the animation system and signal windows to redraw. Meaning the
full UI remains responsive!

Check the new Pulldown "Playback" to set which windows you like to see
updated. Same settings is used for LMB 'dragging' frames in Timeline.

Implementation notes;

- the Icon for 'Pause' (or stop) has to be made yet, I commit this from
  my laptop... all was coded during a 2 x 5 hour train ride to germany
- the anim playback system (ALT+A too) now uses correct "frames per
  second" as maximum speed. Buttons can be found in 3 places in the UI,
  also added it as pulldown item
- The system works with 'screen handlers', which has been coded with
  using Python (networked) events or verse in mind too. A doc on that
  will follow.
- the buttons code has been made 'resistant' to animated UIs too,
  preventing flashing of hilites.
- All subloops (like transform) stop playback, with exception of MMB
  view manipulations.

As extra; found tweak to make Textured AA fonts draw without distortion.
Looks perfect here on laptop now (like Pixmap fonts) and is 20x faster.
2005-05-11 20:01:42 +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
8b99bfb173 Added menu in header for orientation of manipulator widgets.
Also slightly tweaked threshold for drawing text in menu buttons. The text
was clipped just too quick.
2005-04-28 17:04:08 +00:00
3fd3728000 Fix for centered submenu (for example py export script) also worked
when menu didn't open to left/right but on top/bottom. Caused errors...
2005-03-30 14:17:53 +00:00
7b6ec97182 Bug fix #2311
File name (40) and dirname (80) were too short in sequence data. Made it
compliant using defines FILE_MAXFILE and FILE_MAXDIR.
Also replaced all strcpy() and strcat() with strncpy/strncat, with the
defines in it.
Oh, also fixed plugin path length for sequence, was just 80!

Bug fix #2366

Restored old convention that made using SHIFT+CTRL while using button-
sliders go with 0.1 stepsize of CTRL.
(noticed too late that Chris Burt assigned to self... sorry!)
2005-03-24 09:37:06 +00:00
21aadaecdd Small fix; when pulldown menus are too large to display (they get aligned
with top/bottom to active button) the menu aligns from bottom of blender
window.

This already happened for File->Export menu
2005-03-22 15:56:58 +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
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
136ecd4644 Modified interface texture font support, which should work nicely with the freshly added bFTGL library.
Also removed some redundant #include's on some files.
2005-01-21 14:48:03 +00:00
9fddd2bdec Added experimental option to use GL textured interface fonts.
Set preferred method in userprefs->language & font.
Kinda requested by Kaito, i'm sure he regrets after seeing
my code changes.

This commit includes a patch provided by Jacques Baurain,
which seemed nescessary to handle font sizing properly.
Thank you !
2005-01-19 13:53:43 +00:00
b5d9b1e72d Small fixes for UI;
- Add UV Sphere now aligns with view, as do all primitives
- Small drawing error in edges between blender areas (black lines were 2
  pixels too short)
- Replaced the heuristics in opening sublevel menus, to be less frustrating.
  It now keeps sublevel open while mouse moves within the triangle defined
  by original mouse location (before moving) and the closest vertical edge
  of the new sub menu. Works nice for toolbox and pulldowns.
2004-12-14 18:18:31 +00:00
201c742394 Ctrl+C and CTRL+V copy/paste didn't work for COL buttons ("swatches").
Thanks Chris B for a useful fix!
2004-12-11 16:33:55 +00:00
9c9047a641 Fix for #1951
Textbuttons and buttons showing ID names (Objects, etc) were accidentally
also translated. Error since 2.3 recode. :)
2004-12-03 15:28:48 +00:00
f3c8c47adb Fix for #1839
On large changes of the Lattice resolution button, the undopush crashed.
Reason was that the push happened for buttons before the actual event for
buttons was executed.
Solved by creating new event UNDOPUSH that's being added to the queue by
by buttons now.

- Made button undo texts for number buttons more clear
- Added undo push for missing Add lamp/empty/lattice/camera
2004-11-22 22:41:07 +00:00
0d9fa74348 Potential fix for Sun glCopyPixels problem.
It's an ifdef, copying pixels with offset of 1 pixel.
2004-11-22 21:22:09 +00:00
39022ffb88 Bug fix, irc report.
Move to layer buttons, using SHIFT+hotkeys to set button values and use
mouse to press OK undid the last change, this due to active flag hanging
on that button. It now clears hotkey active flags on mouseclick first.
2004-11-22 11:48:51 +00:00
a534361b3e More small changes;
- Added "Add Hook" menu in mesh editmode pulldown (Vertices) and toolbox
- Small tweak in editmode undo, tighten rules for what to do inbetween
  editmode sessions. (use same stack when object names identical)
- Added correct redraw events for CTRL+C CTRL+V (r g b sliders for example)
2004-11-09 23:05:06 +00:00
a4c582d9c5 Cosmetic stuff;
- pulldown button for textwindow header OK
- color picker had no correct border around it
- border around 'game framing' and 'edge settings' smaller now
2004-11-09 15:59:15 +00:00
78551a575e Sorry sorry... new feature while in freeze mode, bad bad bad!
But this was promised on conference, and have to keep that promise. :)

Buttons in Blender now allow copy/paste values and strings. Also works
for object names!
Mouse over button and press CTRL+C or CTRL+V for copy/paste
(Macs can do Apple key)

Plus bugfix: name button for object in Nkey panel didn't check name
2004-11-08 22:10:20 +00:00
e3a25e4765 Added update for picker fields themselves, when click in 'swatches'
(palette)
2004-11-08 16:23:46 +00:00
0f84375d7a Lotsa undo stuff added;
- ALT+U undo menu shows history for global undo as well
- Added undo pushes for buttons window more consistantly
- Added it & tested for ipowindow too
- Added it in outliner
- And quite some missing occasions for 3d window editing
2004-11-07 16:49:46 +00:00
e9017926c9 Three minor fixes;
- themecolor for the 'bars' in NLA used signed char
- global undo, restore pointers for UI accidentally added user values for
  oops and outliner, causing unused blocks to show used
- moved popup menus one pix up or down, it was overlapping the button
  causing accidental selection of menus
2004-11-05 17:18:17 +00:00
3573252508 Found critical error in using pulldowns and toolbox menus; after returning
from menu code, it left the main window active (for global draw), this
sometimes could screw up drawing calls after... as happens when a command
is executed that draws immediate.

Now the previous window is restored before a menu command is executed
2004-10-30 21:18:53 +00:00
8aa1948c10 AFAIK... last issue with new Z-culling selection.
Since the new menu system draws in backbuffer, the selectionbuffer then
needs a refresh after. Solved by nicely signalling stuff.
2004-10-30 17:13:10 +00:00
c47029a710 Menus like 'edge' or 'game engine framing' could get flipped whilst the
alignment of buttons was still active, resulting in garbish.
2004-10-29 18:47:58 +00:00
b7a7e5912a Put back frontbuffer drawing for link-lines, used in the logic editor.
No quick & nice method can be found to prevent using frontbuffer for now.
2004-10-27 07:41:44 +00:00
15e1671ec5 Enabling transparent pulldown/popup menus in Blender. Speed of drawing is
not affected when using standard (alpha=255) settings.

Only the backdrop for menus and unselected items can be transparent, the
highighted (active) item remains solid colored.

Just fun eyecandy tho :) but the recode of menu enables this easily.
2004-10-26 12:52:20 +00:00
6fbd4e3e1f Color picker fixes... (bug #1490)
Since color is stored RGB only in Blender, the conversion from and to HSV
causes values to be clipped all the time.
Solution found is adding a persistant hsv storage to the uiBut struct, and
have it working on that only while hsv button is open. Still, after usage
(leaving picker) the conversion will change values to rgb.

Also added; redraw event for editing buttons, to show correct changed
color while using nkey picker
2004-10-14 14:20:24 +00:00
2521a8b577 Bug fix 1432;
When you PAD-enter on a popup-number button (like for add circle) it
accidentally de/increased the value before assigning an "OK". Fixed.

Also: restored functionality that allows to use Enter keys as a mouse
button click. This de/increases values now, opens menus, etc. Not in
pupup or pulldown menus though!
2004-10-12 09:06:28 +00:00
b024faabe5 Outliner features:
- Rename!
CTRL+leftmouse click on name, makes it a text button. Works for all items as
currently being displayed.
Most work was doing the Bones, which is a nightmare :) But it uses same
code as buttons in Armature-Editmode now, without even needing EditMode :)
When renaming a bone, the Outliner makes the Object active though.

- PageUp / PageDown keys
Do what you expect.
2004-10-11 11:54:14 +00:00
2324dc7a37 Cleanup of Rounded Theme;
- pixel aligned clean AntiAliased outlines
- menu decoration integrated

And a fix for not drawing menu menubuttons pressed when clicking
2004-10-04 12:37:16 +00:00
010200f9b5 Fix for new UI system and vertexpaint/faceselect/weightpaint/texturepaint
If backbuffer is in use for selection codes, the system switches back to
frontbuffer drawing temporally. Is easier solution now.

Next commit; fix for new 'zbuffer clipped selection', which also doesnt
work after using a pulldown or popup menu.
2004-10-03 20:02:22 +00:00
b7ac42a4c6 Test for people which copybuffer method is best.
G.rt==2: uses a glReadPixel and glDrawPixel together

Otherwise it uses glCopyPixel (supposed to be faster :)
2004-10-03 16:54:05 +00:00
3a840670a5 Lots of small changes, all for UI in Blender;
----- Killed UI frontbuffer draw
The interface toolkit was drawing all live updates (while using menus/buttons)
in the frontbuffer. This isn't well supported cross-platform, so time to be
killed once. Now it uses *only* glReadPixels and glCopyPixels for frontbuffer
access.

Live updates or menus now are drawn in backbuffer always, and copied to
front when needed.

NOTE: it was tested, but needs thorough review! On PC systems I suspects
backbuffer selection to screw up (check!). On SGI/SUN workstations it
should work smooth; but I need evidence

----- Smaller fixes;

- AA fonts were garbled on ATI systems. Now the AA fonts are drawn exact
  on pixel positions. Needs the new FTGL libb too, patch is on maillist
- Rounded theme uses antialiased outlines
- Pulldown and popup menus have nice softshadow now
- New button type 'PULLDOWN', thats the one that callsup a pulldown menu.
  Should be added to themes, as is the full menu/pulldown drawing
- Screendump for 1 window does the full window now, including header
- Empty pulldowns (for example running blender without scripts) give no
  drawing error anymore

For review & fun;
- added curved lines as connectors, for Oops window
2004-10-03 13:49:54 +00:00
19c2d34967 - Improved memory system for pupmenu(), which now stores 255 entries max.
Meaning menus come back to previous selection almost always. Also fixed
  annoying bug that caused Mirror menu (M in editmode) to start at 2nd item

- New hotkey (test :) CTRL+TAB in editmode gives (and shows!) current
  selectmode. I prefer this over cycling, since the menu is informing you
  what happens.

- To enforce pupmenus to start at specific item, use pupmenu_set_active()

- pupmenu_col() to be done
2004-10-01 07:51:12 +00:00
a2e918d831 EditMesh refactory + undo recode
The changelog is very long... it's on the web too:
http://www.blender3d.org/cms/Mesh_editing_rewrite.425.0.html

EditMesh refactor notes (user)

**** New selection modes

When entering Edit Mode for a Mesh, you now have the choice for three selection modes. These are shown as icons in the 3D header (hotkey is being searched for!).

- Vertex Select
Select vertices as usual, fully compatible with how previous version work

- Edge Select
Vertices are not drawn anymore, and selections happen by default on the edges. It is a true edge select, meaning that you can select three out of four edges in a face, without automatic having the 4th edge selected.

- Face Select
Instead of vertices, now selection 'points' are drawn in the face centers. Selected faces also get a colored outline, like for edges. This also is true face select, for each face individual regardless selection status of its vertices or edges.

While holding SHIFT, and press a selection mode, you can also combine the above choices. Now selection becomes mixed, and will behave as expected.
For example; in Edge+Face select mode, selecting the 4 edges of a face will select the face too.

The selection modes and optional drawing modes (like transparant faces, normals, or solid drawing) all work together. All of Blender's mesh editing tools now react to the correct selection mode as well.
Most noticeable it's in:

**** Extrude

Extruding in Edge or Face Select mode allows much more precise control over what's extruded and what should be excluded. Try for example a checker pattern selection, and extrude it.

New is the fixed translation when faces are extruded. This always follows the (averaged) face normal(s) of the old face(s), enabling much easier working in 3D views . A single 'G' (Grab) or 'R' (Rotate) or 'S' (Scale) will change transform modus as usual.

**** Other things to note

- Hiding edges/faces will also behave different based on Select Mode.
- while editing, normals of faces are updated always now
- Border select (BKEY) has 2 different rules for edges; when one edge is fully inside of the border, it will only select edges that are fully inside. Otherwise it selects each edge intersecting with the border.
- in face mode, adding vertices, edges or a circle is invisible...
- "Add monkey" now works as a normal primitive (rotated and on 3d cursor)
- Mesh undo was fully recoded, hopefully solving issues now with Vertex Keys and Groups
- Going in and out of editmode was fully recoded. Especially on larger models you'll notice substantial speed gain.

**** Todo

Add 'FaceSelect mode' functionality in EditMode, including zbuffered selection, display and editing of UV texture.


EditMesh refactor notes (coder)

**** Usage of flags in general
The "->f" flags are reserved for the editmesh.c and editmesh_lib.c core functions. Actually only selection status is there now.
The "->f1" and "->f2" flags are free to use. They're available in vertex/edge/face structs. Since they're free, check carefully when calling other functions that use these flags... for example extrude() or subdivide() use them.

**** Selection flags
EditVert: eve->f & SELECT
EditEdge: eed->f & SELECT
EditFace: efa->f & SELECT

- Selection is only possible when not-hidden!
- Selection flags are always up-to-date, BUT:
  if selection mode >= SELECT_EDGE vertex selection flags can be incorrect
  if selection mode == SELECT_FACE vertex/edge selection flags can be incorrect
  This because of shared vertices or edges.

- use for selecting vertices:
  eve->f &= SELECT
- use for selecting edges always:
  void EM_select_edge(eed, 1)  // 1 = select, 0 = deselect
- use for selecting faces always:
  void EM_select_face(efa, 1)  // 1 = select, 0 = deselect

- To set the 'f' flags in all of the data:
  void EM_set_flag_all(int flag);
  void EM_clear_flag_all(int flag);

- the old faceselectedOR() and faceselectedAND() are still there, but only
  to be used for evaluating its vertices

**** Code hints for handling selection

If the selectmode is 'face'; vertex or edge selections need to be flushed upward. Same is true for 'edge' selection mode. This means that you'll have to keep track of all selections while coding... selecting the four vertices in a face doesn't automatically select the face anymore.

However, by using the above calls, at least selections flush downward (to vertex level). You then can call:

void EM_selectmode_flush(void);

Which flushes selections back upward, based on the selectmode setting. This function does the following:

- if selectmode 'vertex': select edges/faces based on its selected vertices
- if selectmode 'edge': select faces based its selected edges

This works fine in nice controlled situations.

However, only changing the vertex selections then still doesn't select a face in face mode! If you really can't avoid only working with vertex selections, you can use this call:

void EM_select_flush(void);

Now selection is flushed upward regardless current selectmode. That can be destructive for special cases however, like checkerboard selected faces. So use this only when you know everything else was deselected (or deselect it). Example: adding primitives.


**** Hide flags
EditVert: eve->h
EditEdge: eed->h
EditFace: efa->h

- all hide flags are always up-to-date
- hidden vertices/edges/faces are always deselected. so when you operate on selection only, there's no need to check for hide flag.

**** Unified undo for editmode

New file: editmode_undo.h
A pretty nice function pointer handler style undo. Just code three functions, and your undo will fly! The c file has a good reference.

Also note that the old undo system has been replaced. It currently uses minimal dependencies on Meshes themselves (no abuse of going in/out editmode), and is restricted nicely to editmode functions.

**** Going in/out editmode

As speedup now all vertices/faces/edges are allocated in three big chunks. In vertices/faces/edges now tags are set to denote such data cannot be freed.

ALso the hashtable (lookup) for edges uses no mallocs at all anymore, but is part of the EditEdge itself.
2004-09-23 20:52:51 +00:00
562d6958cb Another step in the undo evolution.
- Made unified API for undo calls, to be found in space.c
  BIF_undo_push(char *str)
  BIF_undo(void)
  BIF_redo(void)
  These calls will do all undo levels, including editmode and vpaint.

  The transition is work in progress, because mesh undo needs recode.

- New global hotkey CTR+Z for undo
  Note: 'shaded draw mode' still is SHIFT+Z, the old CTRL+Z was to recalc
  the lighting in shaded mode, which already became much more interactive,
  like during/after any transform().
  Recalc hotkey now is SHIFT+ALT+Z

  CTRL+<any modifier>+Z is redo.

- For OSX users; the Apple-key ("Command") now maps to CTRL as well. This
  disables the one-mouse-button hack for rightmouse btw, will be fixed in
  next commit. At least we can use Apple-Z :)

- Old Ukey for undo is still there, as a training period... my preference is
  to restore Ukey to "reload original data" as in past, and only use new
  CTRL+Z for undo.

- Added undo_push() for all of editobject.c and editview.c. Meaning we can
  start using/testing global undo in the 3d window. Please dont comment on
  missing parts for now, first I want someone to volunteer to tackle all of
  that.

- Since the global undo has a full 'file' in memory, it can save extremely
  fast on exit to <temp dir>/quit.blend. That's default now when global undo
  is enabled. It prints "Saved session recovery to ..." in console then.

- In file menu, a new option is added "Recover Last Session". Note that this
  reads the undo-save, which is without UI.

- With such nice new features we then can also kill the disputed
  Cancel/Confirm menu on Q-KEY.

- Added fix which initializes seam/normal theme color on saved themes.
  They showed black now.... (Note: that's in usiblender.c!)
2004-09-18 12:12:45 +00:00
bf83f6ddd8 Second itteration of global undo system. Now based on:
- file-to-memory save
- incremental difference steps (compression)

everthing has been tightly coded to use minimum of memcpy or allocs. In
fact this system works with a single full buffer (=file) in memory, and undosteps as differences from it.
Speed gain is factor 4-8 faster. I've added it in CTRL+ALT+T timer menu for
a test. Please note the gain is especially in the undo-storing, not in
retrieving undo.

Also new: file read option to skip UI read (file menu). This now also is
default for the undo system.
2004-09-05 13:43:51 +00:00
bd31cc5eb4 Enabled trial for 'global undo'. This now only has undo steps for
- transform (grab, rot, scale, etc)
- all button commands, including menus

I sacrificed for now the UKEY in the 3d window for it. Shift+U does a redo.
(Only in 3d window)

What this system does is saving files in the temp directory (user pref).
The filenames are cycled around (32 in total now).

This commit will follow shortly with a userpref for it, not to frustrate
people who want to work in normal fashion with blender.
2004-08-31 20:13:32 +00:00
0a305446a5 Three functionalities in one commit, but there's overlap so I can't
separate it...

1) Curve/Surface editmode undo
Uses same syntax as mesh undo, so simple to integrate. Edit-curve data is
also quite simpler, so no need for any hack at all.
It re-uses the undo system from next point, which is nice short & clean
local code

2) Framework for global undo
The undo calls themselves are commented out. In a next commit I want to
enable it for a couple of main features, for further feedback.
The speed goes surprisingly well, especially with this new version that
'pushes' undo after a command, ensuring interactivity isnt frustrated

3) framework for texture based icons in Blender
Not activated code, but tested here. Part of 2.3 UI project.

btw: Johnny Matthews will assist in (and complete) the undo project
2004-08-31 13:43:18 +00:00
89ba6db7bd Small tweak to the colour picker - make the palette
buttons rectangular, even in the rounded theme
2004-08-05 12:40:20 +00:00
aae6039583 Slightly improved clipping of rgb colors in HSV picker, to prevent the Hue
slider in bottom to block on colors 0,0,0 or 1,1,1

This is not scientific yet, but could be released :)
2004-08-04 23:19:57 +00:00
002af38739 Fix for some bad code that MSVC choked on. Thanks
jesterking for pointing it out, I think I'd better go sleep
or something...
2004-08-04 08:02:44 +00:00
d1322bfaa8 Tweak to the colour picker after conversation with Ton.
Moved the buttons to the side, so it's:
* consistent with the layout of the floating panel version
and consistent with the vertical R/G/B sliders layout
* using real number fields instead of abused menus :)
2004-08-04 06:52:41 +00:00
8224b1b164 - calculation of position within HSVCUBE button (picker) had wrong Y
coordinate, only noticable in Panel versions of picker

- the fix to give Transform properties new name "Paint" can't
  work with this code... this due to fact that panel positions are saved
  in files or looked up on re-open based on their names. Giving the Panel
  a new new name then causes it jump to another position, and back on end
  of painting.
  Needs to be solved in another way. Not feasible for 2.34...
2004-07-31 22:05:46 +00:00
c726751760 Attempt #3 (or so) to solve the "weird buggy" hardness slider updates. :) 2004-07-29 20:50:13 +00:00
fcd19e73df Change in handling of ui_do_buttip(). It doesnt use the global var, but
gets it as argument. Potential fix for windows crash
2004-07-28 21:31:26 +00:00
4d3cca252c Fixed small calculation error for non-float slider, which defined
whether redraw was needed. This shows on (some) windows cards that the
button continuously keeps updating/flashing.

Since I can't test it here, please confirm :)
2004-07-27 14:26:11 +00:00
36375b1c29 Added colorpicker support for theme editor 2004-07-22 13:40:17 +00:00