Commit Graph

200 Commits

Author SHA1 Message Date
Mika Saari
f210e88263 Coding style from spaces to tabs in files related to Unicode Font Object.
Function strlen changed to wcslen in editfont.c in ALT-U (undo) functionality.
2005-09-19 17:58:51 +00:00
Alexander Ewering
98bd4615b5 On behalf of Mika Saari, the famous Unicode Font support!
Further information is available here:

http://wiki.blender.org/bin/view.pl/Blenderdev/UnicodeFont3D

Shortlist of features:

- Unicode character support for Font3D
- UI to select characters from Unicode character list
- UI to select Unicode table areas
- Optimized character loading (Load only those characters which are used
  in font object)

Please test extensively if it breaks anything, try also loading/saving
files, packing fonts, etc.

The official text regression file in the regression suite should be a
good start.

Thanks to mikasaari for this very useful addition!
2005-09-14 14:02:21 +00:00
9b46c46dc9 Bugfix #3040, the new 'roundbox' button disabled copy/paste values in
buttons. You could notice that for Constraint and Modifier panels.
2005-09-12 13:26:53 +00:00
517e526e9e Bug fix #2788
in 3d window, nkey panel, click in middle of number button & press ESC
moved the 3d cursor to that location. The button was passing on its
event to the window event queue, which shouldn't be.
2005-09-03 12:35:13 +00:00
fd7d224d4c Bug fix #2972
Copy/Paste bone name buttons crashed, didn't use the callback for buttons
proper yet.

Also added MAXFRAME defines for buttons, instead of hardcoded values 9000
or 18000
2005-09-03 10:50:21 +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
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
f1609dde11 Added new button type: ROUNDBOX
This replaces drawing with uiRoundBox() or glRect() in button Panels,
which just fails for dynamic constructed button views where Panels are
sometimes invisible. Also eliminates hack with PanelPop().
Error was visible with new Modifier panel, entering/exiting EditMode.

Done Modifier and Constraints.

Syntax:

The last 4 free variables in the uiDefBut() call are:
- float, corner-rounding (0.0-pixels),
- not used,
- short: roundbox type (bits, 1 2 4 8 for clockwise corners starting left/top)
- short: color shade offset (color range 0-255)
2005-08-15 19:46:09 +00:00
28a1f55ff6 - added copy button to modifier stack UI
- add warning about applying decimation
 - some more UI tweaks (rounding of modifier pane, make toggles only in header,
   add object name to try to convey that modifier stack is tied to OB)
 - bug fix, modifier recalc wasn't done on make link
 - bug fix, uiBlockEndAlign didn't clear align flags with certain themes,
   pretty sure this wasn't intended. (TON: PLEASE CHECK)
2005-08-06 18:51:58 +00:00
3367a030b3 - added UI_EMBOSSR option (rounded emboss)
- added support for vector icons, from user API side is just like using
   a regular icon... on icon side is defined by a function in resources.c
   instead of using the blenderbuttons png file. vector icons are much
   easier to add and scale properly. intent is that vector icons would
   be drawn in window coordinates which lets icon developers make the
   most beautiful icons, but this requires some tweaking of the interface
   drawing that I am not going to do atm.
 - changed BIF_draw_icon* to take coordinates of where to draw icon instead
   of using passed in raster position
 - switch modifier UI to using vector icons, and tweaked some position and
   style stuff.
 - replaced most uses of UI_EMBOSSX with UI_EMBOSS (do same thing, just there
   to confuse people I guess)

After the window coordinate stuff is sorted out with vector icons
it probably makes sense to move all non-photorealistic icons in blenderbuttons
to vector form just so scaling goes better.
2005-08-04 22:36:21 +00:00
b03a20d272 - got rid of silly #define ..._BIT, #define ... (1<<..._BIT) stuff
- switched almost all uiDefBut(..., TOG|BIT|..) to use UiDefButBit and the
   name of the actual bit define instead of just a magic constant, this makes
   searching the code much nicer. most of the credit here goes to LetterRip
   who did almost all of the conversions, I mostly just checked them over.
2005-08-03 18:48:22 +00:00
3abbc85ae0 - commit some testing code for LetterRip's bit button conversion 2005-07-25 23:56:57 +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
35a00d7ca0 Fix v2.0 for #2256:
An alternative fix - last one broke stuff that I only discovered
*after* committing! Go figure!

Basically, gave B_REDR events for the sliders -- I still think
there is a bigger underlying issue here, but it is best left for
Ton the interface guru! ;)
2005-06-05 17:06:20 +00:00
6d823636b8 Bug fix: #2256
Sliders (and potentially other buttons) with no retval were not breaking the ui_do_block() loop, which caused events to propagate to other panels!

(The effect could also be seen by dragging from AO sliders into the
World name textbox.)
2005-06-05 16:40:48 +00:00
8242c5db2b Bugfix #2602
Tooltips of buttons with menus (like for set constraint type) could popup
still... and in wrong location even!
Now it's a little bit tighter coded.
2005-05-24 13:02:22 +00:00
d4b2824b24 Bug fix #2535
Armatures with > 100 bones can deliver a 'parent IK menu' that doesn't
fit on screen anymore. Fixed it with changes;

- when menu doesnt fit to right/left, it places it aligned to left hand
  of window
- when more than 8 collums in a menu exist, it makes collums 25 items
  instead of 20.

Also fixed for the popup menu on Bone parenting. On a 1280 screen we now
can have a menu with over 300 bones (even more when you zoom down the
buttons window a bit). Still not optimal, but at least it's less annoying.
2005-05-12 20:06:30 +00:00
a7bbf8245a Fixed various errors with Blender allowing editing Library linked data.
CTRL+V on buttons
NKEY Panels
join mesh
join curve
editing buttons
boolean
vpaint
faceselect
Manipulator

Also; Transform() got in useless loop when you entered without anything
selected. Not sure why Martin recoded it this way... maybe as a first
step to handlerify it? For evil Python Aussie Bosses? :P
2005-05-12 19:17:12 +00:00
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