Commit Graph

120055 Commits

Author SHA1 Message Date
Ken Hughes
69d00bccaa ===Python API===
Bugfix: make face and edge .extend() methods check that input vertices are
from the same mesh.  Fixes a bug found by Cam.
2006-02-17 17:50:54 +00:00
Ton Roosendaal
6f62023850 - Added option 'convert to premul' to AlphaOver node in Compositor
- Fixed mix mode "Overlay", it was missing a multiplication with 2 :)
- small bugix in Matts nodes commit, wrong pointers transfered to coltobw()
2006-02-17 15:44:46 +00:00
Matt Ebb
90fa460d2a 3 very simple new composite nodes that I wanted for working with here. Hope the code is ok,
they work ok in testing here and get done what I need, any checks or fixes are welcome.

* Separate RGBA: Separates an input RGBA image into its R, G, B and A channels
* Separate HSVA: Separates an input RGBA image into H, S, V and A channels
* Set Alpha: Takes an input RGBA image and an alpha value channel and combines them
into a single RGBA image channel. You can also set the alpha for the entire image
with the number field when there's no input alpha channel. TODO: Allow input alpha
channel with no input image, in order to output a solid colour, with alpha.
2006-02-17 13:51:55 +00:00
Ken Hughes
7592c09c2b ===Python API===
Allow object.setMatrix() to accept 3x3 matrices by extending to a 4x4
internally.  Also check the dimensions of the new matrix and throw an
exception if not a 3x3 or 4x4.
2006-02-16 20:09:32 +00:00
Ton Roosendaal
fe036a0538 Added new malloc type in our MEM module; using the unix feature 'mmap'.
In Orange we've been fighting the past weeks with memory usage a lot...
at the moment incredible huge scenes are being rendered, with multiple
layers and all compositing, stressing limits of memory a lot.
I had hoped that less frequently used blocks would be swapped away
nicely, so fragmented memory could survive. Unfortunately (in OSX) the
malloc range is limited to 2 GB only (upped half of address space).
Other OS's have a limit too, but typically larger afaik.

Now here's mmap to the rescue! It has a very nice feature to map to
a virtual (non existing) file, allowing to allocate disk-mapped memory
on the fly. For as long there's real memory it works nearly as fast as
a regular malloc, and when you go to the swap boundary, it knows nicely
what to swap first.

The upcoming commit will use mmap for all large memory blocks, like
the composit stack, render layers, lamp buffers and images. Tested here
on my 1 GB system, and compositing huge images with a total of 2.5 gig
still works acceptable here. :)

http://www.blender.org/bf/memory.jpg
This is a silly composit test, using 64 MB images with a load of nodes.
Check the header print... the (2323.33M) is the mmap disk-cache in use.

BTW: note that is still limited to the virtual address space of 4 GB.

The new call is:
MEM_mapalloc()

Per definition, mmap() returns zero'ed memory, so a calloc isn't required.

For Windows there's no mmap() available, but I'm pretty sure there's an
equivalent. Windows gurus here are invited to insert that here in code! At
the moment it's nicely ifdeffed, so for Windows the mmap defaults to a
regular alloc.
2006-02-16 17:51:01 +00:00
Ton Roosendaal
7f4b01ccf0 Rendering tricks for improving workflow:
- Button option "Single" in render-layer panel will enable to only render
  the currently indicated render-layer. It will also skip compositing.

- Brought back the 'Local View' render. This will only render the visible
  objects, but with lights from the original view-layers.
  To make the option useful, it also temporal enables 'Single', which has
  the a disadvantage that you need to set the correct render-layer.

  It is a bit a tricky option though... since its quite invisble and
  confusing for people who don't know the feature. This might become either
  a button in 3d header, or use a popup requester to confirm, or... will
  need to think over!

At least; both options display in render window a text to denote the option.
2006-02-16 12:27:46 +00:00
Brecht Van Lommel
32a9c7b493 ==UV Editor==
Small ABF stability improvement, do some angle clamping during iteration,
fixes a particular model that went wrong.
2006-02-15 22:33:55 +00:00
Brecht Van Lommel
9fedbd6c51 ==Python==
Small bug reported on irc, matrix.translationPart didn't check bounds
properly (needed to use || instead of &&). Also fixed similar bugs in
rotationPart and rich compare.
2006-02-15 22:31:43 +00:00
Ton Roosendaal
55610ac7c1 We found out memory got fragmented a lot for creating speed vectors on
large scenes... this because it has to make 3 entire databases to find
the vertex-speed to previous and next frame. Even though most of the
prev/next database was freed, the parts I kept were spread all over
memory.

This commit copies from the prev/next database only the two screen aligned
speed vectors and stores that in temporal per-object structs. Even whilst
it takes more memory, it then can free the entire database, making space
for the next database to be built.
Tests reveiled it saves quite some... well, if you want to believe the
'virtual memory' total unix gives... :)
2006-02-15 19:55:29 +00:00
Ton Roosendaal
8d0a2c4192 Added printing stats back in commandline renders. Prints now a full 'log',
using 1 line per part rendered. Might go back to 1 line again, but at this
moment I need the logs for debugging.
Same prints are active now for UI rendering. Just temporal :)
2006-02-15 15:22:49 +00:00
Ton Roosendaal
9ef9d66a26 - Preview render (buttons) was executing the 'data ipos', causing inserting
keys with IKEY in buttons to not work.

- Crash in opengl while rendering was caused by the fact that scanline
  updates are drawn in the main thread, whilst the actual render thread
  then can already be doing different stuff.
  Especially with many layers & passes it's getting confusing easily :)

  Convention now is that scanline render updates only happen while the
  thread is looping over scanlines. As soon as it reached the last, no
  drawing happens, not even to update the last segment.
  This isnt a problen, since any finished tile is drawn again entirely.
2006-02-15 09:35:01 +00:00
Jean-Luc Peurière
8bc0060835 added proper casts to get things compiling with gcc 4.0 Os X 2006-02-14 23:52:47 +00:00
Alexander Ewering
343dbc5580 Fix for report #3916: The background image size/offset buttons now have
max values multiplied by the view's grid setting, like most other buttons
dealing with sizes and locations.

Sorry, untested, as I can't get it to link (error while loading
shared libraries: libavformat.so)
2006-02-14 22:17:23 +00:00
Ton Roosendaal
11293a6492 Potential fix for crashing ogl in drawing render updates... ATI only?
I don't know why, but at Andrea's system it goes fine.
2006-02-14 22:14:14 +00:00
Ton Roosendaal
c9fa1a23e4 Forgot to commit define.... tsk! 2006-02-14 19:25:33 +00:00
Ton Roosendaal
3eb971abcc Added 'screen' to texture mixing menu as well. 2006-02-14 18:47:21 +00:00
Ton Roosendaal
1c7187f4fc Added blending type "Overlay" to options for Mix node & ramp shaders.
The description is here; it blends nicely bright parts.
http://www.pegtop.net/delphi/articles/blendmodes/overlay.htm
2006-02-14 18:41:34 +00:00
Ton Roosendaal
acb5f6e79f Added callback to compositor, so it can print in RenderWindow header the
current to-be composited node and amount of memory in use.
2006-02-14 18:04:25 +00:00
Johnny Matthews
86e9faad70 A small alteration for C syntax, code and vars mixed up (MSVC complained about this). 2006-02-14 17:55:55 +00:00
Ton Roosendaal
57243ce834 Render Layer button typo... 2006-02-14 17:35:38 +00:00
Ton Roosendaal
3cf0bbfa17 Nasty memory conflict in Compositor... when:
- a Group has Curve node inside
- this Group was re-used more times
- with threaded render activated
- and both groups executed on same time

Then the premultipy optimize table was created twice... causing memory
to confuse.
2006-02-14 17:32:49 +00:00
Ton Roosendaal
b9bd02e590 Uncommitted button "Single" from render-layer panel... this was supposed
to be a new feature, but have not working code for it yet :)
2006-02-14 16:16:23 +00:00
Ton Roosendaal
ec42d60c3d Weekly cleanup in my precious blender tree :)
Unused variables, missing prototypes mostly.
2006-02-14 11:46:45 +00:00
Ton Roosendaal
ff830a98f4 Dangerous typo in softbody.c... a missing '/' made a /* */ comment to
disable the entire next line of code too.
2006-02-14 11:30:43 +00:00
Ton Roosendaal
9da59fdb5a Bug fix: copying a scene, choosing 'empty scene' did a corrupt copy of the
scene render layers

Little feat: Render Result Nodes that use other scene, have icon in button
to indicate this.
2006-02-14 11:28:13 +00:00
Ton Roosendaal
86511abe5a Reviewed octree filling times... found a way to optimize some 10% of time,
nothing radical. :)
Just remember to always try higher octree resolutions (256 or 512) or more
complex scenes. Can be 5-10 times faster.

For waiting pleasure; added a per-second header print update to tell where
octree is. Also added an ESC test in octree making.

(Commit in image.c is a faulty print for 'Not an anim').
2006-02-14 10:02:25 +00:00
Ton Roosendaal
92e0925ecb Made threaded Compositing more friendly for last node in list... the main
thread entered a loop without sleep() then.
2006-02-14 00:05:09 +00:00
Ton Roosendaal
cf02e6d822 Bug in vector blur; the mask anti-alias code was accidentally using a char
for counting the size of a 'jaggie' to be antialiased, which can of course
be more than 255 pixels in size... causing eternal loop.
2006-02-14 00:04:07 +00:00
Geoffrey Bantle
1f21e2eea7 Modified Files:
source/blender/blenlib/BLI_editVert.h
 	source/blender/include/BIF_editmesh.h
 	source/blender/src/edit.c source/blender/src/editmesh.c
 	source/blender/src/editmesh_lib.c
 	source/blender/src/editmesh_mods.c
 	source/blender/src/editmesh_tools.c
 	source/blender/src/header_view3d.c
Log:
	Commit of the 'upgraded merge tools' (Patch #3345) and 'inclusive selection mode conversion' (Patch #3768).
2006-02-13 22:49:46 +00:00
Ton Roosendaal
9104862f48 Typo in smart SETLOOPER() define, which I added to prevent nasty loop
code for going over all objects in set. :)
2006-02-13 22:38:41 +00:00
Ton Roosendaal
2a8cafbb03 Fix in blur filter 'bokeh'.
This filter type uses a filter-image, and spreads color of current pixel
over all neighbour pixels based on this filter-image. That creates a
problem on borders... since there only parts get accumulated.

Solved by going over the to-be-filtered image pretending it is wider
exactly the amount of the filter-image size.
2006-02-13 21:40:47 +00:00
Matt Ebb
5b7398ce53 Updated Mac OS X icons courtesy of Erik Mendoza, re. this thread on blender.org:
http://www.blender.org/forum/viewtopic.php?t=8121
2006-02-13 21:08:43 +00:00
Ton Roosendaal
2d7e61df40 Ugly bug in ungrouping... it left freed memory in the main database. 2006-02-13 20:39:31 +00:00
Ton Roosendaal
2a67307215 Bugfix: When using 'border render' (part image), and then in compositor
the Preview Panel, you got a crash... this case wasn't anticipated in
code... two cropping mechanisms on top. :)

Works OK now, but offset of cropping is drawn a bit weird... this case
needs recode a bit. On list for later.
2006-02-13 20:14:42 +00:00
Ton Roosendaal
6b22c5746e Bugfix: the RenderResult node, using another scene, didn't use the
frame nummers of the active scene.
2006-02-13 19:38:31 +00:00
Ton Roosendaal
ff7f544dec Preview rendering improvement;
Until now, on each mouse/key event preview render restarted with first tile.
It now rememers where it was, and continues rendering.
Also tried to get threaded preview working, but its more work than I can
spend right now. Back to bugs :)
2006-02-13 19:27:16 +00:00
Ton Roosendaal
f9d7f9ea45 Bugfix in Preview renders; material with lightgroups didn't get initialized
correctly.
2006-02-13 11:52:55 +00:00
Erwin Coumans
f55e45f855 more vehicle preparation and some bullet collision detection bugfixes (related to collision margin) 2006-02-13 06:28:35 +00:00
Erwin Coumans
e4790aef46 Improved OpenGL Shader Language support for game engine. The python interface is much simplified. Drawback is that scripts need to be updated next release. Testfiles:
http://www.continuousphysics.com/ftp/pub/test/index.php?dir=blender/&file=demos-2.42.zip

patch by Charlie Carley (snailrose @ elysiun.com)
2006-02-13 05:45:32 +00:00
Erwin Coumans
6c325d74f5 gameplayer will use blender materials automatically 2006-02-13 03:37:00 +00:00
Kent Mein
4c966a3141 assignment typo: had == instead of =
Reported by jkw on the forums.
source/blender/python/api2_2x/Text3d.c

Kent
2006-02-13 01:25:03 +00:00
Ton Roosendaal
9809c7807b Couple of smaller fixes:
- Improved stats drawing while rendering, it now draws - while preparing
  renderdata -  each second the amount of verts/faces.
  Also while rendering, the amount of finished and total parts are printed.

- Added ESC in loop that generated Group render data

- On deleting Render Layers, the nodes that use them are now checked and
  corrected.

- Restored drawing all scanlines in renderwindow... this wasn't the bug!
2006-02-12 21:57:56 +00:00
Martin Poirier
94332c522e Bug #2839: Shift key not working in Shear, Push-Pull and shrink-Fatten
- I changed the input method for shear quite a bit. It used to be constant
  regardless of zooming, so it was quite limiting in the amount of shear you
  could do. However, I'm not sure if the current method is quite well
  adjusted, if you think it works too fast, please drop me a line.
  It's basicly the same method as Shrink-Fatten / Push-Pull except on an
  horizontal basis. (since shear is an horizontal motion and the two others
  are more like pulling towards/pushing away from you in regards to the center)
- Factored out the input methods in preparation for later code <evil>.
2006-02-12 21:09:18 +00:00
Ton Roosendaal
f4dc04ecbf Work on shadowbuffer system... right now only new filtertypes for
sampling have been activated for UI. Check the pictures here:

http://www.blender.org/bf/filters/index2.html

I also did do tests with anti-aliased shadowbuffers:

http://www.blender.org/bf/filters/index3.html

But this needs more thinking over still...
2006-02-12 20:21:08 +00:00
Ton Roosendaal
ed2543866c Argh! Commented out line in readfile.c (with comment I really dont know
what this does), actually makes sure that on linking same data from a
library again (after reopening file), the linking of data pointers goes
OK.
2006-02-12 20:17:12 +00:00
Jean-Luc Peurière
4dfa22b6d0 commiting patch #3847
add drag-lock to numbuts to prevent accidental adjustemnts.
Patch furnished by Roger Prefontaine (isocles)
2006-02-12 18:25:53 +00:00
Ton Roosendaal
ed4cc927a7 Couple of features/fixes:
- Compositor now frees memory of buffers internally used in groups
  immediately. This wasn't part of the event-based cache anyway

- New option: "Free Texture Images" (in render Output panel). This
  frees after each render of each scene all images and mipmaps as
  used by textures. As reference it prints total amount of MB freed.

- Render stage 'creating speed vectors' had no ESC checking yet

- Made drawing scanline updates during render draw 1 scanline less...
  dunno, still hunting for weird opengl crashes.

- 3D preview render didn't properly skip sequence or composit render.
2006-02-11 23:17:41 +00:00
Ton Roosendaal
5f29f97f81 Switching glFlush() to glFinish() in renderwindow drawing for updates...
no idea if it helps, will be tested now. :)
2006-02-11 18:20:17 +00:00
Ton Roosendaal
c2bc882bb9 Bugfix: duplicate time node didn't copy the curve itself. 2006-02-11 16:52:18 +00:00
Ton Roosendaal
f4e491e2f4 Thread rendering stability commit.
I noticed still several cases where the Imbuf library was called within a
thread... and that whilst the Imbuf itself isn't threadsafe. Also the
thread lock I added in rendering for loading images actually didn't
work, because then it was still possible both threads were accessing the
MEM_malloc function at same time.

This commit nearly fully replaces ImBuf calls in compositor (giving another
nice speedup btw, the way preview images in Nodes were calculated used
clumsy imbuf scaling code).

I've also centralized the 'mutex' locking for threading, which now only
resides in BLI_threads.h. This is used to secure the last ImBuf calls
I cannot replace, which is loading images and creating mipmaps.

Really hope we get something more stable now!
2006-02-11 15:55:00 +00:00