Commit Graph

51 Commits

Author SHA1 Message Date
28a1e8277b Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs

A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;

- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes

Armatures;

Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!

Important to note is;

1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.

- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.

TODO NOW;

- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.

TODO LATER;

We now can do loadsa new nifty features as well; like:

- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...


Bugfixes;

- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change

-Ton-
2005-07-03 17:35:38 +00:00
058e8ba402 Different fix for the nasty stars problem, previous one swallowed the
ESC during alt+a playback.

Solved in the 'proper' way, which is not abusing the (while render)
ESC callback for UI draw of stars, this confused everything. Means;
you cannot esc stars drawing anymore. Nice feature, bad hack...
2005-06-06 13:10:02 +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
7fa7826da7 The zblur plugin (aka as DoF) integrated in render. Compared to patch
submitted by Alexander, changes/improvements are:

- Moved to new Panel in Scene buttons "Post Effects". Together with other
  postprocessing options, such as Edge render. It is also not called DoF,
  this because that's a bit pretending too much then. It's a zblur still!
- Made it render Alpha as well
- Made it use and deliver float buffers
- Huge cleanup of zblur.c code, was very messy. It was alling things in render
  code without need even (win matrices, transform faces, etc)
- Fixed errors in using Z values (zbuffer is signed int)
- Removed very weird gamma corrections for front/back half
- Tweaked gaussian table, allow variable 'Sigma' to be set for gauss curve
- Didn't copy 'auto focus' yet. Use of this is very limited, and gives
  false expectations, nor works for rendering anims with deamons well.

Main issue remains: it's not a very advanced feature... I still doubt
very much if this deserves to be released. Spent 2 days on trying to get
the key issues solved, with not much results.

- gauss filter code has weird side effects on large blur size
- having unsharp (blurred) in front also blurs what's around in back.
  only blurred in back with sharp in front works a little bit
- severe aliasing errors... also due the code splitting in 2 halves
- doesnt work with unified yet
- won't work for halos, spot halos or transparant faces

Anyhoo... It was promised to be committed, so now artists can play with it.
Who knows it's useful after all, or some fixes can be implemented. :)
2005-04-23 20:49:23 +00:00
Alexander Ewering
0b0f82bbb2 Fix crash with Unified Renderer on LMB in renderwindow. Ton needs to
provide Z-Buffer for Unified still :)
2005-04-18 15:08:31 +00:00
Alexander Ewering
8a1206f56d Add a "Z:" display when pressing LMB in the renderwindow, which displays
the normalized Z-Buffer value of the corresponding pixel.

Useful for setting ZMin for DOF, see next mail to the list
2005-04-18 13:56:19 +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
e4d74575cc Using border + OGL render is not supported, so renderwin should open
normal size
2005-02-19 16:31:42 +00:00
9cbf39e478 Fixed annoyance with opion "DispView" and Border render. It now displays
the rendered pixels in the indicated border nicely.
2005-02-12 16:05:40 +00:00
b7d5f62e04 Added (but recoded) patch submitted by Chris Burt to have render window
opened in size of actual border, if option "Crop" is set.
2005-02-12 15:41:07 +00:00
5d7c2c96ea Fix proposed by Brecht; on redraw events to renderwindow, it sets back
the active main window, if that was active before.
We need to track down how to solve this more definite... for example, the
"make active" window command can also pop window to front.
2005-01-03 13:40:11 +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
eae5d39899 Bug fix #1988, ray-transparency render.
Five fixes in this commit...

- the normals for nurbs surfaces still were calculated pointing wrong in some occasions
- recoded ray-transp rendering to accept normals pointing any direction; it just counts how many times it passes a "glass" layer, and flips normals appropriate then. This means rendering will go fine on models without manually setting the normals. You can also move a camera inside a 'glass' object.
- rendering of the inside part of glass now uses correct normal too... specularity happen on a solid glass inside now.
- And an inside reflected mirror ray will keep bouncing inside glass

Related to rendering localview: old convention to render localview, but with the lamps in the normal layers, has been restored.
Please note; render happens based on active window. You *only* get a localview or 'unlocked layer' render when that 3d window is active = mouse in window.
2004-12-09 12:06:37 +00:00
541e36fe11 Added new option:
In renderwindow, press AKEY to see the alpha in B&W. Another AKEY shows
normal RGB again. This uses glColorMask, an opengl 1.0 function.
Really needed it for debugging alpha in rendering. :)
2004-12-02 21:22:17 +00:00
806ebc7c7a Fix for #1806
View3d windows have 'unlock' option and 'localview', which was also
supported on render (F12 with mouse in window) to render only what is
visible there.
This didn't work very nice, with even code in render module to read from
interface variable. Removed that from render, and coded the exception
where it belongs, in renderwin.c
2004-11-25 18:16:50 +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
4f9cd88087 Removed unnecessary window-close on subsequent renders. This not only causes
delays and lotsof redraw events for the desktop, it also made it impossible
to drag a renderwindow to a desired position.
Now it only re-opens on render size changes. Maybe enables to have the
window permanent on 2nd monitor for extended desktops?

Note; the 'pref position' preset in F10 still works, but only on window
open of course.
2004-07-28 12:47:50 +00:00
653abbae6c Fix for #1449 (blocky shadows)
This problem appeared to be a famous one, with some fun read to be found
on the web. The solution as I commit here is described on the site:
http://www.blender3d.org/cms/Misc_improvements.355.0.html

As extra (I needed it quite some!) added requested feature to have the
renderwindow display in titlebar whether the spare page is shown (JKEY)
2004-07-26 17:12:04 +00:00
f2be1db99d Little feat request: the rendertime disappeared from header after a
rendering; now it's a permanent part of it.
2004-06-22 12:02:19 +00:00
4641463589 removed print "break true" when pressing ESC with render window active. 2004-04-27 12:17:16 +00:00
5bbd35ff05 Turned Sky render code in Blender to become fully float, it still returned
bytes for RGB.
This to allow very bright contrasted images to be used for AO as well. As
a first start also the Texture->Colors panel now allows contrast setting
up to 5.0 (was 2.0).
2004-04-24 20:27:29 +00:00
4d29aee140 New: rendering in background mode (blender -b) now prints a percentage to
indicate scanlines being in progress. For motion blur frames it works too.

Bug fix: in background render it accidentally tried to free a sound pointer
that wasn't set. (caused by own commit of three days ago).

Fix: rendering motion blur in forground prints correct sample # in info-
header again.
2004-04-24 12:02:39 +00:00
Chris Want
6000b811bc A little improvement by Joilnen Leite: makes the pixel RGBA values visible
(even with a white background) when left clicking in the render window.
2004-02-16 15:29:10 +00:00
c225bf1240 On request of broken, monkeyboi and others the rendering engine menu is back again.
The menu button was also moved to the render panel, this required some changes to the placement of the other buttons.
I hope this is no problem...
2004-01-27 05:46:12 +00:00
d959b8127b Applied Daniel Fairhead's patch for a correct working DELKEY in textinput buttons.
(thanks!)

Added a 'void' somewhere to silence a compiler warning.

(Windows only)
Moved the flip fullscreen button in the topheader a little to the right, since the
questionmark button mysteriously disappeared.
2004-01-07 23:33:40 +00:00
eff07b8329 Basic initial yafray integration by Eeshlo.
Materials are exported the best we can do by now. It will look almost as in
blender except for the missing procedural textures and some minor issues.
You have to tweak normal modulation amount to get the desired result cause
is not the same in yafray.

We added a panel in render space to adjust some yafray settings (GI and so)

Also we export transparency and reflection using new raytracing settings,
but that will be changed and improved soon.

Remember that you have to set YFexport path in user defaults and yafray must
be on path (version 0.0.6)

We added the "yafray" button to activate all this stuff in the render window.
Panel and settings are only shown when checked.

So now when activated the code calls yafray export instead of the internal
renderer and finally the resulting image is loaded back into render window's
buffer. So animation is also possible and results can be saved using blender
usual scheme.
2004-01-04 22:10:36 +00:00
50b6f0aa33 - another oldie! Bug 475, which was wrongly categorized by me as OpenGL
error... Jesterking report helped me finding the mistake! We found out
  that pressing F12 while rendering is in progress, crashes...

Hi Yamyam,

I beg you to forgive me! Totally misread the report... the error was only
in pressing F12 *during* rendering, it even restarts a render then. This
happens always, no matter what is being rendered.

I found the code for renderwindow doesn't use queues to store events, like
in the rest of Blender, but immediately executes incoming events. This
means you can even press ZKEY (zoom) or F11 (hide) while rendering.

In CVS I've committed a patch that checks if Blender renders, before
allowing to execute the F12 event. Also now blocked is F3 (!) during render.
The other options (zoom, push window) still work.

-Ton-
2003-12-03 15:44:11 +00:00
a0471975d8 Adds Hotspot control to custom cursor. 2003-11-12 13:32:11 +00:00
047d18d72c - zoom in/out in rendered image always includes zoom level 1.0 now. 2003-11-06 21:31:47 +00:00
0c00846c65 - commented out the #ifdef APPLE for closing renderwindow.
this only works with compiling GHOST again!
2003-10-25 13:27:12 +00:00
c536fe934f - another fix, now for unix systems with 'sloppy focus'.
the mainwindow is set active again after rendering, without
  destroying the (optional) dispview image
2003-10-10 20:50:21 +00:00
8607322385 - fixed bug in renderwin zoom function. You now can press 'Z' in a window
again, and move your mouse around to scan the image.
  MiddleMouse works too, but less intuitive

- at some systems it is still slow, bad clipping code...
2003-07-19 20:19:31 +00:00
e00a27f9fd * fixed bug: pressing F11 in dispview mode opened a window
* new feature: rendering large images now displays correctly zoomed down
  in an imagewindow. The fact that it didn't also caused unpredictable
  slowdowns at various systems (tested osx, win).
  Of course after rendering you can still zoom in/out as usual.

* there was code that limits the maximum size of an imagewindow, keeping
  a small border around it free. By increasing the border 15 pixels I got
  huge speedup at OSX. Still looks good though...
  Needs more research what is happening here, maybe we need a user setting
  for it... but i rather implement the usage of the internal ImageWindow
  first.
  Still unsolved: 24 bits windows opening... I don't dare yet hacking in it
  Ghost.
2003-07-18 13:20:47 +00:00
4f27386740 Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;


Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)

Stuff that has been done:

./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c

Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.

./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c

The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.

./source/blender/makesdna/DNA_sound_types.h

Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.

./source/blender/makesdna/DNA_scene_types.h

Added AudioData struct, which holds scene-global audio settings.

./source/blender/makesdna/DNA_sequence_types.h

Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.

./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c

Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.

./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c

Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)

./source/blender/src/editsound.c

Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.

./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c

 - Created two different wrappers for update_for_newframe(), one which scrubs
   the audio, one which doesn't.
 - Replaced some of the occurences of update_for_newframe() with
   update_for_newframe_muted(), which doesn't scrub the audio.
 - In drawview.c: Changed the synchronization scheme to get the current audio
   position from the audio engine, and use that as a reference for setting
   CFRA. Implements a/v sync and framedrop.
 - In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
   volume envelopes.
 - In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
   (update_for_newframe()) for moving the sequence editor framebar.

./source/blender/src/editseq.c

Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.

./source/blender/src/buttons.c

Added Scene-global audio sequencer settings in Sound buttons.

./source/blender/src/sequence.c

Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 20:16:56 +00:00
5aa8ac36a1 * F11 now nicely pops/pushes a window again
* works (for OSX) only with the commit I did in Ghost 1 minute ago!
* needs to be checked for all other OS's.
2003-07-09 16:02:39 +00:00
6cc94449de - bug #149.
rendering the current view (view3d header, render) didn't render solid
  drawmode.

  found missing opengl initialization calls in opening renderwin.
  probably remains from ghost migration.
2003-07-05 20:38:31 +00:00
1a32001efc - renderwindow doesn't close when switching from dispwin to dispview
- left out activating the mainwindow after rendering, this is confusing
2003-06-23 08:20:30 +00:00
6dc3b9107c - removed test_break call from #ifdef POSIX part, to prevent double
it now is a cross platform function again.
2003-06-14 14:49:12 +00:00
7a096b4664 - Holger's patch to enable ESC detection when rendering (Win32). 2003-06-14 13:34:35 +00:00
2f56a9b0ca - fixed bug #228
dispview mode now doesnt disappear immedately after render
  oh, what i hated that one!
2003-06-13 16:51:22 +00:00
2b3bc332e4 - again same commit, typo in comment was still there... 2003-06-13 14:04:06 +00:00
075ce0954b - fixed commenting in renderwin.c 2003-06-13 13:54:08 +00:00
073bed8601 - restored functionality for ESC detection during rendering which doesnt
eat up cpu time.
  in fact it was in pre-ghost blender already.

works now for all posix OS's, except for windows. now working on getting
that fixed as well. until then, rendering will be slow at win32...


cvS: ----------------------------------------------------------------------
2003-06-13 13:46:00 +00:00
35007d147e - Completely reorganized renderwin.c, added readable comments and removed
confusing functions which were only used once.
  Part of examining how renderwindows get opened/closed, and to enable
  a third option for render output to ImageWindow in Blender
2003-06-12 10:07:36 +00:00
9174db096b LAST of the c code comment translations... hooray!
Might be possible I mised an .h or so, just notify me in that case.
2003-04-30 13:22:26 +00:00
9cf4ec81cc move renderwindow down a bit so that it doesn't get hidden behind the menu
bar on os x
2003-04-29 16:33:20 +00:00
702880df55 Update things to use blender_test_break() vs MISC_test_break() and
remove use of blendertimer.h
2003-03-24 16:37:08 +00:00
1f3f52f5e4 Update space dispatch:
- drawXXXspace, changeXXXspace, and winqreadXXXspace now receive the area
     and spacedata as explicit arguments, allowing them to access private
     data w/o going through globals.
 - pass the new BWinEvent through to the winqreadXXXspace, allowing future
     access to extended event data.

Removed direct calls to winqreadXXXspace to simulate user actions, replaced
by calls to action functions in edit.c or the appropriate handler.
2003-03-24 01:46:05 +00:00
948638f140 don't close the render window on OS X 2003-02-08 13:51:55 +00:00
d0e346d544 updated .c files to include:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Just need to finish cpp files now :)

Kent
--
mein@cs.umn.edu
2002-11-25 12:02:15 +00:00