Commit Graph

130 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
09fb5d6b8d BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).

- Updated Window and Window.Theme with new theme vars and the Time space.

- Script links:

-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.

-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.

-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.

-- Implemented Ton's space handler script links:

Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.

Here's how it works:

- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT

and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.

EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:

import Blender
from Blender import Draw

evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender

Blender.event = None # tell Blender not to process itself the event

DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.

To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.

Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.

- doc updates about the additions.

=======

Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
2005-05-08 21:20:34 +00:00
ef2855bcab Timline goodies;
- Mkey while ALT+A inserts markers.
  Note for Matt; You forgot to check for 'val'. The delay in tuho I brought
  back to max 1 frame. Delays are common in realtime gfx apps, the picture
  you see is old, and its possible you press a key while next frame is
  already drawing, and then it has to increase the frame value still... :)

- RMB escapes from anim playback

- on activate object, Timeline redraws too

- Added keyline drawing for Material Ipos. The CTRL+Page keys work with it.

Softbody:

- Renamed buttons to call "Spring constant" now "Stiff(ness)" and the
  "Friction" became "Damping".
2005-05-08 20:10:59 +00:00
8717577950 Bug fix #2414
Quat XYZW was mixed up in NKey panel for Armature... now OK.
2005-05-05 20:36:14 +00:00
42ae9128fa Removal of old transform() <sob> part one.
- added in new transform the (not so useful but yah) old feature that
  does scrollwheel zoom during transform
- had to change transform call arguments for uv-window/sequence/oops to
  match new transform for mouse callback

TODO (for martin?)

- pulldown menu support to call with local axes compliant as for pressing
  it with hotkey
- mirrormenu() still uses old transform stuff...
2005-04-30 21:19:19 +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
Chris Want
5270db94c7 ima_ibuf_is_nul() now needs a second arg, fixed. 2005-04-28 13:03:39 +00:00
52b7b978e3 Bug fix #2411
(Looks like big commit, but is mostly just change of API call!)

Particle emittors now can be parented to an armature Bone, and give the
correct path for each particle. Note that this doesn't work for deform!
And, for each particle the entire armature is evaluated, all actions and
NLA strips.

It used to work a little while BTW, but the code just called ALL armatures
and made ALL deforms again. Was quite slow... thats why the API call
change: do_all_actions() now accepts Object * to only do that one. With
a NULL it now does all still. Will disapppear in recode of course...
2005-04-11 17:55:20 +00:00
8d92e6ced2 Added more dependencies to softbody, for correct recalc
For example; subsurfed softbody after play anim (ALT+A) didn't get
cleared correctly. Darn where_is_object stuff!
2005-04-03 16:57:16 +00:00
90df59630e More softbody goodness;
- Added Softbody effect for Lattices (not too useful yet without
  vertexgroups though)
- Added default vertex "goal" value + button, to be assigned when no
  vertexgroup exists (or vertex isn't in the group)
- Made softmin and softmax work as documented (defining min and max range)
- made changes in buttons send 'update' signal to softbody

And:

- added Nkey Properties to show lattice coordinates
2005-04-02 19:52:32 +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
ea15126d75 axisProjection can take care of zero-length vector so we don't need to check anymore. Was giving some problems with cameras looking perfectly down.
Also removed all NEWTRANSFORM defines, using the new code all the time now.
2005-03-25 03:28:08 +00:00
6be51da81a Moved init of new gridview variable, for adaptive grid steps, out of
function that was only called in ortho... grid snapping otherwise can
not work. Thanks i-Alexander for reporting!
2005-03-23 21:08:15 +00:00
09ed2cef75 New feature, since long on todo;
The grid function (transform translate, snap-to) now uses the grid step as
displayed in the 3d window, so it depends on how much you zoomed in/out.

The threshold for it is a bit tricky... it follows the drawing, but the
blending in/out of grid makes it sometimes not obvious.  might need slight
tweak?
2005-03-23 14:24:43 +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
17bd00a851 So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
  while-hold-move-release
- Implemented now: Translation Widget, which allows:
  - four hotspots for axis grab or view-aligned grab
  - center defined by 'around' setting
  - SHIFT+LMB gives planar constraint on other 2 axes
  - works in Object mode and Edit mode (not posemode yet)

Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.

On the todo for this widget:
- choice for Global, Local or Normal orientation

The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;

- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode

Unresolved;

- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 21:31:49 +00:00
cd3b11f41e - Added more space in icons image (blenderbuttons.png)
It now only uses 1 extra row of 21 buttons. More can simply be added
- Added new icons for the new proportional edit options Root, Linear and
  Constant
- Made sure pulldown and pop-up menu work for new prop options

- Transform fix; proportional edit circle was drawing in Object mode
2005-03-09 21:10:30 +00:00
af092210db - switch draW_bgpic to calculate window coordinates as floats, smoother
zooming of background pic now.
2005-03-08 19:18:40 +00:00
a26d91fddf - replaced call to project_short_noclip with direct implementation
because project_short_noclip doesn't do the calculation if
     the value would be near-clipped. For background picture we
     don't care about this.
2005-03-08 18:58:27 +00:00
4e39c4361f Making transform's code more Blenderish with a proper extern include file (BIF_transform.h) and extern function calls (BIF_*).
On a side note, Shear was fixed in last commit, just forgot to mention it. It wasn't acting correctly in Edit Mode (and Desoto was poking me about it every sunday).
2005-02-20 01:25:10 +00:00
d2f4ba4549 Initial new transform commit.
Disabled behind defines. Uncomment //#define NEWTRANSFORM in transform.h to enable.

Use at your own risk

For more info, see Wiki: http://wiki.blender.org/bin/view.pl/Blenderdev/TransformRefactoring
And tuhopuu mailing list: http://projects.blender.org/pipermail/tuhopuu-devel/

Notes for Ton (things that could need bulldozing:
- TransData conversions. Objects is ok, but others could be rechecked. (some still use totsel). Need to add pose mode support.
- Need more icons in the PET mode dropdown (in the 3D view header) for the new modes
- Add new transform calls to Toolbox and Menus and the one right after Extrude.

That's pretty much all I can think of now.
2005-02-14 02:53:36 +00:00
2d356a79e0 Accidentally committed drawing editmode disregarding layer state. Brought
back to how it always worked.
2005-02-08 16:25:20 +00:00
c94ec03a9e Bug fix (from own collection)
After using clip-safe pixeldraw from glutil.c (preview render, bg picture)
the current viewport had to be re-set. Not doing so caused a 1 pixel offset
for live updates buttons (on mouse over)
2005-01-30 13:13:31 +00:00
8b3eea1798 - Added warning print and return in glaDrawPixelsSafe when zoom level
exceeds window (glScissor) size. Apparently zooming in on one single
  pixels larger than a window isn't well supported.
- Moved drawing of editmode objects to 2nd loop in drawview.c, this
  makes sure draw-extra wire is always visible correctly
2005-01-08 13:15:43 +00:00
4ddb5a9e9b Added push/pop matrix for 3d window + new agl draw pixels 2005-01-07 22:17:56 +00:00
341bb20dbd Should have done ages ago!
This commit replaces the glDrawPixels and rectwrite_part with the very
nice (thanks zr!) glaDrawPixelsSafe() call. Result is:
- 3d window background image displays correctly onto the edges when
  zoomed in extreme
- same for UV image window and sequence preview
- preview render now doesnt disappear when left part is outside window
(zr also deserves kick in butt for not doing this himself in NaN days!)

Especially from preview drawing quite some old hacks were deleted. It is
even quite some faster.
Please notify me when it doesnt work on your card... this now is just 100%
according opengl guidelines though :)

Also fixes bug #2100
2005-01-07 21:48:25 +00:00
76c02669d4 - added some items to the MetaBall menu in view3d header
- Snap menu
   - Transform menu
   - Transform Properties

 - correction of some typo in drawview.c
2005-01-06 21:27:53 +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
6719d88aab Bug #2019
Separate in Mesh editmode, selectmode 'face', and with a selection that
used to be in vertex mode a full select (like selecting the 2 opposing
faces in a cube) caused crash. There was still no good face-select
awareness there... tsk! :)
2004-12-15 11:36:46 +00:00
2de89e2a35 Three fixes in edge/crease edit for Transform Properties Panel (NKEY)
- code wasn't edge-select aware yet
- the "Median" button now allows to move a "median" correctly around, also
  to 0 or 1 in a single step
- missing undo push  here.
2004-12-09 16:43:37 +00:00
d95072d68e Bug fix #1758
Using ImageSelect window for background pic in 3d window, assigned it to
wrong window... this because the image-select window wasn't pushed before
it used the callback to set the image.
2004-11-09 11:06:56 +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
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
ca2b8f00eb Potential fix for #1684
Buttons (editingbuttons) flicker when adding armature bones. Added proper
redraw event extra for buttons menu
2004-10-28 21:50:32 +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
684cafb01a Last fix for previous commit;
New option "passepartout" for drawing a darkened area around viewborder
in Camera view. Provided by Wybren van Keulen.
Added button in F10 buttons, just above "DispView". Would like feedback
if this is a temporal or real feature :)
2004-10-06 19:21:57 +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
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
975f0fec0e Pooh pooh! This backbuffer system for selection codes works much easier on
osx with AUX buffers, than on other systems with GL_BACK buffer...

Now i've added a check in force_draw to also redraw the backbuffer, if
needed. ANother weak point in the sublooping system in blender.
2004-09-29 18:08:04 +00:00
ceb7d3db46 Two fixes;
- borderselect draws cleaner info in bottom/left corner window
- OGL render (in view3d header) option didn't work on successive renders.
  was due to removing hack that reopened the window each time. But now it
  needed to be assigned correctly to blender's 'mywindow' system.
2004-09-29 10:49:19 +00:00
f3c7fdd80e Recode of 'zbuffer selection'. I first was too afraid using the backbuffer
selection method, since there's too much trash in drawobject.c and displists...
But, I couldn't stand the zbuf selection to miss edges too often. Right now
both methods are still in the code, and can be reviewed.

Please note for test:
- borderselect and circle-select still use old method
- new selection works directly on faces & edges
- subsurf optimal draw and selection works fine now

To detect the closest vertex or edge, i use the old 'spiral selection' code,
which is extremely accurate. If your mouse is close to an edge, it should
find it.

Most evidently I need to test speed... also, the disadvantage of backbuf
selection is the limited depth, which can be 16 bits (65 k faces) on systems.
2004-09-28 09:43:37 +00:00
061442cbd1 - improvement for edge/face select
- edges now sample on three locationsm gives more hits
  - own version of glPolygonOffset remains cumbersome... but for select
    now the selection routine gets more offset than draw.

- first attempt to clean drawobject.c and displists
  - generic call for draw object in backbuf for select purposes, cleans up
    a lot in the other calls.
  - also to verify if we can (in future) use this for vertex/edge/face
    select, but the whole drawobject code works against me... this is
    for another refactory (incl. displist) and out of the focus for now

- subsurf.c: now creates new faces in order of original. Not used yet, but is
  handy to recover the original order for selection/paint purposes.
2004-09-27 10:12:45 +00:00
dfd583116a Zbuf-selection fix: while drawing vertices, it accepted writing in zbuf
for it too... giving (sometimes) no selection, and possible for linux the
solution too!
2004-09-25 15:15:26 +00:00
dfef53a632 Two small fixes for previous commit;
- new zbuf-clipped select was always on
- drawing the 'floor' now doesnt write in zbuffer when in editmode
2004-09-25 14:21:09 +00:00
6f074f6f46 Two nice workflow improvements;
- Zbuffer clipped selection
Based on same algos as for drawing (blender polygon offset) vertices, edges
and faces now are clipped for draw and selection when Zbuffer is used.
Note that it works for endpoint vertices of edges, and for facecenters.
Also works for border and circle-select

- Optimal draw subsurfs
This now draws optimal with faces and edges selected/unselected, hiding the
original 'cage' (mesh) completely.
TODO: edge select, which still uses original (invisible) edge.

http://www.blender3d.org/cms/Mesh_editing_rewrite.425.0.html
2004-09-25 13:42:31 +00:00
e7d3039d12 - Blender: added option 'scriptsdir' to Blender.Get();
- small updates to the docs;
- Object: small fix to getMatrix: check during_script() to avoid undesired loops; added old behavior (pre 2.34) as option: .getMatrix('oldlocal');
- tentative fix for bug #1275: scene REDRAW scriptlinks were not being executed (the call to do so was missing):
http://projects.blender.org/tracker/index.php?func=detail&aid=1275&group_id=9&atid=125
    added the call in drawview.c, in drawview3dspace().  This causes the scriptlink to be called for each visible view3d, but that's what happens with object redraw scriptlinks, too.  Anyway, this is still a test.  The place was chosen based on the idea that a scene redraw scriptlink is like an object redraw one, but for all objs in the scene at once.

- Window.Theme: new submodule, to get/set theme options in Blender;
- Added the script save_theme.py (Help menu for now), to save the current theme in Blender as an executable script (currently shown in the Scripts->Misc menu).

There's more work to do for themes, like defining a proper place for them in the interface, adding documentation (for now the added script and the ones it generates can give a pretty good idea of how to use the new module), probably extending themes to support SpaceScript and so on.
2004-09-21 05:28:17 +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
060db9e94a Smallest commit ever: Make the OB: text entry field in
transform properties floating panel maximum 19 characters rather than 18, to bring it in line with the
similar field in buttons_editing.c
2004-08-02 13:06:09 +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
91d782ece7 Fixed up the layout and language of the
View Properties Panel.

(reminder: http://www.blender3d.org/cms/Language_and_terminology.338.0.html )
2004-07-29 02:25:10 +00:00