Commit Graph

15417 Commits

Author SHA1 Message Date
Ton Roosendaal
34f99fa4b9 Bugfix #18743
Render: raytracing materials with transp-shadow + SSS crashed
2009-05-14 11:36:52 +00:00
Campbell Barton
a1e73e55c7 updated BGE doc checker script for classes now being in GameTypes.py 2009-05-14 10:59:38 +00:00
Ton Roosendaal
a74d2574ee Bugfix #18725
Particles using group-duplication, with Metaballs in group, enter eternal
loop in our code now. This is a non-supported case... metaball code doesn't
support recursions. Added a provision in code to catch this case, and print
an error in console to denote this.
2009-05-14 09:32:47 +00:00
Campbell Barton
d257586fe6 BGE Py API
scene.active_camera can now be set so you can more easily set the current camera from python scripts without using an actuator.
ConvertPythonToCamera utility function to get a camera from a python string or KX_Camera type.
2009-05-14 07:59:44 +00:00
Campbell Barton
d2cff7307d [#18685] dark pixels created when during texture "full baking"
fix/workaround - offset by a 500th of a pixel to avoid baking missing pixels that are between 2 faces, its still possible pixels could be between faces but much less likely then it is currently with pixel aligned UVs.
2009-05-14 02:21:50 +00:00
Campbell Barton
5f78efe19c print warnings when python attributes and methods conflict with game properties. 2009-05-14 00:10:25 +00:00
Campbell Barton
240aa6d34d * More updates to game engine type docs from Roelf de Kock
* FBX Bugfix, was exporting all animation curves as 'Constant' type (no docs for this so could only guess), Thanks to Sander Brandenburg for spotting this problem.
Also improved keyframe removal to work on animation curves an angle
2009-05-13 22:52:31 +00:00
Benoit Bolsee
c7519789b8 BGE: 1-liner patch to put the Always sensor in non pulse mode by default. I've seen enough games with Always sensors in pulse mode while they should not; this patch should prevent this common mistake. 2009-05-13 17:02:39 +00:00
Benoit Bolsee
f5bacc6c8a BGE API cleanup: motion actuator. Apply patch from Moguri. 2009-05-13 16:48:33 +00:00
Ken Hughes
77f321d15f Python API
----------
Fix problem with ShrinkWrap PROJECT_OVER_NORMAL setting.
2009-05-13 15:41:33 +00:00
Campbell Barton
df1879783a use epy deprecated field and link to attributes 2009-05-13 12:26:54 +00:00
Campbell Barton
24f326fb01 Moved game engine types into GameTypes.py because every type put into a module giving lots of references to KX_GameObject.KX_GameObject and having to write in links like L{CListValue<CListValue.CListValue>}.
Looked into ways around this but epydoc has no way to import a class without its module and the @include field is maked as 'TODO'.

Also removed the outdated 'WhatsNew' section and linked to the 2.49 release notes.
2009-05-13 10:15:19 +00:00
Benoit Bolsee
b22605c4df BGE #18691: Blenderplayer fullscreen messes up desktop on OS X Leopard. Applied patch #18705 by sbn. I cannot compile osx but the patch seems perfectly alright to me. Can OSX users confirm that it compiles well on the various OSX version? 2009-05-13 06:53:21 +00:00
Benoit Bolsee
82b4975ccf BGE #18732: Python Light options don't work with GLSL materials. Commited patch from dfelinto and moguri, thanks for the good work. 2009-05-13 06:42:15 +00:00
Campbell Barton
c19baf85cc [#18694] Added support for Wavefront OBJ groups for both the import and export scripts
from Paolo Ciccone (pciccone) 

Im not that keen on this functionality since vertex groups in blender are for weight painting and OBJ's groups are more like sub-objects, The conversion between these is a poor approximation (one vertex group per face).
But this is still useful for using blender with poser so accepting these 2 patches.

Made some changes from the patch
*Export*
- vgroup off by default, since this is mainly useful for corner cases
- findVertexGroupName() - changed how exporting selects a vertex group for a face, use the highest combind weight for each group instead of  the number of checking how many times the verts are in a group because they could have a zero weight.
- findVertexGroupName() - would fail if a faces verts were not in any groups, now return a (null) group
- Allow modifiers to export with vgroups

*Import*
- disable by default
- ignore (null) groups
- fixed a problem where the patch broke SPLIT_GROUPS
- move the group definition out of global namespace, breaks importing as a module.

--- Patch submission info
The import/export scripts included with Blender 2.48 don't save/preserve groups defined in OBJ file. This presents a
couple of issues: users loading an obj file with groups are not able to use a rather important set of data. When the
file is then saved the groups are lost bringing up both the issue of data loss and loss of functionality as groups are
used for rigging and morph target creation for Poser/DAZ Studio and all compatible applications. Of course other
animation/modeling packages that use OBJ files might be affected.

The solution that I present here simply patches the excellent python scripts written by Campbell Barton and Jiri Hnidek.
The new code implements the preservation of groups by creating Blender vertex groups during import and by re-writing
those groups in the OBJ file during export. Of course group ownership is idetermined at the face/polygon level and not
at the vertex level.

This rather simple solution makes Blender instantly one of the better tools to create Poser Morph targets (Full Body
Morphs) and conforming figures and clothing.  Of course it's also adding a more complete support for the whole OBJ spec.

The patches are fitting well inside the established logic, have a minimal impact and are totally transparent to the
user. See the attached video (about 7 minutes long) for more details.

I noticed that the original scripts are formatted with tabs. I think it would be a good idea to follow the standard
Python recommendation and convert the scripts to use spaces. I didn't want to do it on my side as it would generate
a patch that replaces the whole file, not something that I wanted to do with my first submission :) But it would help
if people with access to SVN could do it.

Here is a short video that demonstrates the updates:
http://www.paolociccone.com/blender_obj_scripts.html

Cheers!
----
2009-05-13 00:20:14 +00:00
Martin Poirier
9147124ac2 Mixed declaration and code. That should teach me to ignore warnings. 2009-05-12 23:53:55 +00:00
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