1
1
Commit Graph

15281 Commits

Author SHA1 Message Date
7da0d1a71e * Fixed a crazy memory leak in voxel data image sequence data source 2009-07-03 11:03:09 +00:00
d5e9eb7d76 * fix for small bug in volume texture stack 2009-06-21 22:17:06 +00:00
3b2ec94977 Voxel data & volume light cache
* Added support for additional file types in the voxel data texture. I added 
support for 8 bit raw files, but most notably for image sequences.

Image sequences generate the voxel grid by stacking layers of image slices on top 
of each other to generate the voxels in the Z axis - the number of slices in the 
sequence is the resolution of the voxel grid's Z axis. 

i.e. http://mke3.net/blender/devel/rendering/volumetrics/skull_layers.jpg

The image sequence option is particularly useful for loading medical data into 
Blender. 3d medical data such as MRIs or CT scans are often stored as DICOM 
format image sequences. It's not in Blender's scope to support the DICOM format, 
but there are plenty of utilities such as ImageMagick, Photoshop or OsiriX that 
can easily convert DICOM files to formats that Blender supports, such as PNG or JPEG.

Here are some example renderings using these file formats to load medical data:
http://vimeo.com/5242961
http://vimeo.com/5242989
http://vimeo.com/5243228

Currently the 8 bit raw and image sequence formats only support the 'still' 
rendering feature.

* Changed the default texture placement to be centred around 0.5,0.5,0.5, rather 
than within the 0.0,1.0 cube. This is more consistent with image textures, and it 
also means you can easily add a voxel data texture to a default cube without 
having to mess around with mapping.

* Added some more extrapolation modes such as Repeat and Extend rather than just clipping

http://mke3.net/blender/devel/rendering/volumetrics/bradybunch.jpg

* Changed the voxel data storage to use MEM_Mapalloc (memory mapped disk cache) 
rather than storing in ram, to help cut down memory usage.

* Refactored and cleaned up the code a lot. Now the access and interpolation code 
is separated into a separate voxel library inside blenlib. This is now properly 
shared between voxel data texture and light cache (previously there was some 
duplicated code).

* Made volume light cache support non-cubic voxel grids. Now the resolution 
specified in the material properties is used for the longest edge of the volume 
object's bounding box, and the shorter edges are proportional (similar to how 
resolution is calculated for fluid sim domains).

This is *much* more memory efficient for squashed volume regions like clouds 
layer bounding boxes, allowing you to raise the resolution considerably while 
still keeping memory usage acceptable.
2009-06-20 06:41:50 +00:00
44cebb39b8 * raised some limits in point density 2009-06-10 07:45:12 +00:00
ffbd75e571 * Fix for simple bug in voxel data texture 2009-05-16 13:17:21 +00:00
e1122a1b67 5th: another compile fix 2009-04-21 10:19:14 +00:00
fc7a561de1 4th: another file corrupted 2009-04-21 09:31:07 +00:00
cf9886b0d0 2nd try to merge sim_physics with trunk rev 19825
Please check if volumetrics are yet working
2009-04-21 08:49:06 +00:00
2d0d06f642 BGE VideoTexture: fix bug with VideoTexture.materialID() since recent commit. 2009-04-20 21:20:33 +00:00
6afaab654d Bugfix for [#18554] Time + Scale Node Crash 2009-04-20 18:31:48 +00:00
449e9a454d Bugfix 18558
In OSX, using spin/extrude etc. buttons, with more than 1 3d window open,
should turn cursor in a Question Mark to indicate you have to tell which
window to use (yes weak, but that's 2.4x!). OSX didn't support that type
of cursor, so no hint happened. Now uses the 'hand' icon for osx... no
nicer one is there afaik.
2009-04-20 18:23:46 +00:00
d76a6f5231 Booleans: Fix for "no faces" error, reported by alxarch, thanks! 2009-04-20 13:18:54 +00:00
dee32d0b3f BGE Python API
- initialize pythons sys.argv in the blenderplayer
- ignore all arguments after a single " - " in the blenderplayer (like in blender), so args can be passed to the game.
- add a utility function PyOrientationTo() - to take a Py euler, quat or 3x3 matrix and convert into a C++ MT_Matrix3x3.
- add utility function ConvertPythonToMesh to get a RAS_MeshObject from a KX_MeshProxy or a name.
- Added error prefix arguments to ConvertPythonToGameObject, ConvertPythonToMesh and PyOrientationTo so the error messages can include what function they came from.
- deprecated brick.getOwner() for the "owner" attribute.
2009-04-20 09:13:59 +00:00
8a0a557294 Hopefully a working merge with trunk (could be one error left in raytrace.c - will check afterwards)
Merging 18706 - 19804
2009-04-20 00:19:16 +00:00
9078ce5da2 Scons epydos changed options
- no source code since this is only useful if the epydocs contain code, ours are only docstrings.
- set inheritance to included so you dont have to search up the classes to find available functions.
- SConstruct, isolate the exception for importing epydoc.
- Added a print to the SConscript files otherwise it looks like nothings happening.
2009-04-19 22:02:48 +00:00
Nathan Letwory
fcdbbee208 SCons / epydoc support
* properly detect if epydoc is installed.
  patch by Brandano
2009-04-19 21:26:29 +00:00
f5fc4ebdd8 BGE Python API
- More verbose error messages.
- BL_Shader wasnt setting error messages on some errors
- FilterNormal depth attribute was checking for float which is bad because scripts often expect ints assigned to float attributes.
- Added a check to PyVecTo for a tuple rather then always using a generic python sequence. On my system this is over 2x faster with an optmized build.
2009-04-19 21:01:12 +00:00
d78eec9319 2009-04-19 20:09:05 +00:00
084efe0703 added a python26.zip file, and also made scons pick which zip to use based on the python version 2009-04-19 19:36:04 +00:00
7144838606 Compile fixed for Win64.
Please check if that also compiles on win32.
2009-04-19 19:31:32 +00:00
b36514a3be Booleans:
- Enable e.g. subsurf before boolean modifier
- Fix editmode crash
2009-04-19 18:18:52 +00:00
904483c96c Booleans: Should work with modifier stack now. Please report (new) problems. Thanks 2009-04-19 17:47:09 +00:00
6bc162e679 BGE Python API
removed redundant (PyObject *self) argument from python functions that are not exposed to python directly.
2009-04-19 17:29:07 +00:00
fe08da3b4c BGE: fix Pyfrom_id to work on w64. 2009-04-19 17:26:03 +00:00
7f15445629 Fix for libopenjpeg to enable win64 compile (is in their tracker and will most likely be included in next release) 2009-04-19 16:35:20 +00:00
7dbc9dc719 BGE Python API cleanup - no functionality changes
- comments to PyObjectPlus.h
- remove unused/commented junk.
- renamed PyDestructor to py_base_dealloc for consistency
- all the PyTypeObject's were still using the sizeof() their class, can use sizeof(PyObjectPlus_Proxy) now which is smaller too.
2009-04-19 14:57:52 +00:00
8d2cb5bea4 BGE Python API
This changes how the BGE classes and Python work together, which hasnt changed since blender went opensource.
The main difference is PyObjectPlus - the base class for most game engine classes, no longer inherit from PyObject, and cannot be cast to a PyObject.

This has the advantage that the BGE does not have to keep 2 reference counts valid for C++ and Python.

Previously C++ classes would never be freed while python held a reference, however this reference could be problematic eg: a GameObject that isnt in a scene anymore should not be used by python, doing so could even crash blender in some cases.

Instead PyObjectPlus has a member "PyObject *m_proxy" which is lazily initialized when python needs it. m_proxy reference counts are managed by python, though it should never be freed while the C++ class exists since it holds a reference to avoid making and freeing it all the time.
When the C++ class is free'd it sets the m_proxy reference to NULL, If python accesses this variable it will raise a RuntimeError, (check the isValid attribute to see if its valid without raising an error).
- This replaces the m_zombie bool and IsZombie() tests added recently.

In python return values that used to be..
 return value->AddRef();
Are now
 return value->GetProxy();
or...
 return value->NewProxy(true); // true means python owns this C++ value which will be deleted when the PyObject is freed
2009-04-19 12:46:39 +00:00
92cea7c1b1 KX_MeshProxy "numPolygons" and "numMaterials" attributes were using the "materials" attribute function, error made recently when converting attributes. 2009-04-19 06:48:27 +00:00
d2ec468cd3 Hidden faces were not rendering displayed in the game engine, only the invisible face flag should be used for this.
Hiding faces is a editing option like selection and should not change rendering, it wasn't even working right because meshes without UVs ignored it.
I thought this was needed for compatibility with old files but just noticed this messes up 2 of the files in demos-2.42.zip
2009-04-19 06:29:15 +00:00
Nathan Letwory
e4611218ab BPy
* access to sample buffers count of Lamp
2009-04-19 00:09:47 +00:00
Nathan Letwory
faef9f0ac7 SCons
* some misc changes, mainly cleaning and style unification that were lying around
2009-04-18 17:16:08 +00:00
53fd3847bc BGE: restore a feature that was lost in 2.48: sharing of display lists between duplicated objects. 2009-04-18 09:14:51 +00:00
df8cf26404 Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members.
Other small changes...
- KX_Camera and KX_Light didnt have get/setitem access in their PyType definition.
- CList.from_id() error checking for a long was checking for -1 against an unsigned value (own fault)
- CValue::SpecialRelease was incrementing an int for no reason.
- renamed m_attrlist to m_attr_dict since its a PyDict type.
- removed custom getattro/setattro functions for KX_Scene and KX_GameObject, use py_base_getattro, py_base_setattro for all subclasses of PyObjectPlus.
- lowercase windows.h in VideoBase.cpp for cross compiling.
2009-04-17 20:06:06 +00:00
90c6cf77f1 Fixing SND_Scene.h missing include problems with cmake + bullet 2009-04-17 13:42:40 +00:00
80e40d504c bugfix #18287
Texture nodes hang when nodes have a cyclic case.

Added a (temp?) provision to tag node->need_exec zero for cyclic
nodes, and added check for this in texture nodes. 
There was also a bug in 'tag changed' for texture nodes, which not
only tagged, but also called the tree exec (should not happen!).

In general the texture exec needs recode; it doesn't use the stacks
as provided per node, but recurses itself to previous nodes, giving
problems like this. Node execs should only do their own bizz, the
node system handles dependency and eval order nicely already.
2009-04-17 10:38:10 +00:00
6761cc00d4 let command line args override the 'blenderlite' target 2009-04-17 10:34:09 +00:00
1dd980768d Missing <stdlib.h> for abs() made this file not compile for me. 2009-04-17 10:24:44 +00:00
aed9f92734 packing from the UV window with margin had a problem with feedback, so running again and again would give different results.
Scale the margin by the combined area of all boxes to give predictable results.
2009-04-17 06:21:49 +00:00
0cda4903b1 [#18533] Little fix in Particle API doc
from Alberto Santos (dnakhain)
2009-04-17 02:33:14 +00:00
2c491b5d2e BGE: slow parent was causing scaling distortion, now use correct quaternion interpolation. 2009-04-16 20:13:13 +00:00
32253dfaaf bpy_internal_import.c should build with py2.3 now, also gave bpy_internal_import functions better names. 2009-04-16 06:24:47 +00:00
bbdaa03d65 BGE bug #18168: Get local orientation of object using game engine python script system. Added localOrientation and worldOrientation. orientation attribute deprecated. Same for position and scaling. World attributes are read-only except for worldPosition. Add systematic check on NULL SGNode in all python functions. This is necessary to handle zombie objects (deleted by the game but kept alive by a reference in a list). 2009-04-15 21:17:08 +00:00
0c1bfa4a37 Merging Shrinkwrap Constraint!
+bvhtree cache (if the derived model doenst gets destroyed then the same BVHtree can be used)
	this was needed to allow shrinkwrap constraint to be usable.

It has been ready for a long time.. but only got merged now, for 2.49.
2009-04-15 19:33:25 +00:00
52a3d5c518 BGE Python API
Free python modules defined within the blendfile between loading scenes since they would end up accessing old GameLogic, Rasterizer modules as well as old game engine data in the module namespace which can cause problems.
2009-04-15 19:20:12 +00:00
b7e40b955f Optional margin for packing UV islands and the 'Pack Islands' menu item. Useful for baking with bleed enabled. 2009-04-15 18:20:19 +00:00
f46f93ea13 This is patch [#18408] Build issues with make on Cygwin hosted MinGW (2.48.1)
submitted by Wayne Dennis

adds an include, changes pythonlib and does a little cleaning of dlltool stuff.

Kent
2009-04-15 16:23:13 +00:00
3616eb9031 Fixing more errors coverity found.
Imagepaint make sure ibuf exists before we use it.  This is CID# 545
editmesh_tools.c make sure were not indexing array with -1 This is CID# 137
	(also removed some trailing whitespace I found)

anim5.c	totlen could be -1 so check its > -1  This is CID# 134

Kent
2009-04-15 16:16:00 +00:00
514c78ba39 BGE MouseFocusSensor
- fix for multiple viewpors broke single viewport (both work now)
- python could get uninitialized values from m_prevTargetPoint and m_prevSourcePoint
- getting the RayDirection for python could crash blender trying to normalize a zero length vector.
- added python attributes
- removed unused canvas from the MouseFocusSensor class
2009-04-15 13:50:56 +00:00
e8f4d93221 Disable using KX_GameObjects in python that have been removed from the scene (zombie objects) by raising a RuntimeError when accessing methods, attributes or passing to a function.
Common cases of this are when python references an object from the AddObject actuator that has ended, or a scene has been loaded and the old objects freed.

This means some scripts will raise errors now in certain cases but better give the error early rather then failing silently with strange hard to track down behavior & crashes.

Added "isValid" attribute for checking objects are in a scene.

At the moment it uses the SceneGraph Node to check of the objects valid but it might be better to do this in a more generic way so scenes, meshes etc also have this check.
2009-04-15 10:57:28 +00:00
19c869ab64 BGE Py Api
importing modules wasnt returning the error from the blender text if it failed.
2009-04-15 08:08:42 +00:00