- CValue warning ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); had false positives because of python using getattr() internally. Only show the wanring now when a CValue is found.
- Py functions that accepted a vector and a GameObject were slowed down by PySequence_Check() first called on the GameObject, though this would fail it would try and get attributes from the game object - ending up in ~8 attribute lookups each time. Avoiding PySequence_Check() makes ob.getDistanceTo(otherOb) over twice as fast.
- Joystick hat events could crash the BGE for joysticks with more then 4 hats.
- PLY Import failed on PLY files from Carve, added some extra types.
* Make modifier and constraint templates use left/right alignment for
buttons in the header.
* Added mdef bind operator as an example of how to use local context
for a modifier, and add some code I forgot to commit last time to
make this system actually work.
* Fix crash adding rigid body constraint.
* Give new nodetrees NT in ID name to make them recognizned by RNA,
even if the nodetrees aren't actual ID datablock.
* Fix an issue where the pointer types wasn't always refine
to the most specific type, now RNA_pointer_create also
does this for convenience.
* Make lamp fallof type editable.
CID: 475
Checker: REVERSE_INULL (help)
File: base/src/source/blender/blenkernel/intern/cloth.c
Function: bvhselftree_build_from_cloth
Description: Pointer "clmd" dereferenced before NULL check
CID: 476
Checker: REVERSE_INULL (help)
File: base/src/source/blender/blenkernel/intern/cloth.c
Function: bvhtree_build_from_cloth
Description: Pointer "clmd" dereferenced before NULL check
You'll notice in the code the var is actually set again
a few lines down before being used so better to set it
after you've made sure the pointer is valid.
Kent
Part one of new text button type: SEARCH_MENU
This opens a popup showing all matches for a typed string, nice
for object names, materials, operators, and so on.
Warning: Currently menu doesn't function yet! Only draws choices.
As test I've added an operator search button in top bar. It only
shows operators that can be used in this context now. Also that
is part of the WIP, tomorrow more fun :)
- Fix: text draw in fonts was slightly too low; it didn't calculate offset
correctly. Now it is aligned to have number characters in center.
- Fix: text clip was too wide, giving errors on extreme zoom in.
- Added boundbox-clipped default text drawing for view2d:
void UI_view2d_text_cache_rectf(View2D *v2d, rctf *rect, char *str)
(Note; also for previous commit, this cache immediately projects, so if
you change view2d while drawing, text is still on correct positions)
This fixes:
[#18507] Wrong audio mixdown
Also: you can change output sample rate while blender is running
and the audio device get's reopened automatically.
Subframe-precision seeking was also broken for some releases...
(shame on me)
Added support for cached text drawing in View2D. Cache is needed to
prevent the viewmatrix being set/restored on each text drawing.
Adding a string:
void UI_view2d_text_cache_add(View2D *v2d, float x, float y, char *str)
Drawing:
void UI_view2d_text_cache_draw(ARegion *ar)
Nothing else needed; just make sure cache-draw is always called at end
of a view2d drawing function, to clear cache memory.
On todo for next: a version with a rectf boundary to clip text within.
Fix for Spin & Screw Mesh edit operators.
- now center and axis are RNA properties for operator
- axis is drawn as Normal button in properties buttons. Fun toy!
the original blendfile path wasn't reset when loading new blendfiles.
blenderplayer was ok, but running the BGE from blender would set the blendfile original path and never reset it on loading other blend files.
Cleanup commit:
- Yafray removed. Also did cmake/scons files, but didn't compile with it,
so test would be appreciated :)
- Removed old crap from Windows release dir, should be checked on
further by windows release builder later.
Added new widget type in drawing and themes: "Box Backdrop", which is
in use by modifiers. Allows alpha blend, shade, etc.
It was using the general button theme for standard buttons still, to
indicate this change I made it a bit darker. Matt/Bill are invited to
tweak this default color :)
This removes the need of using "-g noaudio", if only HD Sound strips
are used. (In opposite to the RAM Sound strips, they don't need an
initialized Game Sound Engine for obvious reasons...)
GameEngine sys.path creation was broken because of a pesky slash at the end of each path name.
Win32 sys.paths were also failing when running a game that switched between blend files in different directories
On win32 for some reason making absolute paths from lib->name failed, work around this by using lib->filename.
STR_String.h, cast to float to quiet compiler warnings.
This fixes dependency of scrub duration on mixbuffer size.
(start audio with a mixbuffer size of 2048, let it play = initialize,
change mixbuffer to smaller value, you will here 1 second
of audio instead of a scrub)
should hopefully fix
[#18850] 2.49 scrubbing creates an echo
so where foo is an int prop,
gameOb.get("foo") == 0, would end up returning a CValue int proxy.
This is more a problem for KX_GameObject since ListValues with python access mostly don't contain ints, strings, floats.
This also wont break games from 2.48 since the .get() function wasn't available.
My bug fix to support AO with "Amb" texture channel changed code too that calls
AO as a pre-shade process, when texture isn't calculated yet. This caused very
first pixel in a tile to show wrong AO.
Especially myself deserves a kick in butt for not testing the regression files
for release binaries again! Error shows clearly... in the cornelius_passes
.blend file.
* Wrapped the constraint layout to python and deleted the corresponding C code.
ToDo: 4 constraints are still C code (IK, Script, Action and Rigid Body Joint)
* Some Constraint RNA fixes.
* Wrapped the Shrinkwrap Constraint in RNA.
Simplified and started from a clean slate, without much of
the hidden existing space data that was hanging around
in the old one.
One issue I found is that saving the startup file from
Blender 2.5 also saves the window size and location.
This means the version I just saved would open up
strangely on other screen sizes/setups. I added code to
reset this to default when loading it up from the version
compiled into the Blender binary, but perhaps Ton/
Brecht might want to check the diff.
* Added PROP_ID_REFCOUNT flag to control if refcounting should
be done on ID pointer properties. All ID pointers are refcounted,
by default, with the exception of Object, Scene and Text.
* Also made TextureFace image pointer editable, with the special
refcounting behavior.
Internal texts file on disk is not used it seems python warnings dont support this (even though exceptions do).
The most common cause of this is passing a float as an argument to a method that took an int.
get around this by setting __file__ in the namespace to the script name before executing the script, the file lines are not found but at least the output is not weird and confusing.
Added read only 'mode' attribute to the python controller so there is a way to tell if its executing a module or a script. Updated docs to better explain execution methods.
* Added some properties of uiLayout that can be set. I've added
some API code for more than the two I've implementeds, so
ignore those for now.
* layout.active = False will gray out buttons inside a layout.
* layout.enabled = False will gray out and completely disable
the buttons inside a layout.
* Also some function renames.
* Automatically do us++ and us-- reference counting in ID pointer
set functions.
* Added an enum property callback to dynamically vary the list of
available items.
* Added some functions to do removes on pointers and collections
runtime defined for RNA and using ID properties.
* Constraints now have owner/target space wrapped, and most
pointers made editable. They can be ported to use python layouts.
* Also other pointers made editable that I think are see now with
the automatic reference counting.
Added a system for adding a "local" context in a UI layout.
This way you can define for example within a modifier panel
all operators to get the modifier in the context.
In the layout code:
uiLayoutSetContextPointer(layout, "modifier", &ptr)
layout.set_context_pointer("modifier", md)
In the operator:
ptr = CTX_data_pointer_get(C, "modifier")
md = context.modifier
if(SDL_PollEvent(&sdl_event)) // if -> while fixed it
removed 'm_buttonnum' was misleading, wasn't used as you expect.
Added gravity to variable to world to be used by collada.
Brecht, would you be able to have a look at this if you have time - I can't
figure out how to trigger the python file to register the header instead of
what's in outliner_header.c.
* Added Constraints template and Add Constraint operator.
* Added toggle=True/False parameter to uiItemR, to get a
toggle button (actual button) rather than an "option"
button (checkbox)
* Added OPTION/OPTIONN button type, to distinguish with
TOG/TOGN.
RNA:
* Make all modifier pointers editable, including correct updates.
* Added notifiers and updates to constraints.
* Fix a stack corruption, pointed out by Andrea, and potentially
causing crashes.
- file editors/space_image/image_panels.c -> image_buttons.c (renamed)
- file editors/interface/interface_templates.c added
Also added small fix for crash in filebrowser.
importing "pygame" failed when running the BGE for the second time.
Rather then clearing modules, backup and restore them (as its doing with sys.path)
This way the BGE will never remember any modules imported during game play (which can cause bugs/crashes), but it also wont break pythons state by possibly removing modules that are being used internally.
- Deprecation warnings for using attribute access
- Added dictionary functions to KX_GameObject and ListValue
ob.get(key, default=None)
ob.has_key(key)
ob.has_key is important since there was no way to do something like hasattr(ob, "attr") which can be replaced by ob.has_key("attr") - (both still work of course).
ob.get is just useful in many cases where you want a property if it exists but can fallback to a default.
- CListValue::FindValue was adding a reference but the ~3 places it was used were releasing the reference. added a FindValue that accepts a const char* type to avoid converting python strings to STR_String.
Third transparent shadow bug... this time it's a Material Node, which
has mirror + transp-shadow on, and when it traces its own material it
enters an eternal loop...
Raytracing + shading + materialnode combo really needs work!
This adds a per preview option to set render sizes (which proxy size is used).
That makes it possible to have
* several small preview screens which update really fast using the proxy files
* one large output screen that operates in full resolution
Since most of the time not all input strips are considered when calculating
an output screen, this is a big win.
Also: one can disable a preview screen completely using this option.
Other use cases: vector + chromaviews don't always need full resolution
pictures and work equally well on proxy files!
This option finally makes my working setup _completely_ realtime :)
- Removed/Commented some unused vars
- CValue::GetPropertyText() could return a temp reference to a variable on the stack, option wasnt used anywhere so removed.
- KX_ConstraintWrapper::GetConstraintId allows args but ignored them
- KX_ConstraintWrapper::PySetParam didnt return NULL on an error (messing up pythons exceptions).
- BLI_natstrcmp didnt return 0 when the while loop exited
Found that subclassing an RNA struct (without even registering or instancing adds a reference to Py_None).
Unlikely a python bug, tested with py2.6 and 3.1
Still not happy with this in the long term but its less problematic then storing the context in pythons namespace which couldn't be set before importing modules.
This might fix a crash quite a few people have reported (but I cant reproduce).
* object_drop.py - option to orient to face normal (useful for scattering objects over terrain), accounts for normal flipping and can adjust the orientation %.
bug reported by blenderage on blenderartist (found other bugs too).
- "All Hat Events" didnt work.
- Multiple hats didnt work
- use a menu with direction names rather then have the user guess. disallow zero as a direction.
- Allow up to 4 hats (was 2).
- Python api was clamping the axis to 2, maximum is currently JOYAXIS_MAX - 16
- New python attributes hatValues and hatSingle, match axis functions.
- Use SDL Axis events to fill in the axis and hat array rather then filling in every axis with SDL_JoystickGetAxis for each axis event.
For this actuator to be useful it needs to use the first opened blendfile as the base name for the configuration file.
A recent fix that made the gp_GamePythonPath always match the current loaded blend file made this actuator work differently.
keep the original filename to use for making the config name so you can load the config between loading blendfiles.
- Setting the constraint script from python didnt update the target count
- Setting objects didnt work at all, since it checked the input sequence for being an BPy_Object type (rather then an item in the sequence)
- Typo in occlusion variable init "m_buffer == NULL;" -> "m_buffer = NULL;"
CcdPhysicsEnvironment.cpp and CcdPhysicsController.cpp had too many warnings, fixed most of them.
- IPOs and actions start it's frame counting in frame 1, not zero.
- Talked with Ben and we agreed to rename the "bookmark" feature before an official release.
- some English typos.
- removed all period in the end of tooltips for consistency's sake.
* note:
I resisted one more time to the temptation of alphabetical ordering the Sensors and Actuators.
That will be the first thing I would like to do after we are done with 2.49 :)
It really annoys me as a user.
This adds custom proxy file storage to the sequencer.
Reasoning: sometimes low resolution versions are already available as a
seperate file built by the capture application.
So there is no real reason to make blender build it's own seperate proxy.
This also somewhat fixes (aehm works around :) )
[#13632] Creating Proxy Takes Over Process, Should be Background
Since now you can just fire up ffmpeg to build your proxies in the background.
(You could have done before and build a directory of jpeg files, but then you
would have to rename all the files since otherwise things are off by one...)
First version of region-scaling. WIP commit, so bear with me a while!
- All fixed sized regions have a small 'drag' widget, on the left or top.
(not yet for free-sized regions, like 4-split).
- Mouse-over on widget changes cursor and allows drag.
- Click on widget hides/reveals.
- Fun for test; 3d view header, if high enough, draws more rows of
buttons when width is too small.
The WIP stuff;
- It doesn't save yet in files, using the "minsize" variable of region
definitions, also means other similar areas show same sizes now.
- Definitions for pref size, min/max will be added.
- Properties panel in Fcurve window draws widget on wrong place when
hidden (subdiv system needs tweak)
- Widgets don't draw perfect yet, also needs further tweaks.
But, in general it's quite fun and usable. :) Many variatians are possible,
like for real tabs, or little icons, or just click-drag on edge.
The reason to first try the widget/tab variation:
- it re-uses the "Area Action Zone" code, widgets for layouting Screens
- it's visible, hotkey-only options for screen layouts are not preferred.
- distinguish clearly area-edges from region-edges this way. Having the
cursor change shape on every edge (and block input) is probably annoying
too... but that can be tested.
Later more!
+ fixed Python method, PyArg_ParseTuple already checks for errors, no returning of NULL, thanks Campbell too)
+ added linear/angular spring for each of the 6DOFs of a generic 6dof constraint. This makes the generic 6dof constraint very versatile.
- Fixed some deprecation warnings in documentation.
- Added more conversions to script.
- Added more attributes to script todo list.
- Print out name of text buffer when encountering an error in batch mode.
- Refactor: Simplified attribute map.
- Added notImplemented function to print warnings for missing conversions. References documentation.
allow to dynamically create rigid body constraints while disable collision detection between connected bodies, pass as 10th argument the flag 128
PhysiPython KX_ConstraintWrapper, setParam
export setParam(paramIndex,paramValue0,paramValue1) for Physics constraints
paramIndex 0,1,2 are linear limits, 3,4,5 are angular limits, 6,7,8 are linear motors, 9,10,11 are angular motors
For example:
disableConnectedBodies=128
cons = PhysicsConstraints.createConstraint(oid,rid,generic6dof,pivotInAx,pivotInAy,pivotInAz,angleX,angleY,angleZ,disableConnectedBodies)
#params 0,1,2 are linear limits, low,high value. if low > high then disable limit
cons.setParam(0,0,0)
I will provide an example .blend for Blender 2.49
http://blenderartists.org/forum/showpost.php?p=1382653&postcount=102
(todo: expose this setting in World setting GUI)
Expose contact processing threshold in Advanced GUI, next to rigid body margin, called CPT.
Default to 1, makes rigid body stacking a bit more stable, smaller values makes sliding easier (at the cost of easier jittering).
Disabled for 'dynamic' objects that don't rotate, because characters etc. always need smooth sliding.
Should make generic 6DOF constraint more useable, and rigid body stacking more stable (warmstarting was accidently switched off)
If time allows, a few more minor last-minute 2.49 fixes might follow.
Check out http://bulletphysics.com/constraintsTutorial.blend
Fix for the fix: SDL_PauseAudio() doesn't really wait for callback to finish
which can lead to random segfaults if we set audio_scene to 0 afterwards.
So we don't do that.
SCA_RandomActuator: The random generator was shared between replicas and not deleted. Added ref counting between replicas to allow deletion at the end.
KX_Camera: The scenegraph node was not deleted for temporary cameras (ImageMirror and shadow), causing 500 bytes leak per frame and per shadow light.
KX_GameActuator: Global dictionary buffer was not deleted after saving.
KX_MotionState: The motion state for compound child was not deleted
KX_ReplaceMeshActuator: The mesh was unnecessarily converted for each actuator and not deleted, causing large memleak.
After these fix, YoFrankie runs without memleak.
This fixes:
[#18373] WAV with IPO CURVE: Clicking in playback
by adding linear interpolation between frames. (Old IPOs were only calculated
once per frame which will lead to clicking on steep curves)
This includes a bunch of new object primitive icons
which would be great to get into the 'add object' menus,
they're not there yet. The specific lamp data type icons
are now used in the outliner though, which is very helpful.
Added subdivide operator and button for multires.
Since this seems to be the only modifier with an operator defined, I'm not sure if I put it in a good place or not, someone can check on this?
Patch from Alex Fraser (z0r)
- All attributes in the conversion map have been checked against the docs. More ambiguities have been resolved.
- Added option to convert all text buffers in Blender.
- Updated GameTypes.py: there were inconsistencies.
The script works well (causes no errors) with 0_FPS_Template.blend and vehicle_demo.blend from the
physics-2.43-physics-testfiles pack.
Caveats:
- Conversions were checked against other deprecated attributes. I may have missed some cases where a deprecated attribute
has the same name as a non-deprecated attribute. I did catch a few though.
- As with the last version, the conversion is purely text-based and doesn't compile the code. It's easy to create a
script that would break on conversion.
Still, it should get you 90% of the way to a converted script.
- Added new popup menu type, which can be used to pass on a
running operator too. Needed it for debug menu, allowing to
set variables outside of operator "first do then tweak" system. :)
void uiPupBlockOperator()
Don't forget to tell invoke() return that operator now runs modal!
- Test menu: alt+ctrl+d gives the G.rt debug value.
Values of 0-16 now can be used to shrink areas, stuff like this
then happens (rt==4):
http://download.blender.org/institute/rt5.jpg
Was looking at ways to visually distinguish areas and regions
better. Yes I know, cute rounded corners, etc. Just testing!
Fix in sliders; didn't notice the left part messed up :)
Another slider draw method to explore would be like this:
(<| -------- |>)
Would make it symmetrical, and visually matching number
buttons better. (the "<" is background color triangle,
without circle around it).
in fact I redid part of the last "fix", making it working properly now.
Before we were changing Lamp->la . This is the Blender Lamp, we shouldn't touch it.
So this part of the code is correct now.
Things that could be tackled:
- color attribute is returning negative values when NEGATIVE is toggled
- objects with no material (default gray one) still don't support lamp spots (not spot lamp but the spot of the lamps)
Four new buttons in World settings to control frame rate:
fps: Nominal frame rate in frame per second.
Also sets the physics timestep = 1/fps
phys: Maximum number of physics timestep per game frame in case
the actual fps is less than nominal. This allows the
physics to keep up with real time even if the graphics slows
down the game.
sub: Fixed number of simulation substeps per physic timestep.
Improves the precision of the physics simulation. Useful for
fast moving objects for example.
log: Maximum number of logic steps per game frame in case the
actual fps is less than nominal. This allows the logic
system to follow the physics simulation.
Upper bound = phys
(setting the value higher than phys has no effect).
On games with heavy logic system, it is useful to set this
value to 1, to keep logic time under control.
All these values were already accessible from Python except phys:
GameLogic.getMaxPhysicsFrame():
Gets the maximum number of physics frame per render frame.
GameLogic.setMaxPhysicsFrame(phys):
Sets the maximum number of physics timestep that are executed per render frame.
Higher value allows physics to keep up with realtime even if graphics slows down the game.
Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate)
maxphysics/ticrate is the maximum delay of the renderer that physics can compensate.
phys: integer
Bugfix: In full-area screen mode, you cannot split windows again, the
full-area code is too primitive for that. Just disabled now.
(reported by Venom's Lab!)
Interface draw fixes:
- Red cursor for text edit widget was in wrong location
- Selection for text edit widget too
- Number slider text edit was too far too the left
- Number slider 'fill' was drawing outside boundaries.
(Matt: note I just interpolated rounding value :)
* template_modifier creates the modifier box, and returns a layout
to put the buttons in.
* Only the armature modifier is now done with python code, all other
modifiers use C code. To convert a modifier to python, remove the
corresponding C code and create a function in DATA_PT_modifiers.
* Some modifiers still require some RNA work to get it working well,
especially to make pointers editable. Mostly that is a matter of
defining an own _set callback and put some of the modifier C code
into it.
* Still various buttons that don't work, like for hooks or mesh
deform binding.
* Fix for crashing decimate modifier (still disabled).
* Removed UI_BUT_NO_HILITE, HMENU.
* Make uiLayoutBox work with align.
Animation playback back in control. And non-blocking still!
- Play follows the "Playback" options in TimeLine menu.
Only the region 'windows' are drawn, not headers, toolbars,
channel views, etc.
The option "Buttons Window" also redraws property regions.
- The Timeline header always redraws, this to denote at least
progressing frame numbers
- For now: if you choose to play 3D views, it also redraws
the TimeLine. Seems to be good convention, but probably
better to add menu option for it?
- Fun test: while playback, change Playback options, works OK!
- New: top header button shows animation play status, and allows
to stop playback
- New: Animation stop/start operator. Assigned to ALT+A. It has
no options yet; just plays active region + all 3D windows now.
Options will follow, based on reviews.
Also ESC won't work for now, just press ALT+A again.
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)
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 :)
* turned some slider UI controls back into number fields
Note: Sliders should only be used when representing a property that's
conceptually a percentage or ratio. For arbitrary numbers, use a number field.
For example, a lamp's energy can theoretically be anything - 0.1, 3.5, 125.0, it
doesn't matter - it's just a number, not a percentage. So this should be a
number field.
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.
* Hide enable button in horizontal collapsed panels.
* Fix enable button not being in correct position when zooming.
* Fix n-key panels layout being messed up.
Node editor:
- Crash could occur on ALT+LMB remove link lines (read free'd mem)
- Button labels were handled as full buttons, disabling node usage
quite a lot, like drag, select, or create links.
(Caused by making all node labels buttons)
Brecht: old UI_NO_HILITE can be depricated, it was for bad overdraw
issues. I guess it's OK to not handle Label buttons at all...
Fixes:
- Render (F12) would choose the (hidden) info window in cases, disabled
that.
- Browsing ID's (like Image in Image editor) failed when no ID was
assigned yet.
Try to expand the RNA tree in Outliner -> User Preference crash blender.
RNA_struct_idproperties was not checking if ptr.data is NULL
and always try to access the properties type information.
Note: brecht double check this.
Undid fix from matt to prevent tog button alignment, this is not
working that way... made UI look very bad (like layer buttons)
The new code has 'toggle' and 'option' button types, with the
latter being the new style, and first for icon rows, layers, etc.
Purpose is that RNA or py api would allow to distinguish.
- Made Normal (Sphere) button draw with nice AA
(check in node editor)
- Bugfix in alignment code, collumns were not drawing OK
- Picker buttons draw swatches again, and made them work.
* Added material "type" property, with Surface/Volume/Halo
options, compatible with sim_physics, as requested for
material buttons layout. Obviously the Volume setting
does nothing currently.
* Deprecated MA_HALO flag in favor of this.
* Any Struct can now have ID properties, by creating a callback
function to create/return an IDProperty.
* Wrapped PoseChannel ID properties.
* Note there is still no way to create ID Properties in 2.5, though
the callback to get/create the initial group is now exposed through
RNA_struct_idproperties.
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.
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
* Fix buttons jumping around when resizing and zoom. Part of this was
adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the
rounding is unpredictable (used to be 0.375f, but that was disabled).
* Fix various issues with zooming, panning panels. V2D_LOCKOFS_X/Y is
now taken into account in more places in the view2d code, to avoid
zooming into the center or panning out of the view.
* Remove "Free" align mode in buttons window (it's not really useful).
* View3D/Graph/Image editors now use the same PanelType system as the
buttons window, means some deprecated panel code could be removed.
* Some small visual tweaks for panels.
* View 2D Reset operator (Home key), to reset zoom and panning for panels.
* Added argument to set number buttons as sliders (slider=True for itemR).
* Ignore labels for button alignment (doesn't look right).
* Fix some use of context.main in py scripts, should get data from active
object instead.
* Fix autotexspace -> auto_texspace in py script.
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.
* Added new modifier tab.
* Fixed problems when no object was selected after delete.
* Added initial Armature, Bone, Curve and Font panels, by William Reynish (Billrey). Thanks!
* Small RNA changes
* Commit revision 20240 and 20268 from trunk. ("Mouse wheel zoom lost after rendering.")
Brought back the "Ten Timer" test, a useful debugging utility
to keep track of drawing speed. Currently assigned like 2.4x to
ALT+CTRL+T
Added new option to also test speed of drawing entire Window.
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.
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.
* Added new Buttons Tab "Bone" for Armature objects.
* Validation of buttons selection, when object selection is changed.
* added missing notifier for camera type and small layout change to the panel.
* more shading color changes for menu and checkbox.
Text drawing in 3D window fixed, using BLF default font (yes, nice AA'ed
fonts too :)
Solved it by gathering all strings that needs to be drawn for an object,
and then draw in end of object drawing, in pixelspace. Also cleaned up
some of the code for projecting 3d coords, much nicer now (mat stored in
region-view3d)
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. :)
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
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.
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
* Trying a slightly different approach with curve drawing. Now curves aren't drawn darker down the list, as that approach proved to have massive contrast issues all around. However, it's not completely back to the old rainbow style, as the colours are still grouped in 3's and 4's, only that they now use hue offsets...
* Unselected curves are now drawn less opaque. However, selected curves still leave some brightness to be desired...
* Bugfix - Deselecting keyframes in graph view now deselects the curves too.
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.
- 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)
- 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()).
Enable with WITH_LCMS (options have been added for scons).
lcms is very common on linux package managers, so no need to add in extern (IMHO). Libs for windows can be added to /lib
Code is mostly a proof of concept with hardcoded path for icc profile (taken from the lcms test suite).
Adding this now to svn so it doesn't rot on my hard drive. People interested in pushing it forward should feel free to dig in the code or poke me about it.