Commit Graph

15401 Commits

Author SHA1 Message Date
Martin Poirier
f790744faf Fix crash when missing int argument for -s -e and -j. 2009-05-12 23:41:46 +00:00
Campbell Barton
a70440d918 [#18735] Particle vertex group API for Python
from Alberto Santos (dnakhain)

Changed "None" to "" for returning an unset vertex group.
"" is a valid name for a vertex group this is asking for trouble.
2009-05-12 21:41:04 +00:00
Campbell Barton
3c0f6b65fb [#18711] Particle render API for Python
from Alberto Santos (dnakhain)
2009-05-12 21:27:01 +00:00
Campbell Barton
7d923df2bf [#18728] Particle (newtonian) physics API for Python
patch from Alberto Santos (dnakhain)
2009-05-12 21:13:29 +00:00
Benoit Bolsee
5a0de728b0 BGE performance: allow to create display list on meshes with modifiers but without armature and shape keys. These modified meshes are static and can be put safely in a display list. As the rendering of modifiers is done in direct openGL call, it results is a bit performance boost. 2009-05-12 19:48:18 +00:00
Campbell Barton
705764fe05 Fix face occlusion for projection paint, (was broken for all RC's but nobody noticed)
Its still not working right in perspective mode.
For bleed use a faster method then Barycentric weights function since the point is always on the edge.

last commit with memset in readfile.c missed one var.
2009-05-12 16:20:23 +00:00
Campbell Barton
b6fa9afccb [#13726] Segfault with (Re)Appending objects
fix this by freeing the lib-file-data after linking or appending, re-appending will be slower now
(as slow as appending for the first time).

Not strictly needed, set the memory for bhead's to zero in readfile.c since comparisons are done later on with this data making valgrind complain.

Added some missing headers too.
2009-05-12 15:28:07 +00:00
Benoit Bolsee
732c3ee66f BGE bug #18596: No ipo dynamics is 2.49rc1. 2009-05-11 23:05:13 +00:00
Ken Hughes
75b7bcab77 Python API
----------
Patch by Jean-michel Soler (jms) to support ShrinkWrap and SimpleDeform 
modifiers.
2009-05-11 22:27:06 +00:00
Campbell Barton
b75268d412 problem with unloading modules, py modules would be refreshed but external modules that were pyc or pyo's would be kept.
This made it not refresh the module when taking an external BGE Module and making it internal because the external pyc would never be freed so the internal text wouldn't get used until restarting blender.
2009-05-11 22:17:58 +00:00
Benoit Bolsee
24906dc962 BGE #18724: Modifier cause crash in 2.49RC2. My bad, I was too quick to fix the soft body problem in revision 20119. This time I tested against modifiers, soft body, armatures and replace mesh. 2009-05-11 22:07:30 +00:00
Campbell Barton
e847bcf784 BGE Doc updates thanks to Roelf de Kock
--- Notes from Roelf, maybe some other BGE devs could help resolve these
Here is what I have so far. I've left "TODO's" were there needs to be some more comments.

The following things also need to be resolved:

-KX_VehicleWrapper.getWheelOrientationQuaternion looks like it should return a quaternion but if I look at the code it looks like it returns a rotation matrix.

-I still need to find out what exactly KX_VehicleWrapper.getWheelRotation is. I've got the return type but I would like to add some explanation for what it actualy means (and units if any).

-BL_Shader.setNumberOfPasses ignores the parameter but from the comment in the code it looks like the parameter that is being set (it is harcoded to be =1) in setNumberOfPasses is not used. So I'm not sure if this method should be documented at all.
2009-05-11 21:35:38 +00:00
Janne Karhu
0aeaf08242 Ugh, yet another try to fix [#18697] 2.49RC1: Keyed Particles fine in viewport but give me a crash during render.
Hopefully it's now fixed for good.
2009-05-11 19:19:36 +00:00
Ken Hughes
c24a81a293 Remove incorrect "w" attribute from Eulers, gave warning in epydocs. 2009-05-11 16:57:54 +00:00
Diego Borghetti
0c6ec76a4c Fix Makefiles for gameengine. 2009-05-11 15:34:46 +00:00
Benoit Bolsee
ee1c29028d BGE: Add MT_Vector3 support for Py attribute macro system. See KX_PYATTRIBUTE_VECTOR_... 2009-05-11 12:41:48 +00:00
Campbell Barton
7002faac31 Another Noise Tool svn commit is complaining about mixed line endings so after 16 attempts I wont include the full message 2009-05-11 12:38:24 +00:00
Brecht Van Lommel
99849b659d Fix for bug #18683: GLSL refresh issue when adding lamp. There's still
cases where this goes wrong, as noted in the release logs, this is just
a temporary fix, in 2.5 can solve it properly with notifiers.
2009-05-11 12:06:53 +00:00
Campbell Barton
0a17250dca going out on a limb and removing this without asking anyone.
nobody seriously uses this format for graphics these days, and if they did, the export from blender is unlikely be to be useful, its just different views of the mesh edges projected into a 2D xfig file (quantized to int's too).
2009-05-11 05:47:14 +00:00
Campbell Barton
a220ae2f60 2D Cutout Image Importer
from Kevin Morgan (forTe)

imports images as quads in the 3D view

made some changes
- images that fail to import give an error popup rather then a script error
- extension input is only shown for batch directory importing
- extension comparison is now case insensitive
- importing images from "/" failed, (bug in Blender.sys.dirname), use os.path.dirname since os is needed for batch import in other places.
- disable Esc for quitting because escaping from the file selector would quit the script too.
2009-05-11 05:35:32 +00:00
Campbell Barton
dcee43b449 bolt wizard from Aaron Keith (Spudmn), edits from Brendon and myself.
Minor changes are...
- default size is smaller then it was but still too big IMHO, presets are huge.
- deselect all objects and make the new bolt active
- place the new bolt at the 3D cursor location
2009-05-11 05:10:09 +00:00
Campbell Barton
1a8bbba7bd new script to copy the active object to all other selected objects transformation.
When turning many assets into DupliGroups there was no way to do this other then manually copying the loc/size/rot for each object manually.
2009-05-11 00:56:48 +00:00
Campbell Barton
da3bdefb7a update script templates for new BGE api attributes 2009-05-11 00:19:55 +00:00
Campbell Barton
9cc61dd9c8 use the same sequence mapping types as CListValue, hopefully this means it will build on different python versions 2009-05-10 22:33:21 +00:00
Benoit Bolsee
a417334026 Linux compilation problem 2009-05-10 22:06:11 +00:00
Benoit Bolsee
89c2d80d32 Linux compilation problem, better fix 2009-05-10 21:30:30 +00:00
Campbell Barton
a6721e549d changes to get benoits logic updates building on scons with gcc 2009-05-10 21:22:25 +00:00
Benoit Bolsee
386122ada6 BGE performance, 4th round: logic
This commit extends the technique of dynamic linked list to the logic
system to eliminate as much as possible temporaries, map lookup or 
full scan. The logic engine is now free of memory allocation, which is
an important stability factor. 

The overhead of the logic system is reduced by a factor between 3 and 6
depending on the logic setup. This is the speed-up you can expect on 
a logic setup using simple bricks. Heavy bricks like python controllers
and ray sensors will still take about the same time to execute so the
speed up will be less important.

The core of the logic engine has been much reworked but the functionality
is still the same except for one thing: the priority system on the 
execution of controllers. The exact same remark applies to actuators but
I'll explain for controllers only:

Previously, it was possible, with the "executePriority" attribute to set
a controller to run before any other controllers in the game. Other than
that, the sequential execution of controllers, as defined in Blender was
guaranteed by default.

With the new system, the sequential execution of controllers is still 
guaranteed but only within the controllers of one object. the user can
no longer set a controller to run before any other controllers in the
game. The "executePriority" attribute controls the execution of controllers
within one object. The priority is a small number starting from 0 for the
first controller and incrementing for each controller.

If this missing feature is a must, a special method can be implemented
to set a controller to run before all other controllers.

Other improvements:
- Systematic use of reference in parameter passing to avoid unnecessary data copy
- Use pre increment in iterator instead of post increment to avoid temporary allocation
- Use const char* instead of STR_String whenever possible to avoid temporary allocation
- Fix reference counting bugs (memory leak)
- Fix a crash in certain cases of state switching and object deletion
- Minor speed up in property sensor
- Removal of objects during the game is a lot faster
2009-05-10 20:53:58 +00:00
Campbell Barton
6f5ef6044d remove unneeded vars and wasn't returning on some errors 2009-05-10 15:23:18 +00:00
Campbell Barton
136d4c34ba deprecate controller.getActuator(name) and controller.getSensor(name) for
controller.actuators[name] and controller.sensors[name]

Made a read-only sequence type for logic brick sensors and actuators which can access single items or be used like a list or dictionary.
We could use a python dictionary or CValueList but that would be slower to create.

So you can do...
 for s in controller.sensors: print s

 print controller.sensors["Sensor"]

 print controller.sensors[0]

 sensors = list(controller.sensors)

This sequence type keeps a reference to the proxy it came from and will raise an error on access if the proxy has been removed.
2009-05-10 01:48:14 +00:00
Dalai Felinto
f155da0039 BGE Dome: Reducing FBO size to warped meshes.
Commit 20099 started using a FBO way too big.
According to Paul Bourke this is how it's done in other Engines:

Projectors HD:
1920x1050 - buffersize = 1024; FBO size = 2048
1400x1050 - buffersize = 1024; FBO size = 2048

Projectors XGA:
1024x768 - buffersize = 512; FBO size = 1024

Now in Blender Game Engine we are using:

Projectors HD:
1920x1050 - buffersize = 1050; FBO size = 2048
1400x1050 - buffersize = 1050; FBO size = 2048

Projectors XGA:
1024x768 - buffersize = 768; FBO size = 1024

(I guess I should be committing code to the ge_dome branch instead of the trunk. I feel bad doing all those adjustments in a hurry to 2.49 final release in the trunk. That is ok, right?)
2009-05-09 21:54:22 +00:00
Dalai Felinto
4a2341fe9a BGE Dome: Allowing FOV different from 180º for Truncated Domes
*) a small note:

In the end it turned out that we have upright and downright domes out there.
So I may rearrange the order of the gui later:
(1 = fisheye, 2 = truncated up, 3 = truncated down, 4 = envmap, 5 = spherical panoramic)

I don't plan to do a doVersion() for that, so if you are using it already keep in mind that the modes may change before 249 final release.
2009-05-09 21:04:03 +00:00
Campbell Barton
df01af5a1f Methods didn't check for zombies which could crash in the case where a method for an object is kept.
func = ob.getMass
 ...remove ob...
 func() # crash

2 More refcount fixes spotted by Benoit too
2009-05-09 18:18:04 +00:00
Campbell Barton
355b585447 More refcount errors spotted by Benoit, one with python getting a list item so scene.objects["OBfoo"] would always mess up refcounts. 2009-05-09 17:24:21 +00:00
Benoit Bolsee
cfc21667b9 BGE: repair soft body - include this in RC2 please 2009-05-09 16:59:25 +00:00
Campbell Barton
5d6b249c9b refcounting bugfix, gameOb.getParent() and gameOb.parent both added a reference when they should not have. 2009-05-09 16:29:00 +00:00
Diego Borghetti
cf8a37a3bb Fix Copy & Paste not working inside Blender.
My last patch remove the code that check if Blender is the owner
of the selection, that is why stop working.
2009-05-08 19:37:14 +00:00
Dalai Felinto
1d11df1708 BGE Dome: Truncated Dome are back (Upright and Downright) + GLEW_EXT_framebuffer_object check before generating FBO
After last commit (20099) warping meshes got slower (more quality == less performance). Since we don't need an extra warping for truncated domes, It's better to handle them directly in openGL without the need of warping it.

I'll talk with some Dome owners to see if we need both Upright and Downright modes. I may remove one of them by 2.49 them.

*) also: a proper GLEW_EXT_framebuffer_object check before generating FBO (for warping meshes).

**) next in line (maybe after RC2): tilt option to tilt the camera up to 90º upward.
2009-05-08 18:59:08 +00:00
Janne Karhu
57beadf406 Second fix for [#18697] 2.49RC1: Keyed Particles fine in viewport but give me a crash during render 2009-05-07 22:31:19 +00:00
Campbell Barton
cdba1ddd5d BGE Python owned proxies had a problem being decref'd twice, this would crash on freeing KX_Vertex/Poly Proxy types when python was compiled with debug options enabled.
add_mesh_torus.py wasnt tested from update, will go through all edited scripts and test :\
2009-05-07 22:06:27 +00:00
Dalai Felinto
e1c958c364 BGE Dome: Implementation of FBO to handle warp mesh rendering.
We are using an image twice as big to render the fisheye before warping.
It'll slow down warping meshes a little, but we get way more resolution.

Therefore I will bring Truncated Dome mode back in order to avoid using warping mesh for that.
2009-05-07 20:00:09 +00:00
Benoit Bolsee
1f5ccd1928 BGE: unfortunately VA+list still doesn't work on ATI card, so put a specific check for ATI. 2009-05-07 19:36:12 +00:00
Campbell Barton
f590ffdadc [#18645] Texture painting smudge brush darkens images - 2.49RC1
not fixed but the problem is now less bad when projection painting, bilinear interpolation was rounding down.
- added gameOb.attrDict to get the internal gameObject dict.
- mesh.getVertex wasnt setting an exception.
2009-05-07 14:53:40 +00:00
Benoit Bolsee
42557f90bd BGE performance, 3rd round: culling and rasterizer.
This commit extend the technique of dynamic linked list to the mesh
slots so as to eliminate dumb scan or map lookup. It provides massive 
performance improvement in the culling and in the rasterizer when 
the majority of objects are static.

Other improvements:
- Compute the opengl matrix only for objects that are visible.
- Simplify hash function for GEN_HasedPtr
- Scan light list instead of general object list to render shadows
- Remove redundant opengl calls to set specularity, shinyness and diffuse
  between each mesh slots.
- Cache GPU material to avoid frequent call to GPU_material_from_blender
- Only set once the fixed elements of mesh slot
- Use more inline function

The following table shows the performance increase between 2.48, 1st round
and this round of improvement. The test was done with a scene containing 
40000 objects, of which 1000 are in the view frustrum approximately. The
object are simple textured cube to make sure the GPU is not the bottleneck.
As some of the rasterizer processing time has moved under culling, I present
the sum of scenegraph(includes culling)+rasterizer time

Scenegraph+rasterizer(ms)       2.48      1st round       3rd round

All objects static,            323.0           86.0             7.2
all visible, 1000 in 
the view frustrum

All objects static,            219.0           49.7             N/A(*)
all invisible.

All objects moving,            323.0          105.6            34.7
all visible, 1000 in 
the view frustrum

Scene destruction              40min          40min              4s

(*) : this time is not representative because the frame rate was at 60fps.
      In that case, the GPU holds down the GE by frame sync. By design, the
      overhead of the rasterizer is 0 when the the objects are invisible. 

This table shows a global speed up between 9x and 45x compared to 2.48a
for scenegraph, culling and rasterizer overhead. The speed up goes much
higher when objects are invisible.

An additional 2-4x speed up is possible in the scenegraph by upgrading
the Moto library to use Eigen2 BLAS library instead of C++ classes but
the scenegraph is already so fast that it is not a priority right now.

Next speed up in logic: many things to do there...
2009-05-07 09:13:01 +00:00
Campbell Barton
779bf435ef python3 compatibility for the BGE api, this only works with scons when WITH_BF_NOBLENDER is enabled.
Mathutils, Geometry and BGL modules are currently disabled with python3
2009-05-07 05:23:15 +00:00
Campbell Barton
c46fa2745a smudge on float images crashed 2009-05-07 01:27:58 +00:00
Campbell Barton
49fda9470d python is not being very helpful!
It seems 2.5 gives the version as a string, 2.6 as ints
2009-05-06 22:16:28 +00:00
Campbell Barton
3d60c4e746 [#18702] FBX exported hemi light crashes maya
- bugfix, off by 1 when clamping lamp types, caused blender to write an invalid lamp type
- error in last commit (renamed function)
2009-05-06 21:47:24 +00:00
Campbell Barton
cf93cad415 use the python version scons is running with by default on linux, will make it easier for people with new distros that only come with python 2.6 2009-05-06 21:41:14 +00:00
Campbell Barton
94e9e954b1 [#18681] Mousesensor Over doesn't work in ortho mode of 3dview camera
bugfix, the clip near/far are scaled up for some reason, so use a range between 0 - clipfar for now.
2009-05-06 12:45:08 +00:00