Commit Graph

15075 Commits

Author SHA1 Message Date
Campbell Barton
903722299d BGE PyAPI fixes
- 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.
2009-06-03 04:12:59 +00:00
Robin Allen
a3c0730f99 RNA: more compositor nodes wrapped 2009-06-03 00:40:38 +00:00
Brecht Van Lommel
abfc3daaf4 UI:
* Added initial color ramp and curve mapping templates.
2009-06-03 00:14:12 +00:00
Brecht Van Lommel
084be86ea9 UI:
* 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.
2009-06-03 00:09:30 +00:00
Brecht Van Lommel
9ed9acaf9a UI:
* Implemented scale_x/scale_y for layouts.
* Implemented left/right/center/expand alignment for row layouts.
2009-06-03 00:04:48 +00:00
Brecht Van Lommel
7498561cfb 2.5:
* Button space context now includes most data so python code doesn't
  have to look it up manually, and to plug-in context browsing later.
2009-06-03 00:01:22 +00:00
Brecht Van Lommel
5b2737a735 2.5:
* 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.
2009-06-02 23:56:33 +00:00
Brecht Van Lommel
c2d2b1c57d RNA
* 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.
2009-06-02 23:53:40 +00:00
Kent Mein
a9c29cd415 This commit fixes the following two coverity issues:
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
2009-06-02 19:29:20 +00:00
Ton Roosendaal
ca24322413 2.5
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 :)
2009-06-02 18:10:06 +00:00
Ton Roosendaal
67494dcad3 2.5
Crash; reading NULL pointer in poll() callback for UV edit.

Note: poll() is ONLY for checking context, not for changing things.
2009-06-02 16:40:15 +00:00
Thomas Dinges
bfbb7d5d73 2.5 Constraints:
Wrapped IK and Rigid Body Joint constraint to Python.
Note: Couldn't test Rigid constraint due to crash.
2009-06-02 09:40:24 +00:00
Matt Ebb
ad545fd9f6 Wrapped buttons window in RNA 2009-06-02 08:08:41 +00:00
Robin Allen
62abe788c4 Fixed limits on translate node 2009-06-01 21:38:03 +00:00
Robin Allen
a3f097c646 Bugfix for faulty noise function in bricks node 2009-06-01 21:22:43 +00:00
Benoit Bolsee
4c7a02f6a1 BGE: memory leak in Random actuator + make actuator truly random when seed=0 in the UI. When running the game, seed 0 is replaced by a random seed accessible through Python in seed attribute of the actuator. Other seed value will be left unchanged and will generate fixed pseudo random series. 2009-06-01 18:41:58 +00:00
Ton Roosendaal
a117731aa2 2.5
- 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)
2009-06-01 17:21:03 +00:00
Peter Schlaile
2a3627e338 == Sequencer ==
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)
2009-06-01 16:35:05 +00:00
Ton Roosendaal
cb96aa47db 2.5
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.
2009-06-01 16:22:53 +00:00
Ton Roosendaal
dbbe06b690 2.5
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!
2009-06-01 14:08:19 +00:00
Campbell Barton
617b45256a BGE Blendfile path bug (use for loading and saving the GameLogic.globalDict)
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.
2009-06-01 12:36:22 +00:00
Ton Roosendaal
7c4fccd684 2.5
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.
2009-06-01 12:10:30 +00:00
Brecht Van Lommel
0e02fef8b4 2.5: Added first particle panel, and an RNA property to retrieve
the active particle system.
2009-06-01 11:39:11 +00:00
Ton Roosendaal
41963d9e4e 2.5
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 :)
2009-06-01 11:31:06 +00:00
Benoit Bolsee
358ec00256 BGE bug fix: dynamically added sensor objects didn't have their physic shape synchronized with movement. 2009-06-01 09:44:41 +00:00
Peter Schlaile
d1f7a2ceee == Sequencer ==
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...)
2009-06-01 09:24:46 +00:00
Peter Schlaile
332279e12e == Sequencer ==
This fixes:
[#18707] Syncing animation to audio (works fine in 2.45. It does not work properly in 2.48)
2009-06-01 09:01:29 +00:00
Campbell Barton
94af724293 YoFrankie bug [#18857] On start gives ImportError: No module named frankie_scripts
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.
2009-06-01 05:43:58 +00:00
Peter Schlaile
e415fa27b0 == Sequencer ==
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
2009-05-31 21:14:25 +00:00
Peter Schlaile
ae565b9bb3 == Sequencer ==
This fixes: IPO pinning on sequencer strips was lost during Undo.
2009-05-31 17:59:57 +00:00
Campbell Barton
8e882d0d61 Bug in KX_GameObject.get() and ListValue.get(), wasn't checking if the CValue derived objects could be converted to a PyObject.
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.
2009-05-31 17:44:38 +00:00
Daniel Genrich
934e3ddf0d Deform modifiers can now use useRenderParams and isFinalCalc in modifier stack as non-deforming and constructing modifiers can already - please check for problems or if i missed something 2009-05-31 17:20:57 +00:00
Robin Allen
c4efd3a1af RNA: Wrapped texture nodes, made a start on compo nodes.
Difficult to test, because outliner no longer shows nodetree? (Just a bullet icon)
2009-05-31 16:45:30 +00:00
Benoit Bolsee
8deca3ecfc BGE: fix refcount bug causing crash with Object texture coordinates. 2009-05-31 14:54:31 +00:00
Ton Roosendaal
acd5281a21 2.5
RNA didn't compile for msvc, variable declaration on wrong place.
2009-05-31 12:47:36 +00:00
Thomas Dinges
3f6d5dd27a 2.5 Constraints:
* Wrapped Action Constraint to Python.

* Some layout tweaks by William Reynish.
* Cleaned up the code a bit.
2009-05-31 11:47:45 +00:00
Ton Roosendaal
011d91624e AO render error, caused by bugfix after RC3 :(
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.
2009-05-31 11:22:11 +00:00
Matt Ebb
27fe29b2b7 * started wrapping 3d view space in RNA 2009-05-31 01:22:34 +00:00
Thomas Dinges
a67e7bebb9 2.5 Constraints:
* 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.
2009-05-30 23:31:10 +00:00
Matt Ebb
c41f8ea2ad * fix for resetting window size on builtin b.blend startup.
I think this should work ok for now, but would really appreciate someone who knows the windowmanager code well to take a look at it  :)
2009-05-30 07:26:45 +00:00
Matt Ebb
1422cb6e45 fix for previous commit, reload startup was freezing 2009-05-30 04:24:10 +00:00
Matt Ebb
b36eb7e452 * Updated blender 2.5 default setup
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.
2009-05-30 04:16:24 +00:00
Ton Roosendaal
b3ce0c6a49 Last pre-2.49 commit part 1: splash c file and release number 2009-05-29 17:51:16 +00:00
Benoit Bolsee
f5b3a00fbb BGE: small performance problem: object set invisible at startup were still put in the DBVT, causing unnecessary culling. 2009-05-29 17:09:20 +00:00
Benoit Bolsee
d5b27fabcc BGE: sensor object will now have Actor filter optional: new button 'Detect Actor' in physics settings indicate if you want the sensor to detect only Actor object or all objects. This way you don't need to set the scenery to Actor to detect ground for example. 2009-05-29 16:55:22 +00:00
Brecht Van Lommel
688b7c73ad RNA:
* 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.
2009-05-29 15:12:31 +00:00
Benoit Bolsee
dd9c9efde7 BGE modifier: last minute commit to fix a nasty bug with modifers messing the alpha blend mode of the GE. Note the alpha sorting on modified mesh is not implemented so derived mesh should not have alpha faces (clip will work though). Incidently fixed a performance problem in GLSL where the derived mesh was possibly rendered multiple times. Modifier support is still a bit experimental and should not be used in production game. 2009-05-29 13:37:51 +00:00
Campbell Barton
092b13ef3a the option for saving images as jpeg2000 was missing 2009-05-29 13:33:33 +00:00
Campbell Barton
6ee8067189 typo in message 2009-05-29 09:27:48 +00:00
Campbell Barton
edcb9f8863 workaround for strange python problem in the BGE and BPy API where printing warnings mistook the blender binary for a script - argv[0], Binary lines were printed into the console sometimes causing console beeps and corrupting future console output.
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.
2009-05-29 09:22:24 +00:00
Benoit Bolsee
39177018af Revert commit 20478: instead of changing the default in blender, it's better to change the values for the demos that need it. 2009-05-29 08:55:14 +00:00
Brecht Van Lommel
02e719079f 2.5: fix crash loading saved file with render result, image user
scene wasn't set to NULL on load. Still doesn't seem entirely safe
but prevents crash here.
2009-05-29 00:20:41 +00:00
Brecht Van Lommel
ce334b1cd9 UI: Matt, check space_outliner.c diff to see how to get python
layouts in a header.
2009-05-28 23:58:18 +00:00
Brecht Van Lommel
a741cbff82 2.5: fix text editor issue with scrolling and an invalid memory read. 2009-05-28 23:48:29 +00:00
Brecht Van Lommel
facb944616 UI:
* Added a dummy preview render template, to test some layout
  engine features on tomorrow.
2009-05-28 23:41:12 +00:00
Brecht Van Lommel
46b91bf162 UI:
* 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.
2009-05-28 23:37:55 +00:00
Brecht Van Lommel
a591a47c43 RNA:
* 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.
2009-05-28 23:23:47 +00:00
Brecht Van Lommel
9cc638fb16 Context:
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
2009-05-28 23:13:42 +00:00
Erwin Coumans
17c51c6cb7 Bullet Physics maxphystep = 1 is better general default to avoid vicious circle
(graphics slower -> physics slower -> overall frametime slower -> graphics slower etc.)
See difference in vault.blend
2009-05-28 22:26:28 +00:00
Ken Hughes
bdfa07cddb Python API
----------
Bugfix: make bpy.data.meshes.new() work the same way as Blender.Mesh.New().
2009-05-28 14:24:16 +00:00
Campbell Barton
0edb6e89be [#18803] 'ShadeModes' dictionary and 'shadeMode' instance variable exported to Python API
Ton was ok with adding Vladislav Turbanov (vladius)'s patch during the freeze.
2009-05-28 14:01:10 +00:00
Campbell Barton
8c4620f3d3 [#18840] Joystick sensor lag
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.
2009-05-28 13:44:32 +00:00
Benoit Bolsee
6ac072e1bd BGE: no sleeping and lock axis physics options were not propagated to replicas. 2009-05-28 11:04:45 +00:00
Campbell Barton
a843d7e316 Needed to cast to a PyObject* 2009-05-28 10:31:56 +00:00
Campbell Barton
b9d8a2716a renamed python 'bookmark' attribute to 'useHighPriority', was renamed in the UI but not in python. 2009-05-28 07:11:12 +00:00
Campbell Barton
ca5d429bf9 grsaaynoel spent ~2hrs to figure this out, theeth, feel free to elaborate if the tip isnt quite correct. 2009-05-28 06:34:56 +00:00
Campbell Barton
ea826759c4 Projection paint, cloning from 1 layer to another would show ugly black lines at the seams because interpolation didnt wrap across the image.
Added bilinear_interpolation_color_wrap to be used instead of bilinear_interpolation_color for painting.
2009-05-28 06:13:56 +00:00
Matt Ebb
970f9f3ee2 * Wrapped outliner space in RNA, and added a python ui file for the header.
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.
2009-05-28 05:09:25 +00:00
Campbell Barton
a804ae7b3f rna_define.c, RNA_def_struct - set the py_type to NULL when making an rna struct based on another.
bpy_util.c, PyObSpit - print refcount with PyObject
2009-05-28 02:03:48 +00:00
Joshua Leung
4512be4b6c 2.5 - Fixes for animating enum values
Interpolation between keyframes for enum values (and booleans) can only be constant now. 

TODO:
A way to do this for modifiers is still needed.
2009-05-28 01:57:29 +00:00
Peter Schlaile
01f8956a6d == FFMPEG ==
This fixes:
[#17505] Bad Interlacing for NTSC in mpeg-2 files
2009-05-27 22:37:45 +00:00
Campbell Barton
5936032f66 patch from Andrea Weikert, added some comments.
thanks for looking into this.
2009-05-27 15:41:44 +00:00
Campbell Barton
fb7d688c1b flag the images as dirty when projection painting (so there is the option to repack a packed image) 2009-05-27 03:43:22 +00:00
Matt Ebb
af324690ee * Small graphical/gui tweaks to constraint and modifier templates 2009-05-27 03:42:51 +00:00
Campbell Barton
0cab562e46 Workaround for size 1 brushes not working with projection paint,
need to investigate why this wont work but for now just clamp the value while projection painting.
2009-05-27 02:03:22 +00:00
Brecht Van Lommel
1b1667018e UI:
* 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.
2009-05-27 00:03:49 +00:00
Andrea Weikert
b89fb7d8fd 2.5 filebrowser
- some cleanup of ugly conditional.
2009-05-26 21:34:20 +00:00
Benoit Bolsee
191e22dd62 BGE: fix a bug with kinematic object not giving the correct friction to dynamic object when they have a translation and rotation movement at the same time (translation is ignored). Performance: avoid unnecessary synchronization for static object. 2009-05-26 21:32:19 +00:00
Andrea Weikert
3159f4a243 2.5 MSVC projectfiles update
- 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.
2009-05-26 18:54:39 +00:00
Benoit Bolsee
328d3128a5 BGE VideoTexture: VideoFFmpeg was missing a rewind function: rename stop() to pause() and add stop() that will also reset the frame counter. 2009-05-26 18:37:46 +00:00
Campbell Barton
25569b0f7d BGE PyAPI Bug reported by Pitel on blenderartist.
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.
2009-05-26 18:06:09 +00:00
Chris Want
74977721a4 BGE build probs with CMake: directory "source/gameengine/SceneGraph"
was been referenced as "source/gameengine/Scenegraph" in some
include paths.
2009-05-26 17:15:29 +00:00
Campbell Barton
33b974ee43 BGE Py API
- 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.
2009-05-26 16:15:40 +00:00
Brecht Van Lommel
7e48820a97 Fix for bug #18788: vector math node subtract did not work,
patch by Matt D., thanks.
2009-05-26 15:01:06 +00:00
Ton Roosendaal
33304d022d Bugfix #18801
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!
2009-05-26 13:46:08 +00:00
Peter Schlaile
137b3e1dc5 == Sequencer ==
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 :)
2009-05-26 12:57:16 +00:00
Campbell Barton
e93d1ba8e7 Misc warnings
- 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
2009-05-26 10:44:14 +00:00
Ton Roosendaal
ca4d741ce9 Bugfix: (discovered by course participant :)
Brush option "Clone" didn't read linked Clone Image from file.
No idea how this ever could work even... even for Undo it
would crash.
2009-05-26 08:30:28 +00:00
Campbell Barton
7ba91ddcc3 BGE Script template for a python module (set EOL to native this time)
BGE PyAPI use defines for error return values
 - del gameOb['var'] error message was wrong.
2009-05-26 07:41:34 +00:00
Campbell Barton
c590dd3e8c minor ref-counting changes, means new subclasses will get the correct ref count though there are big problems with this still.
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
2009-05-26 06:29:15 +00:00
Matt Ebb
64ddd9ea4f * Scene buttons tweaks
* Added 'render stamp' rna & buttons
2009-05-26 05:03:27 +00:00
Matt Ebb
61101e560d * Small tweaks to texture panels 2009-05-26 02:49:46 +00:00
Ken Hughes
5f82855a07 Interface
---------
Fixing typo in TimeOffset tooltip.
2009-05-26 00:14:22 +00:00
Stefan Gartner
bbed7918c8 IRIX: use python 2.5 by default 2009-05-25 23:35:29 +00:00
Stefan Gartner
25c564c7c3 tiny fix for irix: use putenv instead of setenv 2009-05-25 23:20:38 +00:00
Ken Hughes
ca39228fb7 Interface
---------
Bugfix 18811: long filenames caused stack corruption in BLI_adddirstrings().
2009-05-25 16:09:22 +00:00
Campbell Barton
6d156a1bab Store the context for python in a static variable with assessor functions - BPy_GetContext/BPy_SetContext,
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).
2009-05-25 13:48:44 +00:00
Campbell Barton
ca8497d001 * UI tweaks to python controller (more space for module name), setParent actuator use less space
* object_drop.py - option to orient to face normal (useful for scattering objects over terrain), accounts for normal flipping and can adjust the orientation %.
2009-05-25 11:39:09 +00:00
Campbell Barton
2fa8504dd1 BGE Joystick Hat Bugfix
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.
2009-05-25 06:24:23 +00:00
Campbell Barton
2a9d9605d0 Pressing the '~' key in the ipo view didnt store the view state in the ipo curves as clicking on the ipo channel names does. 2009-05-25 03:06:03 +00:00
Campbell Barton
3053ce1a8c [#18819] save and load globalDictionary actuators don't load the proper files in 2.49 RC3
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.
2009-05-25 02:39:05 +00:00
Campbell Barton
1af059b642 [#18808] Unstable results of Pack Margin in UV editor
was scaling the margin by the area twice
2009-05-25 02:11:18 +00:00
Campbell Barton
3ceed4cfb2 [#18731] trouble with the python api in assigning script constraint's target.
- 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)
2009-05-25 01:45:35 +00:00
Campbell Barton
1266e0f2bf quick fix still allowed for possible crash, check for valid newlibadr return value in the while loop. 2009-05-25 01:00:17 +00:00
Campbell Barton
b7653ba542 missing null check, would crash blender when loading some files 2009-05-25 00:31:41 +00:00
Campbell Barton
fe85bdd040 - BGE Py API, any py function/attribute that took a KX_GameObject would not accept a KX_Light or KX_Camera (bad oversight on my part)
- Typo in occlusion variable init "m_buffer == NULL;" -> "m_buffer = NULL;"

CcdPhysicsEnvironment.cpp and CcdPhysicsController.cpp had too many warnings, fixed most of them.
2009-05-24 23:43:10 +00:00
Benoit Bolsee
323052068a VideoTexture: exception in C++ was not returning an error in Python. Added function name ini PyArg_ParseTuple. 2009-05-24 23:12:38 +00:00
Nicholas Bishop
edd783db73 2.5/Sculpt:
Bugfix for doing a multires subdivision while in sculptmode (forgot to resize projected vertices.)
2009-05-24 23:05:27 +00:00
Peter Schlaile
4e0e720158 == Sequencer ==
This fixes a stupid mistake in proxy handling with custom files:
CFRA not calculated correctly for proxy...
2009-05-24 19:54:35 +00:00
Dalai Felinto
4f7264ee52 Action actuator default value changed from 0.0 to 1.0. Bookmark renamed to Mark and other small logic tooltip changes
- 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.
2009-05-24 19:21:54 +00:00
Ken Hughes
2f0ec4b7fc User Interface
--------------
Bugfix 18817: DataBrowse for MTex used Material IDs instead of Texture IDs.
2009-05-24 16:22:09 +00:00
Peter Schlaile
e5509b98ce == Sequencer ==
Made relative paths work with custom proxy files.
2009-05-24 14:14:58 +00:00
Peter Schlaile
95e14ac4d3 == Sequencer ==
Fixed output rescaling, when changing between preview proxy rendering
and final resolution.
2009-05-24 14:11:16 +00:00
Peter Schlaile
ea94f8ab8a == Sequencer ==
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...)
2009-05-24 13:41:37 +00:00
Ton Roosendaal
ab407f6ac7 2.5
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!
2009-05-24 13:29:29 +00:00
Benoit Bolsee
e41eeaa045 BGE: renamed sensor type enum to avoid conflict with mingw (NEAR was causing the problem). 2009-05-24 12:53:49 +00:00
Erwin Coumans
83bb096f24 + renamed pad3 to m_contactProcessingThreshold (thanks Campbell Barton/ideasman for confirming it is ok to rename it)
+ 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.
2009-05-24 06:31:47 +00:00
Dalai Felinto
45f2463c83 Patch #18815: BGE: More updates to deprecation documentation and 2.49 conversion script by Alex Frases(z0r)
- 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.
2009-05-24 04:45:10 +00:00
Erwin Coumans
52b0a2b3db PhysicsConstraints.createConstraint:
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
2009-05-24 01:55:24 +00:00
Erwin Coumans
4922dd0339 fix generic 6dof constraint support -> convert 3 values into euler angles and convert those into a full constraint frame
(same values as Rigid Body constraint Generic 6DOF values), and add 'setLimit' support for generic 6DOF constraint. todo: enableMotor
2009-05-24 00:42:40 +00:00
Erwin Coumans
eb8c5f3272 Set default constraint solver mode more compatible to Blender 2.48 settings, this fixes rigid body stacking in this blend file:
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.
2009-05-23 22:35:47 +00:00
Erwin Coumans
a96ce9453f Minor fixes in Bullet/constraint solving
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
2009-05-23 20:02:12 +00:00
Peter Schlaile
2de8f6e328 == Sequencer ==
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.
2009-05-23 19:36:11 +00:00
Benoit Bolsee
5441323dca BGE: fix memleaks.
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.
2009-05-23 14:46:43 +00:00
Benoit Bolsee
6d8d7cd768 BGE: Random sensor will produce true random sequence of events when seed is set to 0 in the GUI (the actual seed value is stored in the sensor seed attribute). Positive values will use fixed pseudo random sequence. 2009-05-23 14:40:36 +00:00
Thomas Dinges
3956a10deb 2.5 Buttons:
* Some Modifier layout cleanup.
* For fun: Added icons to the Render Buttons.
* small RNA Typo's
2009-05-23 11:19:18 +00:00
Peter Schlaile
443df708e2 == Sequencer ==
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)
2009-05-23 07:37:02 +00:00
Matt Ebb
5b5d213290 * Updated a whole swag of excellent new icons by jendryzch.
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.
2009-05-23 07:19:31 +00:00
Nicholas Bishop
380efe9dc4 Multires/2.5:
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?
2009-05-23 07:12:55 +00:00
Campbell Barton
3820e4f3db BGE PyController module reloading didnt check that the base of the function was a module (could be a class). 2009-05-23 04:56:37 +00:00
Campbell Barton
cfa2b4f0a5 [#18802] BGE conversion script: more attributes; updated GameTypes.py
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.
2009-05-23 03:19:47 +00:00
Ken Hughes
89049782de Python API
----------
Fix incorrect exception message.
2009-05-22 17:01:32 +00:00
Ton Roosendaal
1a69eab4a0 2.5
- 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!
2009-05-22 15:02:32 +00:00
Thomas Dinges
5bc3bd7b06 2.5 Buttons:
* Added initial Texture Buttons by William Reynish. Thanks! 
Note: I did some code cleanup and fixes to the code. 

* Texture RNA fixes.
2009-05-22 12:07:03 +00:00
Campbell Barton
66ed4325f4 the debug option for BGE scripts only reloaded modules but not packages submodules.
Now reload all the submodules too.

It was also hiding the error message if there was a syntax error which wasnt so helpful.
2009-05-22 09:48:05 +00:00
Ton Roosendaal
43fc5606cf 2.5
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).
2009-05-22 09:09:07 +00:00
Thomas Dinges
88f5c999f2 2.5 RNA:
* Added missing Subdivision Type Notifier.
2009-05-22 07:02:09 +00:00
Dalai Felinto
ec60c74f08 Fix for: energy IPO not supported in glsl mode (reported in the forum).
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)
2009-05-22 06:12:18 +00:00
Campbell Barton
e191618cb5 - Deprecated Mathutils.CrossVecs(v1,v2) for v1.cross(v2), (same with .DotVecs -> v1.dot(v2), for CrossQuats and DotQuats too)
- Grouped Mathutils deprecated functions
- Dont include source code in bpy epydocs
2009-05-22 03:22:56 +00:00
Thomas Dinges
c671469bbb 2.5 Buttons Modifier:
* Converted all modifier to python layout engine. Needs a layout cleanup still.
* Removed corresponding C code (brecht: please check)
* 2 RNA Modifier fixes

* Added initial Mesh panel by William Reynish.
2009-05-21 21:23:36 +00:00
Benoit Bolsee
7f5acd6875 BGE remove parent: unparented object keeps the linear and angular velocity it had while being parented. 2009-05-21 19:38:49 +00:00
Benoit Bolsee
036ebc5523 BGE: GUI control over frame rate, logic rate, physics rate and physics subrate.
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
2009-05-21 18:10:19 +00:00
Ton Roosendaal
34498f3870 2.5
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!)
2009-05-21 17:13:50 +00:00
Ton Roosendaal
aae27374f7 2.5
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 :)
2009-05-21 17:09:06 +00:00
Brecht Van Lommel
2ede3b6e23 2.5: warning fixes. 2009-05-21 15:36:16 +00:00
Brecht Van Lommel
94902dac97 2.5 UI: Modifier Template
* 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.
2009-05-21 15:34:09 +00:00
Matt Ebb
65143c50e0 * Updated the Mac OS X blender and .blend file icons to support
the new (in 10.5) 512px icon standard.

Thanks to Samo 'xype' Korosec for the original graphic treatment!

http://mke3.net/blender/devel/2.5/hugeicon.jpg
2009-05-21 13:39:47 +00:00
Ton Roosendaal
99cb9a26b0 2.5
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.
2009-05-21 13:33:04 +00:00
Benoit Bolsee
06a7155b68 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)
2009-05-21 13:32:15 +00:00
Peter Schlaile
5fc6afe240 == 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 :)
2009-05-21 10:25:40 +00:00
Matt Ebb
b495e544a8 * removed some arbitrary range limits on property values
* 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.
2009-05-21 07:40:43 +00:00
Campbell Barton
3f584de8ec [#18795] Subdivide Smooth can give wrong vcol
weights given by subdivide are not normalized, if that was fixed could avoid clamping.
2009-05-21 07:28:02 +00:00
Campbell Barton
3daa8bd4ef 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.
2009-05-20 23:31:58 +00:00
Benoit Bolsee
fcdb34f593 BGE #18664: Incorrect behavior for objects when unparented. A parented object is made static in all cases. 2009-05-20 21:34:50 +00:00
Nicholas Bishop
176a49d1ab Bug fix: the flags for brush rake/anchored were switched. 2009-05-20 18:37:28 +00:00
Brecht Van Lommel
3cc2d61689 UI:
* 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.
2009-05-20 17:18:48 +00:00
Diego Borghetti
3e49545891 Fix the fix ;)
Only check for type because ptr.data can be NULL and
ptr.type not.
2009-05-20 17:18:47 +00:00
Ton Roosendaal
d5a4a57e5c 2.5
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...
2009-05-20 16:55:28 +00:00
Ton Roosendaal
6294510504 2.5
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.
2009-05-20 16:23:55 +00:00
Diego Borghetti
8407c94f0b Fix segfault on Outliner.
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.
2009-05-20 15:59:57 +00:00
Thomas Dinges
240ee1104c 2.5 UI:
* Added missing buttons validation for Modifier Tab.
2009-05-20 15:33:28 +00:00
Ton Roosendaal
a06caced79 2.5
Colorband (ramp) buttons back (now only in Node editor)
2009-05-20 15:20:24 +00:00
Ton Roosendaal
d6f71875bd 2.5
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.
2009-05-20 14:47:48 +00:00
Brecht Van Lommel
0a13c162b1 UI: added support for enable buttons in the panel header. 2009-05-20 14:46:49 +00:00
Ton Roosendaal
8f620ea5f0 2.5
- 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.
2009-05-20 14:32:15 +00:00
Matt Ebb
2e91f1b155 Assorted UI tweaks/cleanups 2009-05-20 13:56:22 +00:00
Brecht Van Lommel
a47c673b55 2.5 Material:
* 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.
2009-05-20 13:34:04 +00:00
Janne Karhu
ac0766c64b Fix for [#18785] Crash rendering hair particle system 2009-05-20 12:13:37 +00:00
Ton Roosendaal
56b726917d 2.5
Fix: Node Editor backdrop drawing messed up viewport, making drawing of
UI elements not pixel accurate anymore.
2009-05-20 11:07:34 +00:00
Brecht Van Lommel
f1286b15a3 RNA:
* 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.
2009-05-20 09:52:02 +00:00
Brecht Van Lommel
d80911b867 RNA: ID properties were not being shown as RNA properties anymore, fixed.
Python: fix two warnings (initialize to NULL).
2009-05-20 09:17:21 +00:00
Benoit Bolsee
c0844b7938 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.
2009-05-20 08:45:42 +00:00
Campbell Barton
a1cc5ef8eb fix for crash drawing the UI, normally this would cause a memory leak but for some reason it crashed with py2.6 and not 3.1. 2009-05-20 05:35:53 +00:00
Dalai Felinto
dc6ae673b1 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
2009-05-20 05:33:39 +00:00
Campbell Barton
73904597e9 - 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
2009-05-20 01:11:56 +00:00
Brecht Van Lommel
40ae17d2f6 UI
* 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.
2009-05-19 17:13:33 +00:00
Ton Roosendaal
ecacef3682 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.
2009-05-19 15:40:03 +00:00
Thomas Dinges
2a055ca728 2.5:
* 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.")
2009-05-19 15:38:36 +00:00
Ton Roosendaal
1b6bfa6b8a 2.5
Added new entry in 10-timer: 'Anim Step'. This will only call the
animation system itself, no drawing.
2009-05-19 15:37:50 +00:00
Ton Roosendaal
17d0c0917e 2.5
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.
2009-05-19 12:54:54 +00:00
Campbell Barton
1a16fb1953 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.
2009-05-19 07:16:40 +00:00
Benoit Bolsee
5bd4b25dd1 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. 2009-05-19 06:48:36 +00:00
Campbell Barton
def33757e3 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.
2009-05-19 05:07:52 +00:00
Benoit Bolsee
2ac81cc7ad 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. 2009-05-18 21:32:03 +00:00
Dalai Felinto
d35a556d66 Bug fix for: [#18761] GLSL Negative light option in Blender does not work in the GE 2009-05-18 20:23:38 +00:00
Diego Borghetti
96348bc772 Commit revision 20062 and 20109 from trunk, also fix a small memory
error on interface, was try to free an incorrect pointer.
2009-05-18 19:47:04 +00:00
Thomas Dinges
4022380dc6 2.5 UI:
* 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.
2009-05-18 18:20:29 +00:00
Ton Roosendaal
0cd511eee8 2.5
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)
2009-05-18 16:42:34 +00:00
Campbell Barton
9c8f09d2a0 bug in copy weight group since 2.44, accessing free'd memory. 2009-05-18 14:20:16 +00:00
Campbell Barton
65bd48c896 [#18778] Lattice Vertex Groups Don't get deleted
fixed 'Copy Group' for lattice too.
2009-05-18 11:15:24 +00:00
Ton Roosendaal
b1a393e815 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. :)
2009-05-18 10:34:26 +00:00
Campbell Barton
cb96dc40e8 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
2009-05-18 10:27:09 +00:00
Benoit Bolsee
07fc2aa526 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.
2009-05-18 08:22:51 +00:00
Campbell Barton
5a16f0b60c 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
2009-05-18 04:11:54 +00:00
Joshua Leung
d128e16561 2.5 - Bones can now have custom properties (as ID-Props)
Still need to find a way to enable RNA access for these though, since RNA access to ID-Props stored in data seems to be broken...
2009-05-18 02:25:33 +00:00
Joshua Leung
e67e7049f9 Graph Editor: Attempts at Improving Curve Drawing
* 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.
2009-05-18 02:23:20 +00:00
Benoit Bolsee
9a40f4d2a6 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.
2009-05-17 21:50:31 +00:00
Dalai Felinto
9ce8a67690 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)
2009-05-17 20:37:13 +00:00
Campbell Barton
41acd3b81c 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()).
2009-05-17 16:30:18 +00:00
Martin Poirier
7eeb8ac01c Color proofing support with lcms (http://www.littlecms.com/).
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.
2009-05-17 16:19:13 +00:00