Commit Graph

388 Commits

Author SHA1 Message Date
Matt Ebb
3e272f6797 * Patch from Ed Halley:
"Swaps left and right bytes of small cursors for Carbon on Intel."

This fixes garbled cursors on Intel Mac builds. Tested on my G4 too and it works fine.
2006-06-19 04:04:31 +00:00
Nils Thuerey
b0a22902ec - another minor solver update to fix
obstacle fluid surface generation bug
- also contains some code clean ups
  and safer initializations
2006-06-12 12:55:51 +00:00
Nils Thuerey
a0d94e6727 - added fix for fluidsim copying bug
(surface mesh structs werent handled correctly,
  copying is now done in a new function)
2006-06-12 06:18:57 +00:00
Stephen Swaney
43e776690f removed extra qualifier on class memeber bool BOP_Mesh::isClosedMesh(); 2006-06-10 17:50:52 +00:00
Ken Hughes
6d2adf66e5 ===Tools===
Another boolean bugfix: don't add faces which contain only two vertices
(actually, triangles with two identical vertices).
2006-06-10 16:00:38 +00:00
Ken Hughes
7fcc5800ae ===Tools===
Adding back some code to booleans that got lost in the Orange merge.

I've also added back the code which checked that meshes were solid
("manifolds") but have the actual check in
intern/boolop/intern/BOP_Interface.cpp, since from my testing it was
not causing crashes or hangs.  It *can* give odd results depending on
what you're trying to intersect, but seems useful.  Additionally, since
existing bugs in the current code can create non-solid/non-manifold
meshes, seems hypocritical to create a mesh that can't later be used in
another boolean operation.
2006-06-10 15:47:19 +00:00
Ken Hughes
5c95302043 ===Tools===
Previous patch for "problems with STL iterators/vectors that only show up under
Visual Studio 2005" could cause a crash when object used as a boolean modifier
was changed (for example, flipping all the normals).  The problem is that result
of boolean operations (apparently) can result in empty meshes.  Patched to
use the vector::size operator to check for empty vectors before trying to
check the iterator.
2006-06-08 03:10:26 +00:00
Ken Hughes
b8c6c1fdf0 ===Tools===
Bug "fix" for #3932, and possibly for #3799.  Booleans can get into an endless loop (at least until memory runs out); through triangulation somehow a face is repeatedly added to the list of faces to triangulate.  This patch checks the face list for duplicates prior to a list add and aborts if a dup is found.

The real issue is why the triangulation is creating the face in the first place, but that will take a more thorough (and longer) examination of the code.  If I can fix that issue that prior to the 2.42 release, then this code can be removed.
2006-06-06 17:43:57 +00:00
Ken Hughes
a57bb6bee1 Bugfix #4081: support for OpenBSD platform for scons. Big thanks to Nathan Houghton for this contribution. 2006-06-05 15:52:26 +00:00
Erwin Coumans
abd8fba47f applied patch [ #4207 ] Boolean operations fix
Also fixed other problems with STL iterators/vectors, that only show up under Visual Studio 2005.

See also http://projects.blender.org/pipermail/bf-committers/2006-May/014608.html
2006-06-02 18:17:40 +00:00
Nils Thuerey
38547345e7 - fixed geometry init (object id init was missing)
- added more std::string fixes from bjornmose
2006-05-16 08:54:08 +00:00
Joseph Gilbert
3be8e53c10 update to msvc7 projectfiles 2006-05-13 14:46:48 +00:00
Jens Ole Wund
1e23c080de Happy msvc6 again .. however some new std::std::strings in El'Beem
i'll give it to nils later on
2006-05-12 22:00:27 +00:00
Nils Thuerey
74fc4fa254 - fixed MSVC problem in fluidsim.c
- removed some more debug output in the solver
2006-05-11 13:19:41 +00:00
Nils Thuerey
6d935aee42 - New options for mesh voxelization: shell only (also
works for non closed objects), volume ("normal"/old way of
  doing it), and a combination of both:
  http://www10.informatik.uni-erlangen.de/~sinithue/blender/voltcomp_sm.jpg
- Finally included bjornmose MSVC6 fixes
- Added support for animated meshes, e.g. meshes with
  parented skeletons. Is enabled for obstacles with a new button.
  A simple example with Bassam's mancandy can be found here:
  http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid2_mancandy.mpg
  http://www10.informatik.uni-erlangen.de/~sinithue/blender/fluid2_mancandy.blend
  (Warning - keep meshes as simple as possible, e.g. turn off subsurf
  for baking. Export probably shoulb be further optimized.)
- Changed handling of no/free/part slip obstacles, see:
  http://www10.informatik.uni-erlangen.de/~sinithue/blender/bndtcomp_sm.jpg
- Removed surface particle option for upcoming release,
  needs more testing & tweaking
- Added tracer particles instead (swimming along in the fluid)
- Updated wiki (description of IPOs still missing).
2006-05-11 08:09:02 +00:00
Kent Mein
d5ae204275 This is a bit of a hack, but it looks like sun
Used F11 and friends for its special keys Stop,again etc..
                  So this little patch enables F11 and F12 to work as expected
                  following link has documentation on it:
                  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4734408
                  also from /usr/include/X11/Sunkeysym.h
#define SunXK_F36               0x1005FF10      // Labeled F11
#define SunXK_F37               0x1005FF11      // Labeled F12

I also added a comment explaning why the heck its there...

What this means is XK_F11 and XK_F12 do not line up with the F11 and F12
keys on sun keyboards.  So I've added special cases to correct the issue.

Doing a quick grep for XK_F shows there are some files in the
gameengine that use them when they probably shouldn't, but I'm not going to
attempt to fix them, Files that should be looked at are:
gameengine/BlenderRoutines/KX_BlenderInputDevice.h
gameengine/Converter/KX_ConvertSensors.cpp
gameengine/GameLogic/SCA_IInputDevice.h
gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp
gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp
gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp
gameengine/Ketsji/KX_PythonInit.cpp

Kent
2006-05-10 19:46:06 +00:00
Jens Ole Wund
70c7865e85 msvc6 project linking with shell32.lib to see SHGetFolderPath()
removing dead files in el'beem however the "std::std::string" problem is still there
still no GE
2006-04-18 08:56:55 +00:00
Joseph Gilbert
f54a113cde Update to the VC7 projectfiles.
This should bring the projectfiles upto date for msvc7.

Moving these to version 7.1 so that the version 8 people don't have such a hard time importing into 2005.

Build intern.sln, extern.sln and then blender.sln. Enjoy. :p
2006-04-17 20:05:39 +00:00
Kent Mein
3815e20ad6 I renamed a couple of simple variables to prevent warnings about
variable blah at a higher scope is already defined...
(one of these was introduced by me when I moved a variable declaration
to the top of the function.)

Kent
2006-04-06 17:27:15 +00:00
Ton Roosendaal
f3d8d8e067 Upgrading in 10.3 to quicktime 7 seems to remove a header file, which
stops Ghost from compiling.

Information on this link here:
http://www.cocoadev.com/index.pl?CarbonSound
2006-04-05 11:59:20 +00:00
Chris Want
d61be50bee ==Nothing to see here, move along==
Removing some outdated files from elbeem, as suggested by Nils.
(Compiles OK without them.)
2006-03-30 14:23:25 +00:00
Chris Want
7fb2bf5430 ==Nothing to see here, move along==
Try to get the yy_wrap and yy_parse definitions for IRIX. Hoping
that it will also help Kent's multiply resolved warnings, I've done
this so that these symbols are defined only if they are currently
undefined. I'm not sure if it will work though, please test!
2006-03-29 23:14:37 +00:00
Kent Mein
42930c643c Added BOP_Mesh constructor to get rid of this:
BOP_Mesh.h:45: warning: ‘class BOP_Mesh’ only defines private constructors and h
as no friends

drawimasel.c initalized a variable so it didn't give warnings about it.
(wasn't really needed but if the code changes could be potential issue)

Kent
2006-03-29 16:47:56 +00:00
Nils Thuerey
0a63b3c0ca Several minor fixes:
- Added part of Austin's msvc8 fixes (vector::erase function
  was "misused"), hopefully compiles better now.
- Ctrl-b now also bakes a selected fluidsim domain
  similar to the softbodies.
- Added surface smoothing option for domains: default is
  1, higher values result in a smoother surface (and probably
  slightly higher comupation times), while 0 means the surface
  is not modified at all.
- Added BLENDER_ELBEEMBOBJABORT environment variable in readBobj,
  if >0 quits blender when a not yet existing fluidsim
  frame should be loaded. Useful for rendering simulations
  as far as possible from the command line.
- Surface normals pointer is now set to NULL in readfile.c
- Fixed win32 error string handling, now uses a function
  to return the string from the solver.
- Fixed fluidsim particle halo scaling problem.
- Solver update
2006-03-29 07:35:54 +00:00
Kent Mein
337928c97b I fixed some warnings about multiply defined yy_parse (etc) fuctions.
Did some small indentation fixes, and moved some variables so they
were declared at the top of the function blocks.

Kent
2006-03-28 20:56:58 +00:00
Kent Mein
391ae8f7ac Updated mallocn.c MEM_check_memory_integrity was casting
a string as an int and it was causing a warning.
I changed it to check to see if the string == 0
return 0 else return 1.

The only thing that called this function was memtest.c and it
had outdated code, so I fixed that...
        was calling MEM_set_error_stream updated to
                    MEM_set_error_callback

Kent
2006-03-23 17:45:40 +00:00
Ton Roosendaal
c8d295080c mmap allocs now fall back on regular malloc when mmap fails. 2006-03-15 15:06:53 +00:00
Jean-Luc Peurière
868874bd10 security patch #3910 provided by Joerg Sonnenberger on Os X
file opening
2006-03-13 18:27:51 +00:00
Nathan Letwory
36a4af22c3 ==SCons==
* These changes bring cross-compiling Blender for Windows on Linux one step
  closer to reality. The 'biggest' change is in makesdna SConscript to make
  sure a linux native makesdna is built, that can be run, too. Next to that
  proper checks for env['OURPLATFORM']=='linuxcross' are added in various
  places.

  Switch change in pluginapi.c was necessary, and AFAIK it should work like
  that also on WIN32, if not, slap me.

  Note: everything *compiles* now nicely, it is just that the final *linking*
  doesn't work (yet). Anyone who fixes this will be the
  hero of cross-compilers :)
2006-03-13 11:42:49 +00:00
Chris Want
46daa8d742 It looks like Irix works alright with the /dev/zero trick for mmap().
I had to include fcntl.h for Irix to get symbol O_RDWR.
2006-03-05 14:58:56 +00:00
Ton Roosendaal
2286118acc To prevent confusement; used %u (unsigned int) for printing memory error. 2006-03-04 22:22:38 +00:00
Brecht Van Lommel
2f5df4631d Fixes for some gcc 4 warnings in intern/. More than 100 lines of warnings
for 2 unused parameters in templated c++ code, that's just ridiculous.
2006-03-04 16:23:15 +00:00
Ton Roosendaal
61824579b0 Improved error print in case malloc returns NULL; it now adds the current
total allocated.
2006-03-02 19:49:51 +00:00
Jens Ole Wund
a040e208ee mscv6 projects again
no GE right now ( need to adapt to erwins file reshuffle
so may be i wait a bit until he has his mind made up )
elbeem is running when you remove the extra std:: at some places
well the msvc6 preprocessor is not very smart
--> std:: is not a member of std:: :)
so i guess there is a "using namespace std" somewhere
2006-02-28 08:31:33 +00:00
Kent Mein
4764cbe71b commented out a debugging message... was getting errors about cast to int
losses percision on 64bit linux with gcc4.X

Kent
2006-02-27 20:05:05 +00:00
Nils Thuerey
e48af6f10b - elbeem.h header file was missing 2006-02-27 11:56:04 +00:00
Nils Thuerey
0b7b0162eb - typo in SConscript 2006-02-27 11:48:25 +00:00
Nils Thuerey
9a36e9b651 Sorry for the big commit, but I've been fixing many of these
issues in parallel... So this commit contains: an update of
the solver (e.g. moving objects), integration of blender IPOs,
improved rendering (motion blur, smoothed normals) and a first particle
test. In more detail:

Solver update:
- Moving objects using a relatively simple model, and not yet fully optimized - ok
  for box falling into water, water in a moving glass might cause trouble. Simulation
  times are influenced by overall no. of triangles of the mesh, scaling meshes up a lot
  might also cause slowdowns.
- Additional obstacle settings: noslip (as before), free slip (move along wall freely)
  and part slip (mix of both).
- Obstacle settings also added for domain boundaries now, the six walls of the domain are
  obstacles after all as well
- Got rid of templates, should make compiling for e.g. macs more convenient,
  for linux there's not much difference. Finally got rid of parser (and some other code
  parts), the simulation now uses the internal API to transfer data.
- Some unnecessary file were removed, the GUI now needs 3 settings buttons...
  This should still be changed (maybe by adding a new panel for domain objects).

IPOs:
- Animated params: viscosity, time and gravity for domains. In contrast
  to normal time IPO for Blender objects, the fluidsim one scales the time
  step size - so a constant 1 has no effect, values towards 0 slow it down,
  larger ones speed the simulation up (-> longer time steps, more compuations).
  The viscosity IPO is also only a factor for the selected viscosity (again, 1=no effect).
- For objects that are enabled for fluidsim, a new IPO type shows up. Inflow
  objects can use the velocity channels to animate the inflow. Obstacles, in/outflow
  objects can be switched on (Active IPO>0) and off (<0) during the simulation.
- Movement, rotation and scaling of those 3 types is exported from the normal
  Blender channels (Loc,dLoc,etc.).

Particles:
- This is still experimental, so it might be deactivated for a
  release... It should at some point be used to model smaller splashes,
  depending on the the realworld size and the particle generation
  settings particles are generated during simulation (stored in _particles_X.gz
  files).
- These are loaded by enabling the particle field for an arbitrary object,
  which should be given a halo material. For each frame, similar to the mesh
  loading, the particle system them loads the simulated particle positions.
- For rendering, I "abused" the part->rt field - I couldnt find any use
  for it in the code and it seems to work fine. The fluidsim particles
  store their size there.

Rendering:
- The fluidims particles use scaled sizes and alpha values to give a more varied
  appearance. In convertblender.c fluidsim particle systems use the p->rt field
  to scale up the size and down the alpha of "smaller particles". Setting the
  influence fields in the fluidims settings to 0 gives equally sized particles
  with same alpha everywhere. Higher values cause larger differences.
- Smoothed normals: for unmodified fluid meshes (e.g. no subdivision) the normals
  computed by the solver are used. This is basically done by switching off the
  normal recalculation in convertblender.c (the function calc_fluidsimnormals
  handles other mesh inits instead of calc_vertexnormals).
  This could also be used to e.g. modify mesh normals in a modifier...
- Another change is that fluidsim meshes load the velocities computed
  during the simulation for image based motion blur. This is inited in
  load_fluidsimspeedvectors for the vector pass (they're loaded during the
  normal load in DerivedMesh readBobjgz). Generation and loading can be switched
  off in the settings. Vector pass currently loads the fluidism meshes 3 times,
  so this should still be optimized.

Examples:
- smoothed normals versus normals from subdividing once:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_1smoothnorms.png
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_2subdivnorms.png
- fluidsim particles, size/alpha influence 0:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_3particlesnorm.png
  size influence 1:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_4particlessize.png
  size & alpha influence 1:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/v060227_5particlesalpha.png
- the standard drop with motion blur and particles:
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t2new.mpg
  (here's how it looks without
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t1old.mpg)
- another inflow animation (moving, switched on/off) with a moving obstacle
  (and strong mblur :)
  http://www10.informatik.uni-erlangen.de/~sinithue/temp/elbeemupdate_t3ipos.mpg

Things still to fix:
- rotating & scaling domains causes wrong speed vectors
- get rid of SDL code for threading, use pthreads as well?
- update wiki documentation
- cool effects for rendering would be photon maps for caustics,
  and motion blur for particles :)
2006-02-27 11:45:42 +00:00
Chris Want
5e3163041a I had to disable mmap altogether for Irix. 2006-02-24 14:37:24 +00:00
Ton Roosendaal
3bd57e6a64 Paranoia "volatile" assignment to globals in MEM module. Was suggested to
do this for globals that can be changed within threads.
2006-02-24 10:18:48 +00:00
Chris Want
a30dc3866c Some issues compiling on Irix:
+ the code in writemovie.c no longer compiles (since the renderer
refactor). I have #if 0-ed it.

+ OpenGL on Irix doesn't have GL_ARB_vertex_program

+ mmap on Irix doesn't like MAP_ANON.

+ If using the MipsPro 7.3 compiler, the variable MIPS73_ISOHEADERS
can be set to point to the directory with those weird C++ headers
that don't have .h in the name
2006-02-22 23:34:12 +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
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
Jens Ole Wund
c425ad9507 make msvc6 compile (thanks peter)
so beat me if it does not work ;)
2006-02-09 22:09:11 +00:00
Jens Ole Wund
daefa2afc6 ...umm msvc6 projects again 2006-02-09 19:31:50 +00:00
Jens Ole Wund
1d787c9e93 msvc6 projects that will compile when MEM_Allocator.h is fixed 2006-02-09 14:17:26 +00:00
Nathan Letwory
ef1b7a5735 ==SCons==
+ 'scons blenderplayer' builds blender AND blenderplayer now (tested on Linux
  only, but was only linking issue, so should work on other platforms too).

  NOTE: I noticed some compileflags for GE specific libs that were left out -
  I re-enabled them in the SConscripts, but I'm going to do a test build my-
  self now, so if there are problems with them on win32, I probably already
  know about them :)
2006-02-07 21:24:36 +00:00
Nathan Letwory
b11c92c66e ==SCons==
* use proper seperator instead of *nix-only /
2006-02-07 21:12:01 +00:00
Nathan Letwory
27110ec0f4 ==SCons==
- remove blenderdummy.cpp from list, so that elbeem actually works
2006-02-07 21:04:22 +00:00
Peter Schlaile
241352104f mem_in_use can be victim to C++ name mangling on some platforms... 2006-02-05 23:46:55 +00:00