Commit Graph

29 Commits

Author SHA1 Message Date
f0b048bf3c tiny correction for PyAPI Background Image: Windows.SetBgImage(image)
function call activates background-image-mode if disabled
2010-06-08 11:09:20 +00:00
5a70fc9045 added API support for Background Image: Windows.GetBgImage(), Windows.SetBgImage(image) 2010-06-08 00:02:42 +00:00
955e1b7ba0 PyAPI - Window.TestBreak() - True if the user pressed escape. 2008-03-06 22:45:11 +00:00
e64a44266c SetPivot, patch from malefico, #7785 also added GetPivot 2007-11-22 10:10:57 +00:00
ef85f6ea21 ==Python API==
layerMask access for bone and armatures
Window.PoseMode() similar to Window.EditMode()
2007-10-26 08:19:40 +00:00
3db1a55b2d added an optional window ID arg to Window.ViewLayers so you can set the layer for each viewport. 2007-06-08 15:41:31 +00:00
1a47d71f72 added Window.Get/SetActiveLayer() and changed how scn.objects.new() works, if scn is the active scene it uses the 3d views active layer to create the object in. 2007-03-30 08:20:37 +00:00
4d061263a9 Draw.c fixed error in exception I added with string max length.
Window.py added note about the view offset being flipped.
editview.c Fly mode timed redraws so motion is the same speed erespective of scene complexity.
2006-06-23 23:58:50 +00:00
Ken Hughes
df3fd052dd Fixed Window.Editmode(0) so that it only calls undo_push_mesh() when
U.undosteps is nonzero.  Also added optional parameter to avoid pushing
undo info alltogether if desired.
2006-01-16 02:06:02 +00:00
Ken Hughes
c0e94f3063 Fix incorrect documentation for Window.QTest(). 2005-11-28 22:49:59 +00:00
4ea1c4dc60 * update to python docs
- update for the old mathutils rewrite
- update for some other methods ive added
- added explaination of wrapped data
- added a .css file for epydoc gives nice blender/python colors :?
2005-11-15 21:14:24 +00:00
Stephen Swaney
cf620b95d5 Updates and corrections to the BPy doc. Patch #2975
A large chunk of documentation goodness from Campbell Barton (ideasman).
Thanks!

Note that any mispellings, errors, or inconsistencies are due to
my ham-fisted editing.
2005-10-11 15:11:39 +00:00
589ce4a005 BPython:
- based on a request by Campbell (he also provided a patch for scene.Layer) access to layers was improved a little, keeping the old method (ob.Layers is a bitmask) and adding the nicer one (ob.layers is a list of ints).  Done for objects and scenes.  House-cleaning: .Layer was renamed to .Layers (actually just using strncmp instead of strcmp, so both work, same done for Window.ViewLayers).
- finally committing patch by Ken Hughes to let .clearScriptLinks() accept a parameter (list of strings) to clear only specified texts.
- doc updates and fixes (JMS reported a problem in nmesh.transform() example code).

Thanks all who contributed.
2005-04-21 19:44:52 +00:00
a96ed881dc BPython:
- Scripts:
    fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
    cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
    small updates to help_browser.py script.

 The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place).  Updated Scripts win->Scripts menu so it won't show all available entries, only  the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees.  The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).

- Modules:
    Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
    NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).

- Bugs fixed:
    #2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
    Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text).  Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.

    #1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
    Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
    Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file.  After more testing we can make further updates.  Updated many places to not call redraws if in bg mode, now it is officially available.  Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.

- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
ab21276aaf fixed example of use the GetScreenInfo
.
2005-03-17 14:41:36 +00:00
52b84f0e69 BPython:
- Gert de Roost reported an inconsistency between nmesh.getMode and .setMode.  Now .setMode() optionally accepts an int value, as returned by getMode().
- Campbell Barton pointed that object.getData(name_only=True) was by mistake returning the obj name, not the obdata name, as it should.  Fixed now.
- small doc updates

Thanks both for the reports.
2005-03-01 02:37:19 +00:00
0737153338 BPython:
-- applied patch by Michael Reimpell that lets scripts registration info be either commented out or not (commented, it doesn't interfere with Python documentation tools.  The patch also fixes potential overflows, thanks (and sorry for the confusion) again, Michael.
-- fixed NMesh_hasFaceUV, it was returning true for false and vice-versa.  Reported by Jonas Petersen with patch, thanks.
-- added 'homedir' and 'uscriptsdir' to Blender.Get() to get Blender's home dir and the user defined scripts dir.
-- related to the above doc updates.
2004-11-02 05:13:52 +00:00
fa9135385a BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
  image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
  be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
  accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
  now), same in Blender.Sound: renamed makeActive to setCurrent.  Stephen Swaney
  pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
  functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
  after reading a discussion on blender.org's Python forum where eeshlo mentioned the
  pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
  confirmed, talked to Theeth about this and as he suggested am changing the default
  back to 'worldspace'.
2004-10-20 05:51:24 +00:00
446e1fae7c ** Note: two new files added, projectfiles will need an update.
Scripts:
  Campbell Barton (Ideasman, thanks) updated his Wavefront OBJ importer.
BPython:
- Finally committed pending contributions:
    Chris Keith wrote the Blender.Sound module -- still some testing to do this week;
    Joseph (joeedh) added the OnLoad scene script event;
    Satish Goda added 6 GLU functions to Blender.BGL.  Great additions, thanks all!
- Small changes to Blender.Load (leave editmode as Blender wants) and Window.EditMode (allow definition of "undo string");
- Fixed bug #1539: Window.RedrawAll() crashed Blender if an empty spacescript was available while using it in a gui-less script.
- doc updates.
2004-08-17 04:26:00 +00:00
c50e3f374f BPython:
- new submodule Scene.Radio, for radiosity: still incomplete, but in shape for demos, updated SConscript to include it;
- new functions in Window module;
- doc updates: adding a todo file and a new start page for our docs: API_intro.py + other updates;
- small fix in Ipo.c provided by Damien McGuinnes (thanks!): Nathan has a patch with IPO additions and fixes for this and more, but until it is committed, there's this fix for Ipo.getCurve('LocX'), LocY, Z and QuatW,X,Y,Z too, according to Damien.

Other files:
- radpreprocess.c: added check for "during_script()" so eventual msgs don't popup during scripts;
- drawmesh.c: made a pointer (display list) be checked before accessed, fixes crash in scripts that forget to update display lists for subsurf meshes when a 3d view is in textured view mode.

Script: updated bevel_center by Loic Berthe.
2004-07-25 16:55:45 +00:00
7b3b3ae432 Trying to fix bug reported by Peter den Bak and Meino Christian Cramer (thanks!):
-- splash screen disappeared (duh, I did that!) and Blender quits upon exiting from some 225 games:

It was troublesome to find how to run demos in general with the screen correctly redrawn before they started, etc.  Ended up making the above error in screenmain().  About the games, I don't have them and will need some time to get the files for testing, but I'll do it, though only on linux.

BPython:
-- Window: added GetScreens, SetScreen and improved GetScreenInfo.
-- Object, NMesh: updated (added in NMesh) method getMaterials to return either only valid materials as before or also empty slots (as None).  This previous omission can be considered a bug, since it made info about materials incomplete / incompatible with face mat indices.  Thanks Yann Vernier for bringing this up and sending/proposing a patch that also fixed a bug related to assigning lists of materials with different lengths to obj and its mesh. setMaterials also accepts Py_None entries now, which become empty slots in Blender.
-- doc updates.
2004-07-20 08:16:46 +00:00
97bba404fb Demo mode and BPython:
- small additions and fixes to enable the demo mode;

- Added sleep() to Blender.sys and 17 new functions to Blender.Window module:
    things to help demo script writing and as a bonus read / write access to Blender's input event queue;

- updates in docs, those interested please check Window.py in python/api2_2x/doc/ to read about the new Blender.Window functions.

----

Demo mode should be working well now for (I) playing rt animation -- aka ALT+A -- and (II) rendering pics and anims and playing anims.  I'll still add access to radiosity data and functions.

PS: Joseph Gilbert made (II) possible with the Scene.Render module he added for 2.32.  He's been coding great things for bpython, so I'd like to take the chance to point that and thank him here.
2004-07-16 03:08:43 +00:00
9282827720 New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)

  Thanks to them for the new contributions!

  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)

BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".

The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
149fad4be6 BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)

#1025 - FileSelector SEGV on dynamic callback Category:

  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.

#1028 - Reserved button event number:

  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.

#1068 - FileSelector No file extension support:

  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.

#959 - Segfault on background rendering:

  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.

#1072 - Blender.Redraw() Segfault:

  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
2004-04-11 04:41:33 +00:00
775f006bf1 Exppython:
- Window: implemented .SetCursorPos, .GetViewMatrix, .GetViewVector
- Lamp: .setDist was not in the methods table:
    Fix by new bpython developer Stephen Swaney
- Scene: .frameSettings was crashing Blender (pointed by jms)
- Added site dirs to sys.path (patch by Stephen Swaney)
- NMesh: small internal change (added pointer to parent object)
- Object: function NMesh_FromPyObject has a new arg: pointer to obj
- Docs: added docs for implemented functions, plus some more info
2003-09-18 00:54:43 +00:00
65746ab10a Exppython:
- Updated two doc files
2003-09-03 04:04:17 +00:00
de60889865 Exppython docs:
- Updates and fixes to the documentation files, only, no code involved.
2003-07-22 00:27:03 +00:00
c467b19c75 Exppython:
- More documentation files for epydoc.
- Few minor changes in other files.
2003-07-12 18:02:54 +00:00
eaf1cdd383 - More renaming all around to follow our conventions
- Implemented partially Blender.Sys
- Worked on issues related to sys, path
- Took away most "debug" printfs
2003-06-28 07:38:21 +00:00