The constants KX_STATE1 to KX_STATE30 can be used
with setState() to change the object state in a
python controller. The constants are defined in the
GameLogic module so that the full name is
GameLogic.KX_STATE1 to GameLogic.KX_STATE30 but you
can simplify this with the import statement:
from GameLogic import *
cont = getCurrentController()
ob = cont.getOwner()
ob.setState(KX_STATE2) #go to state 2
KX_STATEx constants are defined as (1<<(x-1))
Binary operators |, &, ^ and ~ can be used to combine states:
You can activate more than one state at a time with the | operator:
ob.setState(KX_STATE1|KX_STATE2) #activate state 1 and 2, stop all others
You can add a state to the current state mask with:
state = ob.getState()
ob.setState(state|KX_STATE3) #activate state 3, keep others
You can substract a state to the current state mask with the & and operator:
state = ob.getState()
ob.setState(state&~KX_STATE2) #stop state 2, keep others
You can invert a state with the ^ operator:
state = ob.getState()
ob.setState(state^KX_STATE2) #invert state 2, keep others
Revert this because don't work "fine" with dual-monitor.
The problem is not the code, this work fine, but full screen
for a window manager is not both monitor (until set xinerama or
whatever..).
- Button for 'shadow color' was drawn over 'layer shadow' button...
The shadow+spot panel was cramped... spot shadowbuffer uses all
space. Moved it to the Lamp panel with label, more clear now.
Panel reorg is for later :)
- Small fix: Area Lamp 'gamma' slider didn't update preview.
Unfortunately had to move this slider to smaller button...
When there was a setup where an object was linked to more than one scene at once, and in one of those scenes some of the objects in that scene were related to it, the objects related to it were not correctly relinked to the new copy.
This was due to the 2nd check for selected objects
if( (base->flag & flag)==flag)
meaning that only selected objects would get corrected.
Zbuffer error in render: when you render faces clipped by 'clip end' the
z values could wrap around, resulting in errors. Code not nicely clamps,
plus should be faster even!
In a A___B|---|B situation created by duplicating the B keyframe, the long keyframe between the 'B' keyframes was not showing up until the A keyframe was already duplicated. Reverting the 'optimisation' applied there (i.e. searching from last block, as that's where most blocks would be added)
Also removed some unused lines from gpencil.c
- Added blending mode and factor option, so it's more clear and
controllable what happens with it. Also nice for crazy effects
of course!
- Preview render now shows preview for it too
On the todos:
- have this in World buttons (as well) for quicker sky setups
- review math of color clamping and scaling, this is definitely
not good... but a fix will make old files look very different.
- Changed order for applying atmosphere, it does it now before alpha-adding
sky, giving correct transparency
- Added correction for de-premulling and premulling scatter color
(updated select group toolbox and header menu)
Added 2 copy property options - Replace All and Merge All, since there was no way to remove all properties, or set all objects game properties to be the same as the active objects.
Added set_ob_property(ob, prop) to property api.
bugfix in python api, copyAllPropertiesTo, it didnt check for duplicates or that it wasnt copying from/to the same object.
His log:
One of the calls to PIL_dynlib_get_error_as_string was assuming that
it would return a valid string and not NULL (perhaps by converting
to std::string).
This patch simply changes it to always return a string, even when the
error is not recognized.