Commit Graph

6324 Commits

Author SHA1 Message Date
Erwin Coumans
c2782ce10e added 'disable sleeping' option for rigidbodies. + bugfix of out of sync wheels for vehicle 2006-02-22 06:58:05 +00:00
Geoffrey Bantle
dcb751725e [Two Sections here; First is the log that *should* have been included
to my previous commit (whoops). The second part covers the changes I
have made to the code since then (all related to merge tools code).]

# Part One: Complete Log for Commit from 2/13/06

-> Upgraded merge tools.

The new merge tools add several options to blenders Merge submenu,
accessed via the WKEY whilst in Editmode for meshes. The new options
depend on current mode:

- Vertex mode: "At First" and "At Last"

When choosing "At First" or "At last" it will merge all selected
vertices at the first or last selected vertex.

(Note: Blender now keeps track of the last and first verts selected in
editMode (G.editMesh->lastvert and G.editMesh->firstvert
pointers. This meant additions were made to the undomesh code in
editmesh.c as well).

- Edge mode: "Collapse Edges"

When choosing this option, Blender examines the current set of
selected edges and groups them according whether or not they are
topologically connected. It then goes through each group and merges
them one by one to a single point.

- Face Mode: "Collapse Faces"

Works the same as "Collapse Edges", only works on groups of
topologically connected faces.

-> Inclusive selection mode conversion.

This feature extends the ability of blenders selection mode
conversions. Currently when you change selection modes from a "lower
order" mode to a "higher order" one (vertex->edge, vertex->face or
edge->face) blender only selects elements in the new mode whose
elements were completely selected in the previous mode.

This patch does not change blenders default behavior but offers
implicit selection mode conversion as an alternative. To access it,
hold either the left or right CTRL keys and click on a selection mode
in the view 3d selection mode header buttons. This can be accessed via
the CTRL-TAB selection mode switching as well, simply hold CTRL while
clicking the mode you want or entering its number on the keypad.

In some programs, such as Wings and Mirai, it has been demonstrated
that it can also be very useful to exploit selection mode switching to
implicitly select previously unselected elements as well. For instance
switching selection mode from vertex to edges will select all edges
currently associated with the currently selected vertices. The same
behavior is applied to switching between vertex->face and
edge->face. By exploiting this sort of selection conversion complex
selection sets can be built quicker.

Furthermore I modified blenders UndoMesh code to make selection mode
switching "undo coherent". Aside from its relevance to inclusive
selection mode conversion, this really counts as a "bug" in my
mind. Previously selection mode switch could cause the selection state
of the mesh to be invalid when certain modeling operations were
undone. An example of this would be "edge subdivide-> switch to face
mode-> undo"; you end up with edges selected while still in face mode!


# Part Two: Log for this Commit

-> Code Cleanup

As per Ton's request I reformatted all my code, changed variable names
and eliminated my use of "LinkNode" structs and replaced them with
"ListBase" instead. There should be no warnings while compiling now
either.

-> Remove doubles bug

Fixed small problem in removedoublesflag() in editmesh_tools.c that
caused editface structs to get their UV's scrambled. Vertex colors
might not be safe though? Need to investigate later.

-> Small bug in in the the code for merge last/first

It could cause a crash when exiting editmode, switching meshes, then
entering editmode again. "lastvert" and "firstvert" pointers are now
set to NULL whenever exiting editmode now (see load_editmesh() in
editmesh.c). I will find a better solution to this *soon*...

-> All merge tools now UV aware (optional)

The default behavior is to leave UVs alone, but if you hold CTRL while
clicking on the menu entry, UV's are merged. This works fine in most
situations, although some investigation into how to best handle
merging of UVs at the border of UV islands needs to be done.

This last item brings up a point about the current state of the
interface: several functions accessed through the WKEY menu now use
the CTRL modifier to change how they behave (This convention has been
in place for a while, see subdivide for example). Unfortunately there
is no way to communicate the way modifier keys change the behavior of
certain functions to the user. This makes such options invisible for
all intents and purposes...
2006-02-22 02:17:56 +00:00
Ton Roosendaal
ecaee2e3c8 Fix for very old annoyance; when an object is deformed far away from its
object center, it doesn't generate displaylist (or derivedmesh). This
error showed especially on loading files, and you had to advance frame,
zoom out or press Numpad-9 to see stuff.
2006-02-21 22:42:33 +00:00
Ton Roosendaal
4a7409186f Fix for crashing border select in FaceSelect mode. This was part of the
exr & floatbuffer merge of january 9... faulty code I didn't check.
2006-02-21 22:11:46 +00:00
Chris Want
96a21d5924 Making blender compile with Makefiles if WITH_OPENEXR is false. 2006-02-21 21:24:06 +00:00
Chris Want
957832ecf1 Trying to get the bullet re-org to work with Makefiles. 2006-02-21 20:45:20 +00:00
Campbell Barton
ab4bca8db9 Tracked a redrawing crash down to drawtext.c - was doing ... % 0 causeing a devide by zero, just check for a zero value. 2006-02-21 15:49:45 +00:00
Nathan Letwory
30a9f0b053 ==SCons==
* accidently left WITH_BF_STATICOPENGL enabled for non-linux. tsktsk.
2006-02-21 14:24:08 +00:00
Ton Roosendaal
b9eb5620b5 Bug in Composite AddAlpha node. The option premul added alpha wrong. 2006-02-21 12:41:48 +00:00
Nathan Letwory
11fd198a70 ==SCons==
* when WITH_BF_STATICOPENGL=1 on Linux Blender will be statically linked
  against GL libraries. NOTE: I used values that worked on my machine -
  platform managers and people who have better knowledge about this, please
  modify config/linux2-config.py accordingly.
2006-02-21 12:36:50 +00:00
Ton Roosendaal
a2a2ad98e2 Carefully went over all scanline updating while rendering, to ensure only
updates are allowed to draw when a part is within a scanline rendering
loop. Might solve threads issues with opengl...
2006-02-21 10:47:08 +00:00
Erwin Coumans
02dc8de55d included WheelInfo headerfile rather then forward declare (gcc stl container needs actual class information) 2006-02-21 07:33:19 +00:00
Erwin Coumans
e3b840d086 exposed a few more tuning paramters 2006-02-21 07:08:23 +00:00
Erwin Coumans
e4d8bd5984 added vehicle specific files + updated scons file (Makefile/projectfiles need updating) 2006-02-21 06:08:58 +00:00
Erwin Coumans
5913414bf4 enabled vehicle/updated scons file (Makefile/projectfiles needs updating) 2006-02-21 06:08:18 +00:00
Erwin Coumans
730c02f3fe updated scons file, case-sensititivy problem fixed 2006-02-21 05:57:46 +00:00
Erwin Coumans
90e5a9aa14 Reorganized Bullet physics files, added preliminary vehicle simulation files (disabled).
Requires some changes to projectfiles/makefiles/scons, for the added and removed files!
2006-02-21 05:36:56 +00:00
Ton Roosendaal
a6e7ff5ee9 Very silly typo in code caused Preview Window for Compositor to copy
Z values wrong... :)
2006-02-20 21:11:02 +00:00
Ton Roosendaal
ec47d960dc Compositor: new node "Z Combine", to combine two images with comparing
depth values. Current version doesn't make nice AA though... that I
check on next.
2006-02-20 18:33:55 +00:00
Ton Roosendaal
11a5d80420 Group duplicators, using linked groups, and which itself again were
linked, did not expand group.
2006-02-20 17:44:21 +00:00
Ton Roosendaal
04ec4a2530 Compositor upgrade;
- Links now can be made between any socket type. The nodes recognize amount
  of channels, and will convert types if needed.
  Conversions from RGBA to 1 channel will use the 'RGB to BW' formula.

  Also note that conversions only happen when required. So you can blur an
  alpha channel, filter it, and put this in a 1-channel socket without any
  conversion to happen, which saves memory & cpu time.

  http://www.blender.org/bf/rt.jpg

  The blur nodes don't accept Vector input yet... But filter does.

- RGB Curve Nodes now have the premultiply option resored, 2 x faster

- Fixed some confusing code in Node Group handling... much stabler now
2006-02-20 13:43:40 +00:00
Campbell Barton
003b8ae2ef Another fix for a silly bug 2006-02-20 10:31:24 +00:00
Ton Roosendaal
24adc4f645 Hrms... theeth indeed cleaned up code, but it should also work! Didn't
compiling show the warnings?
2006-02-20 10:06:50 +00:00
Campbell Barton
883d56e922 tweak colin weighting again. 2006-02-20 05:30:15 +00:00
Campbell Barton
23e55acfcb Small update...
Bugfix, Wrongly waited colinear test that caused quads with co-linear edges to be made.
 Bugfix, Use active object even if unselected.
 Optimize, Skip further tests if face pair is above the quad error limit.
 Optimize, Faster edge/Face user dict creation ~10%
 Feature: Options to ignore VCols and UV's as delimetres.
2006-02-20 05:11:04 +00:00
Nathan Letwory
29a5fbc6b7 ==SCons==
* add -pthread compile switch for linux2 platforms to be on the safe side.
2006-02-19 22:21:45 +00:00
Ton Roosendaal
21be45b66e Another attempt to solve linux issues.... now threads get killed in
end instead of using SDL_WaitThread from example code...
2006-02-19 21:34:23 +00:00
Ton Roosendaal
1e95376410 Changing a glFLush() in glFinish() for drawing info text in renderwindow...
seems to be a reason for opengl crashes with thread render?
2006-02-19 20:53:07 +00:00
Nathan Letwory
0876e99ccf ==SCons==
A working configuration file for win32/mingw, provided by Rehno Lindeque.
Thanks!
2006-02-19 19:33:36 +00:00
Martin Poirier
012f56c3d6 Patch: [ #3283 ] strcat --> sprintf
Less yuckiness!
2006-02-19 18:41:33 +00:00
Martin Poirier
da6b87abb1 Path: [ #2789 ] Add a "copy size" constraint
At long last!
This new constraint is pretty simple. Following in the footsteps of such giants as Copy Loc and Copy Rot, it lets you constrain the size of an object/bone to another object/bone, with per axis restrictions.
2006-02-19 17:42:20 +00:00
Ton Roosendaal
c7b472a54e Composite: Added "Fac" input for AlphaOver, so you can control amount. 2006-02-19 17:25:51 +00:00
Ton Roosendaal
0c1a1a855c Fix for Colorband node, it skipped calculus when 1 output was unused :) 2006-02-19 16:33:19 +00:00
Ton Roosendaal
130c41c7ba More compositing goodies.
- Texture Node
Allows to use any Blender Texture block as input for masks or color
blending. The texture node doesn't generate a real image, but adjusts to
the size as mapped with during an operation. So it won't work to use it
as Image input for Blur or Filter nodes.

Note; the Vector inputs for this node only work with manual input now!

- Translation Node
Give any image an offset in X or Y direction

For the Texture node to work, I needed to move the central 'pixel
processor' up one level... to allow differently sized images to merge
and allow 'procedural images' without size.

Temporal image of the day: http://www.blender.org/bf/rt.jpg
2006-02-19 14:55:16 +00:00
Brecht Van Lommel
f624730d26 Warning fix in subsurf_ccg.c. Also changed subsurf UV vertex and edge
handles to be more consistent.
2006-02-19 11:37:50 +00:00
Ton Roosendaal
427339fd0b Adding new SpotLamps should get 'buffers' set to 1. Was in the do_version()
check, but not in adding lamps... this will fix crashing shadowbuffers.
2006-02-18 19:35:53 +00:00
Ton Roosendaal
d128c19081 Added mask input for new Hue/Saturation Node. 2006-02-18 17:07:30 +00:00
Ton Roosendaal
7117d7f2c3 The regular warning fix update; includes two variables that were used
without initialization.

For Brecht:

source/blender/blenkernel/intern/subsurf_ccg.c:329: warning: left-hand operand of comma expression has no effect

This line I don't understand...
2006-02-18 16:21:32 +00:00
Ton Roosendaal
f4ddc2fde2 Quick change in Hue/Saturation Node: made the central Hue value 0.5, to
make applying changes easier. Saturation slider goes to 2.0 now.

Fix: rendering compositing nodes without scene crashed in header stats
drawing.
2006-02-18 15:57:46 +00:00
Ton Roosendaal
1ea9099474 - Restored "dither" option for conversion from float -> byte images.
This now is a post-process option only (used to be in render).
  It is only handled within the Imbuf/ module, on conversions from float
  to byte rect, which atm mostly happens on saving images.

- Small fix: when using Scene RenderLayer nodes, the speed vectors for
  these nodes were not created when that scene had "Do Composite" off.
2006-02-18 14:35:43 +00:00
Ton Roosendaal
7425a8fcaa Small tweak to get openexr compiling in scons 2006-02-18 14:26:38 +00:00
Ton Roosendaal
387f9a7c6d Four-in-one commit:
(NOTE: new include dependency in Render module, might need MSVC update!
It has to include the imbuf/intern/openexr/ directory in search path)

-> New Composite node: "Hue Saturation".
Works like the former 'post process' menu. There's no gamma, brightness or
multiply needed in this node, for that the Curves Node functions better.

-> Enabled Toolbox in Node editor
This now also replaces the SHIFT+A for adding nodes. The nodes are
automatically added to the menus, using the 'class' category from the
type definition.

Current classes are (compositor examples):

Inputs: RenderResult, Image
Outputs: Composite, Viewer
Color Ops: RGB Curves, Mix, Hue Saturation, AlphaOver
Vector Ops: Normal, Vector Curves, Map Value
Filters: Filter, Blur, VectorBlur
Convertors: ColorRamp, RGBtoBW, Separate RGBA, Separate HSVA, Set Alpha
Generators: RGB, Value, Time
Groups: the list of custom defined nodes

-> OpenEXR tile saving support
Created an API for for saving tile-based Images with an unlimited amount
of layers/channels. I've tested it for 'render result' now, with the idea
that this can (optionally) replace the current inserting of tiles in the
main result buffers. Especially with a lot of layers, the used memory for
these buffers can easily go into the 100s of megs.
Two other advantages:
- all 'render result' layers can be saved entirely in a single file, for
  later use in compositing, also for animation output.
- on each render, per scene, a unique temp file can be stored, allowing
  to re-use these temp files on starting Blender or loading files, showing
  the last result of a render command.

The option is currently disabled, needs more work... but I had to commit
this because of the rest of the work I did!

-> Bug fix
The Image node didn't call an execute event when browsing another image.
2006-02-18 13:28:44 +00:00
Erwin Coumans
78942aa843 temporarily fix from Johnny Matthews committed, win32 doesn't have munmap. Someone can worry about a future mmap-like implementation. 2006-02-17 20:18:49 +00:00
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