[Bf-committers] Patch 19293 submitted to patch tracker: NearSensor: Changing distance and resetDistance from Python did not take effect immediately

Frank Papenmeier frank_papenmeier at hotmail.com
Wed Sep 9 15:13:53 CEST 2009

Dear all,

I found a new bug in Blender, again. But wrote a patch and submitted it to the patch tracker immediately.

Changing the distance and resetDistance Properties of a NearSensor from Python did only take effect, once there was
a collision within the old radius.

The radius of the PHY_IPhysicsController was not set to the new values.

It is set at the end of the CheckResetDistance function. I moved the relevant code snippet from the Evaluate function
into a new function called SetPhysCtrlRadius in order to avoid duplicating code doing the same thing.

I included a demo file "Demo-Patch-Near-Sensor.blend". Just press P and watch the console output. You will
see that the NearSensor gets triggered with the old distance values but works properly once the first collision happened.
Using the patched version of Blender the NearSensor gets triggered at the correct distance set by the Python script.


Zeig Deine Urlaubsfotos - einfach und schnell!

More information about the Bf-committers mailing list