Campbell Barton [Thu, 21 May 2009 14:11:12 +0000 (14:11 +0000)]
build without SDL in GCC 4.4
Benoit Bolsee [Thu, 21 May 2009 13:32:15 +0000 (13:32 +0000)]
BGE: user control to compound shape and setParent.
Compound shape control
======================
1) GUI control
It is now possible to control which child shape is added to
a parent compound shape in the Physics buttons. The "Compound"
shape button becomes "Add to parent" on child objects and
determines whether the child shape is to be added to the top
parent compound shape when the game is stated.
Notes: * "Compound" is only available to top parent objects
(objects without parent).
* Nesting of compound shape is not possible: a child
object with "Add to parent" button set will be added
to the top parent compound shape, regardless of its
position in the parent-child hierarchy and even if its
immediate parent doesn't have the "Add to parent" button set.
2) runtime control
It is now possible to control the compound shape at runtime:
The SetParent actuator has a new "Compound" button that indicates
whether the object shape should be added to the compound shape
of the parent object, provided the parent has a compound shape
of course. If not, the object retain it's individual state
while parented.
Similarly, the KX_GameObject.setParent() python function has
a new compound parameter.
Notes: * When an object is dynamically added to a compound
shape, it looses temporarily all its physics capability
to the benefit of the parent: it cannot register collisions
and the characteristics of its shape are lost (ghost, sensor,
dynamic, etc.).
* Nested compound shape is not supported: if the object
being parented is already a compound shape, it is not
added to the compound parent (as if the Compound option
was not set in the actuator or the setParent function).
* To ensure compatibility with old blend files, the Blender
subversion is changed to 2.48.5 and the old blend files
are automatically converted to match the old behavior:
all children of a Compound object will have the "Add to
parent" button set automatically.
Child ghost control
===================
It is now possible to control if an object should becomes ghost
or solid when parented. This is only applicable if the object
is not added to the parent compound shape (see above).
A new "Ghost" button is available on the SetParent actuator to
that effect. Similarly the KX_GameObject.setParent() python function
has a new compound parameter.
Notes: * This option is not applicable to sensor objects: they stay
ghost all the time.
* Make sure the child object does not enter in collision with
the parent shape when the Ghost option if off and the parent is
dynamic: the collision creates a reaction force but the parent
cannot escape the child, so the force builds up and produces
eratic movements.
* The collision capability of an ordinary object (dynamic or static)
is limited when it is parented: it becomes automatically static
and can only detect dynamic and sensor objects.
* A sensor object retain its full collision capability when parented:
it can detect static and dynamic object.
Python control
==============
KX_GameObject.setParent(parent,compound,ghost):
Sets this object's parent.
Control the shape status with the optional compound and ghost parameters:
compound=1: the object shape should be added to the parent compound shape (default)
compound=0: the object should keep its individual shape.
In that case you can control if it should be ghost or not:
ghost=1 if the object should be made ghost while parented (default)
ghost=0 if the object should be solid while parented
Note: if the object type is sensor, it stays ghost regardless of ghost parameter
parent: KX_GameObject reference or string (object name w/o OB prefix)
Peter Schlaile [Thu, 21 May 2009 10:25:40 +0000 (10:25 +0000)]
== Sequencer ==
This fixes:
[#18007] Audio playback of a scene strip containing audio is broken.
(needed a different recursion protection than video render code, since
video and audio render can be called simultaneously because of SDL audio thread
callbacks)
Also: we don't display a wait cursor, if the scene strip has DOSEQ enabled.
(no need to wait, it is the sequencer which is realtime by definition :)
Campbell Barton [Thu, 21 May 2009 07:28:02 +0000 (07:28 +0000)]
[#18795] Subdivide Smooth can give wrong vcol
weights given by subdivide are not normalized, if that was fixed could avoid clamping.
Campbell Barton [Wed, 20 May 2009 23:31:58 +0000 (23:31 +0000)]
fix for [#18772] c3d_import script crashes
Patch from Roger Wickes update to 2.48 sFrame, eFrame, fps.
[#18794] GE API conversion script: 2.48 -> 2.49
patch from Alex Fraser (z0r), will test further in the next few days.
---
This is text plug in and standalone script that updates Blender 2.48 Game Engine scripts to be compatible with the 2.49
API.
The script contains a mapping of attribute names to functions that do the conversion. Most of the mappings were extracted
from the documentation in GameTypes.py. Where the conversion is ambiguous, the script will not change the source except
to insert a warning as a comment. This means that the script does not completely automate the conversion process, but
will do a lot of the work.
The script still needs a fair bit of testing. Many of the mappings have not been tested and could result in broken scripts.
I'm submitting this patch now to start the review process early. I think I might need help if it is to be included in
2.49.
Benoit Bolsee [Wed, 20 May 2009 21:34:50 +0000 (21:34 +0000)]
BGE #18664: Incorrect behavior for objects when unparented. A parented object is made static in all cases.
Janne Karhu [Wed, 20 May 2009 12:13:37 +0000 (12:13 +0000)]
Fix for [#18785] Crash rendering hair particle system
Benoit Bolsee [Wed, 20 May 2009 08:45:42 +0000 (08:45 +0000)]
BGE logic patch: fix another incompatibility with YF.
Previous patch was not sorting the state actuators. This was causing
some problems with YoFrankie that relies on the order of actuators
when multiple state actuators are activated at once.
Active state actuators will now be sorted per object. This doesn't
change the fact that state actuators are executed before all other
actuators as before.
Incidently, made the logic loop faster.
Dalai Felinto [Wed, 20 May 2009 05:33:39 +0000 (05:33 +0000)]
Moving ScreenSpace methods from Rasterizer to KX_Camera (getScreenPos, getScreenVect, getScreenRay)
The modules were moved in order to access the camera internal matrixes. It will make then compatible with multiple viewports in a near future.
So far the problem I found was:
1) KX_Camera doesn't store the canvas viewport
2) RAS_ICanvas methods: GetDisplayArea and GetWindowArea are affected by multiple viewports (and they shouldn't).
Test file is here: http://www.pasteall.org/blend/68
Campbell Barton [Wed, 20 May 2009 03:30:50 +0000 (03:30 +0000)]
remove module that was never used.
Campbell Barton [Wed, 20 May 2009 01:11:56 +0000 (01:11 +0000)]
- Added an intro page for the BGE docs rather then using GameLogic
- Added notes on BGE stability and modules
- updated some examples to new api syntax
- include BGL Mathutils and Geometry modules in docs
Ton Roosendaal [Tue, 19 May 2009 15:40:03 +0000 (15:40 +0000)]
Last minute mini feature:
Expanded the "10-timer" (ALT+CTRL+T) with two new test options:
- Draw entire window
- Anim step
The latter will only call animation system, no drawing.
Added this to match the testing menu in 2.5 too, so we can get good
reference performance tests.
Campbell Barton [Tue, 19 May 2009 07:16:40 +0000 (07:16 +0000)]
BGE Py API
use PY_SET_ATTR_FAIL and PY_SET_ATTR_SUCCESS return values so the fake subclassing can know if a value failed to be set or if it was missing from the type. (with PY_SET_ATTR_MISSING)
Also noticed some other mistakes.
- KX_LightObject, setting the type didnt check for an int.
- KX_SoundActuator, didnt return an error when assigning an invalid orientation value
- KX_GameObject, worldOrientation didnt return an error value.
Benoit Bolsee [Tue, 19 May 2009 06:48:36 +0000 (06:48 +0000)]
BGE bug #18762 fixed: softbody. An incompatibility between the soft body deformer and other types of deformer was causing the soft body to disappear in the game. This was the case when the soft body had an armature or simply vertex groups.
Campbell Barton [Tue, 19 May 2009 05:07:52 +0000 (05:07 +0000)]
recorded game physics ipo's also have the same problem FBX export had with eulers rotations
http://www.graphicall.org/ftp/ideasman42/game_euler.png
- dont calculate handles for key added (it does them all at the end).
- was doing twice the number of curve lookup's per frame as was needed.
- test handles function that runs at the end was converting to ipo transformation values for no reason.
- when adding new curves set them to linear interpolation.
Benoit Bolsee [Mon, 18 May 2009 21:32:03 +0000 (21:32 +0000)]
BGE soft body: give access to the soft body collision margin in the Advanced panel. By default the collision margin is set to 0.25, which causes the soft body to somewhat float above the ground. You can decrease this value to get more realistic collision. Note that the algorithm may become unstable with lower margin.
Dalai Felinto [Mon, 18 May 2009 21:05:21 +0000 (21:05 +0000)]
CMake + MSVC debug build fix
Initializing lResult = 0;
and removing NOP (if(!lResult) lResult = 0;
That was discussed with Genscher and Benoit in IRC.
Dalai Felinto [Mon, 18 May 2009 20:23:38 +0000 (20:23 +0000)]
Bug fix for: [#18761] GLSL Negative light option in Blender does not work in the GE
Campbell Barton [Mon, 18 May 2009 14:20:16 +0000 (14:20 +0000)]
bug in copy weight group since 2.44, accessing free'd memory.
Campbell Barton [Mon, 18 May 2009 11:15:24 +0000 (11:15 +0000)]
[#18778] Lattice Vertex Groups Don't get deleted
fixed 'Copy Group' for lattice too.
Ton Roosendaal [Mon, 18 May 2009 10:34:26 +0000 (10:34 +0000)]
Bugfix #18733 & #18609 (revisited)
New imbuf scaling code, advertised as "quick and quality" gave
inacceptable noise and rounding errors.
Check this bugreport for images that show it well:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=18609&group_id=9
For release, better disable this code and fall back on perfectly
working old code. :)
Campbell Barton [Mon, 18 May 2009 10:27:09 +0000 (10:27 +0000)]
Sensor objects were initialized as invisible, which conflicted with initializing the invisible setting from the outliner render object (which it seems nobody knew about).
Added an 'Invisible' button to make this more clear, it seems like a display option but its also related to logic because the actuators can toggle this after the game starts.
Without this its annoying to add UV's only to set the invisible flag.
Sensor objects were not clearing the softbody gameflag
Benoit Bolsee [Mon, 18 May 2009 08:22:51 +0000 (08:22 +0000)]
BGE #18665: Servo control and relative motion
Servo control motion actuator did not work as expected when the object
is moving on a moving platform.
This patch introduces a new Ref field in the servo motion actuator
to set a reference object for the velocity calculation.
You can set the object during the game using the actuator "reference"
attribute; use an object name or an object reference.
The servo controller takes into account the angular velocity of the
reference object to compute the relative local velocity.
Benoit Bolsee [Mon, 18 May 2009 07:53:13 +0000 (07:53 +0000)]
cmake: apply patch to link with correct python library in win32 debug mode.
Campbell Barton [Mon, 18 May 2009 04:33:33 +0000 (04:33 +0000)]
Need to export the mesh-object into the bind-pose otherwise Maya complains the FBX has errors.
Campbell Barton [Mon, 18 May 2009 04:11:54 +0000 (04:11 +0000)]
Bugfix for FBX export for animations
in 2.48 constant interpolations meant that wasnt a problem but since it now uses linear interp. you can notice errors with animated characters because the 2 eulers are not compatible.
Added optional euler_compat argument to matrix.toEuler(eul) and quat.toEuler(eul) so when getting the euler rotations from a list of matrices the animation curve will be continues.
Also added euler.makeCompatible(euler).
- warning silenced for imagepaint.c
Benoit Bolsee [Sun, 17 May 2009 21:50:31 +0000 (21:50 +0000)]
BGE: bookmark option on controller to make them run before all other controllers.
A new bookmark button is available on the controller UI.
When set, the controller is guaranteed to execute before all
other non-bookmarked controllers, provided it is scheduled
for execution.
This is useful for initialization scripts that run once at startup or
scripts that must set some prerequisite for the other controllers at
the start of each logic frame.
This feature is also available at python level with the "bookmark"
attribute. It can be changed during the game.
Note that if several script are bookmarked, their relative order of
execution is not guaranteed. Make sure they don't depend on each other.
Dalai Felinto [Sun, 17 May 2009 20:37:13 +0000 (20:37 +0000)]
BGE Dome: removing of size option and adding tilt option.
- Size adjustments can be accomplished with warp mesh data now. So we get a free spot in the GUI for a tilt option.
- Tilt option to tilt the camera (for planetarium domes).
Angle is in degree from -180 to +180. It's needed for planetarium domes (as this one http://domejunky.blogspot.com/2009/05/dome-corrected-bge.html ).
- This is the last commit regarding dome code I expected to 2.49. I consider this feature full implemented now. (working on docs now)
Campbell Barton [Sun, 17 May 2009 16:30:18 +0000 (16:30 +0000)]
While testing YoFrankie with the new API attributes found some issues...
- corrections to docs
- disallow calling controller.activate(actuator) when the controller is not active. (Raise a SystemError)
- Added 2 new attributes, CValue.name - deprecates CValue.getName(), KX_GameObject.children deprecated KX_GameObject.getChildren(), (same for getChildrenRecursive()).
Thomas Dinges [Sun, 17 May 2009 15:09:03 +0000 (15:09 +0000)]
Patch #18758 for bug #17423 by Matt D. (foom) Thanks!
"Mouse wheel zoom lost after rendering."
Benoit Bolsee [Sun, 17 May 2009 12:51:51 +0000 (12:51 +0000)]
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
Benoit Bolsee [Sun, 17 May 2009 12:25:06 +0000 (12:25 +0000)]
cmake: apply ADD_SUBDIR patch.
Ton Roosendaal [Sun, 17 May 2009 10:30:13 +0000 (10:30 +0000)]
Bugfix #18676
Texture "map to" Ambient did work now (previous fix) but not for
ambient occlusion yet.
Ton Roosendaal [Sun, 17 May 2009 09:56:48 +0000 (09:56 +0000)]
Bugfix #18756
Texture nodes: on file load, the preview render signal was ignored.
Found out it ignores it all the way, inserting refreshes all over, not
using the 'afterqueue'. Will live with that for now, in 2.5 it's nicer
supported anyway.
Just added another refresh line on the proper signal to make it look nice
on file loads.
Martin Poirier [Sat, 16 May 2009 23:47:17 +0000 (23:47 +0000)]
Same tooltip whether snap button is press or not (it used to have a different one when turned on).
Daniel Genrich [Sat, 16 May 2009 21:16:04 +0000 (21:16 +0000)]
Bugfix: Changing ShadowBufferSize didn't update 3d view - reported by nudelZ via IRC (simple update call was missing)
Campbell Barton [Sat, 16 May 2009 13:19:23 +0000 (13:19 +0000)]
setting up the BGE Python sys.path for importing modules wasnt working for library paths.
Brecht Van Lommel [Sat, 16 May 2009 12:56:09 +0000 (12:56 +0000)]
* Fix for another OpenAL compile error on MSVC.
Campbell Barton [Sat, 16 May 2009 06:57:38 +0000 (06:57 +0000)]
replace Py_BuildValue("OOO", Py_None, Py_None, Py_None) with a function that makes and fills the tuple,
since some scripts call rayCast many times in a single logic tick,
contrived benchmark shows this to be about 20% faster.
Campbell Barton [Sat, 16 May 2009 00:49:28 +0000 (00:49 +0000)]
BGE Py API Bugfixes
KX_GameObject.getVelocity() would set an error but nor return an error value when an non vector argument was given.
KX_PythonSeq_Type was not initialized with PyType_Ready which could crash blender when inspecting the type.
Ken Hughes [Fri, 15 May 2009 21:27:13 +0000 (21:27 +0000)]
Scripts
-------
Fix some typos in script tooltips and descriptions-- no code changes.
Benoit Bolsee [Fri, 15 May 2009 20:51:32 +0000 (20:51 +0000)]
BGE: fix a compatibility problem since logic patch with YoFrankie (and other games I guess). State actuators will now execute before any other actuators to make sure that the actuators link count are up to date when they execute.
Brecht Van Lommel [Fri, 15 May 2009 18:21:27 +0000 (18:21 +0000)]
* Fix for compile error on MSVC.
* Remove alut from makefiles and cmake.
Brecht Van Lommel [Fri, 15 May 2009 12:34:01 +0000 (12:34 +0000)]
Bug/patch #18714: fix game engine sound on OS X Intel, patch by
Ken Hursh and myself.
* Get rid of dependency on ALUT. It is really only used to
load a WAV file, and apparently crashing doing so on OS X Intel,
(perhaps due to endian issues?). There was already own code
for doing this on some system, so now it uses that. That code
had it's own endian issues which are now fixed, along with
better checks to avoid crashing on corrupt or unsupported files.
* Also get rid of some unecessarily complicate #ifdefs.
* According to the bug report OS X Intel OpenAL only works with
static openal linking still (WITH_BF_STATICOPENAL for scons).
Campbell Barton [Fri, 15 May 2009 03:26:53 +0000 (03:26 +0000)]
Name attributes added since 2.48a more consistently.
BL_ActionActuator::blendin -> blendIn
BL_ActionActuator::end -> frameEnd
BL_ActionActuator::property -> propName
BL_ActionActuator::start -> frameStart
BL_ActionActuator::type -> mode
BL_ShapeActionActuator::blendin -> blendIn
BL_ShapeActionActuator::end -> frameEnd
BL_ShapeActionActuator::frameProperty -> framePropName
BL_ShapeActionActuator::property -> propName
BL_ShapeActionActuator::start -> frameStart
BL_ShapeActionActuator::type -> mode
KX_CameraActuator::xy -> useXY
KX_ConstraintActuator::property -> propName
KX_GameActuator::file -> fileName
KX_GameObject::localScaling -> localScaling
KX_GameObject::worldScaling -> worldScaling
KX_IpoActuator::endFrame -> frameEnd
KX_IpoActuator::startFrame -> frameStart
KX_IpoActuator::type -> mode
KX_RaySensor::property -> propName
KX_SCA_DynamicActuator::operation -> mode
KX_Scene::objects_inactive -> objectsInactive
KX_SoundActuator::filename -> fileName
KX_SoundActuator::type -> mode
KX_TouchSensor::objectHit -> hitObject
KX_TouchSensor::objectHitList -> hitObjectList
KX_TouchSensor::property -> propName
KX_TouchSensor::pulseCollisions -> usePulseCollision
KX_VisibilityActuator::occlusion -> useOcclusion
KX_VisibilityActuator::recursion -> useRecursion
SCA_2DFilterActuator::passNb -> passNumber
SCA_PropertyActuator::property -> propName
SCA_PropertyActuator::type -> mode
SCA_PropertySensor::property -> propName
SCA_PropertySensor::type -> mode
SCA_RandomActuator::property -> propName
Campbell Barton [Fri, 15 May 2009 02:03:27 +0000 (02:03 +0000)]
minor change - mistake in joystick fix, util function for getting attrs from BGE types
Campbell Barton [Thu, 14 May 2009 23:06:05 +0000 (23:06 +0000)]
BGE PyAPI
[#18701] Issues with camera.pointInsideFrustum method
- note in docs that the projection matrix is not correct for first logic tick.
Renamed...
KX_Camera.isViewport -> KX_Camera.useViewport
KX_Lamp.quat_attenuation -> KX_Lamp.quad_attenuation
Deprecated KX_Camera.getProjectionMatrix(), KX_Camera.setProjectionMatrix() for projection_matrix attr
Added most missing docs reported by the doc-checker script
Campbell Barton [Thu, 14 May 2009 21:06:48 +0000 (21:06 +0000)]
[#18749] BGE: Crash on joysticksensor.getAxisValue()
negative index would be used when the joystick was not found, crashing python api, initialize these as 0 now.
Martin Poirier [Thu, 14 May 2009 18:32:27 +0000 (18:32 +0000)]
Fix for bug #18622
Snapping has to be reinit after changing mode during transform.
Needs to be fixed in 2.5 too, but a tad differently.
Benoit Bolsee [Thu, 14 May 2009 13:47:08 +0000 (13:47 +0000)]
BGE modifier: generate correct physic shape, share static derived mesh, share display list.
This commit completes the support for modifiers in the BGE.
- The physic shape is generated according to the derived mesh.
This is true for all types of shapes and all types of
objects except soft body.
- Optimization for static derived mesh (mesh with modifiers
but no armature and no shape keys). Replicas will share
the derived mesh and the display list: less memory and
faster rendering. With this optimization, the static
derived mesh will render as fast as if the modifiers were
applied.
Known Limits:
- Sharing of mesh and display list is only possible between
in-game replicas or dupligroup. If you want to instantiate
multiple objects with modifiers, use dupligroup to ensure
best memory and GPU utilization.
- rayCast() will interact with the derived mesh as follow:
Hit position and hit normal are the real values according
to the derived mesh but the KX_PolyProxy object refers to
the original mesh. You should use it only to retrieve the
material.
- Dynamic derived mesh have very poor performance:
They use direct openGL calls for rendering (no support
for display list and vertex array) and they dont't share
the derived mesh memory. Always apply modifiers on dynamic
mesh for best performance.
- Time dependent modifiers are not supported.
- Modifiers are not supported for Bullet soft body.
Ton Roosendaal [Thu, 14 May 2009 12:36:07 +0000 (12:36 +0000)]
Bugfix, sorta :)
Removed option to choose rendering to yafray. New yafaray is better, and
already is being linked as option on the blender.org download page.
Ton Roosendaal [Thu, 14 May 2009 11:36:52 +0000 (11:36 +0000)]
Bugfix #18743
Render: raytracing materials with transp-shadow + SSS crashed
Campbell Barton [Thu, 14 May 2009 10:59:38 +0000 (10:59 +0000)]
updated BGE doc checker script for classes now being in GameTypes.py
Ton Roosendaal [Thu, 14 May 2009 09:32:47 +0000 (09:32 +0000)]
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.
Campbell Barton [Thu, 14 May 2009 07:59:44 +0000 (07:59 +0000)]
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.
Campbell Barton [Thu, 14 May 2009 02:21:50 +0000 (02:21 +0000)]
[#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.
Campbell Barton [Thu, 14 May 2009 00:10:25 +0000 (00:10 +0000)]
print warnings when python attributes and methods conflict with game properties.
Campbell Barton [Wed, 13 May 2009 22:52:31 +0000 (22:52 +0000)]
* 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
Benoit Bolsee [Wed, 13 May 2009 17:02:39 +0000 (17:02 +0000)]
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.
Benoit Bolsee [Wed, 13 May 2009 16:48:33 +0000 (16:48 +0000)]
BGE API cleanup: motion actuator. Apply patch from Moguri.
Ken Hughes [Wed, 13 May 2009 15:41:33 +0000 (15:41 +0000)]
Python API
----------
Fix problem with ShrinkWrap PROJECT_OVER_NORMAL setting.
Campbell Barton [Wed, 13 May 2009 12:26:54 +0000 (12:26 +0000)]
use epy deprecated field and link to attributes
Campbell Barton [Wed, 13 May 2009 10:15:19 +0000 (10:15 +0000)]
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.
Benoit Bolsee [Wed, 13 May 2009 06:53:21 +0000 (06:53 +0000)]
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?
Benoit Bolsee [Wed, 13 May 2009 06:42:15 +0000 (06:42 +0000)]
BGE #18732: Python Light options don't work with GLSL materials. Commited patch from dfelinto and moguri, thanks for the good work.
Campbell Barton [Wed, 13 May 2009 00:20:14 +0000 (00:20 +0000)]
[#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!
----
Martin Poirier [Tue, 12 May 2009 23:53:55 +0000 (23:53 +0000)]
Mixed declaration and code. That should teach me to ignore warnings.
Martin Poirier [Tue, 12 May 2009 23:41:46 +0000 (23:41 +0000)]
Fix crash when missing int argument for -s -e and -j.
Campbell Barton [Tue, 12 May 2009 21:41:04 +0000 (21:41 +0000)]
[#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.
Campbell Barton [Tue, 12 May 2009 21:27:01 +0000 (21:27 +0000)]
[#18711] Particle render API for Python
from Alberto Santos (dnakhain)
Campbell Barton [Tue, 12 May 2009 21:13:29 +0000 (21:13 +0000)]
[#18728] Particle (newtonian) physics API for Python
patch from Alberto Santos (dnakhain)
Benoit Bolsee [Tue, 12 May 2009 19:48:18 +0000 (19:48 +0000)]
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.
Campbell Barton [Tue, 12 May 2009 16:20:23 +0000 (16:20 +0000)]
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.
Campbell Barton [Tue, 12 May 2009 15:28:07 +0000 (15:28 +0000)]
[#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.
Benoit Bolsee [Mon, 11 May 2009 23:05:13 +0000 (23:05 +0000)]
BGE bug #18596: No ipo dynamics is 2.49rc1.
Ken Hughes [Mon, 11 May 2009 22:27:06 +0000 (22:27 +0000)]
Python API
----------
Patch by Jean-michel Soler (jms) to support ShrinkWrap and SimpleDeform
modifiers.
Campbell Barton [Mon, 11 May 2009 22:17:58 +0000 (22:17 +0000)]
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.
Benoit Bolsee [Mon, 11 May 2009 22:07:30 +0000 (22:07 +0000)]
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.
Campbell Barton [Mon, 11 May 2009 21:35:38 +0000 (21:35 +0000)]
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.
Janne Karhu [Mon, 11 May 2009 19:19:36 +0000 (19:19 +0000)]
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.
Ken Hughes [Mon, 11 May 2009 16:57:54 +0000 (16:57 +0000)]
Remove incorrect "w" attribute from Eulers, gave warning in epydocs.
Diego Borghetti [Mon, 11 May 2009 15:34:46 +0000 (15:34 +0000)]
Fix Makefiles for gameengine.
Benoit Bolsee [Mon, 11 May 2009 12:41:48 +0000 (12:41 +0000)]
BGE: Add MT_Vector3 support for Py attribute macro system. See KX_PYATTRIBUTE_VECTOR_...
Campbell Barton [Mon, 11 May 2009 12:38:24 +0000 (12:38 +0000)]
Another Noise Tool svn commit is complaining about mixed line endings so after 16 attempts I wont include the full message
Brecht Van Lommel [Mon, 11 May 2009 12:06:53 +0000 (12:06 +0000)]
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.
Campbell Barton [Mon, 11 May 2009 05:47:14 +0000 (05:47 +0000)]
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).
Campbell Barton [Mon, 11 May 2009 05:35:32 +0000 (05:35 +0000)]
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.
Campbell Barton [Mon, 11 May 2009 05:10:09 +0000 (05:10 +0000)]
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
Campbell Barton [Mon, 11 May 2009 00:56:48 +0000 (00:56 +0000)]
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.
Campbell Barton [Mon, 11 May 2009 00:19:55 +0000 (00:19 +0000)]
update script templates for new BGE api attributes
Campbell Barton [Sun, 10 May 2009 22:33:21 +0000 (22:33 +0000)]
use the same sequence mapping types as CListValue, hopefully this means it will build on different python versions
Benoit Bolsee [Sun, 10 May 2009 22:06:11 +0000 (22:06 +0000)]
Linux compilation problem
Benoit Bolsee [Sun, 10 May 2009 21:30:30 +0000 (21:30 +0000)]
Linux compilation problem, better fix
Campbell Barton [Sun, 10 May 2009 21:22:25 +0000 (21:22 +0000)]
changes to get benoits logic updates building on scons with gcc
Benoit Bolsee [Sun, 10 May 2009 20:53:58 +0000 (20:53 +0000)]
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
Campbell Barton [Sun, 10 May 2009 15:23:18 +0000 (15:23 +0000)]
remove unneeded vars and wasn't returning on some errors
Campbell Barton [Sun, 10 May 2009 01:48:14 +0000 (01:48 +0000)]
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.
Dalai Felinto [Sat, 9 May 2009 21:54:22 +0000 (21:54 +0000)]
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?)
Dalai Felinto [Sat, 9 May 2009 21:04:03 +0000 (21:04 +0000)]
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.
Campbell Barton [Sat, 9 May 2009 18:18:04 +0000 (18:18 +0000)]
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