Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-03-02Py API - rename UndoPush to SaveUndoStateCampbell Barton
2008-02-29Wrap UndoPush with python, needed for apricot, so changes made be scripts ↵Campbell Barton
can have undo's as well, otherwise users undo and loose changes the script made.
2007-12-27==Python API==Campbell Barton
added mipmap as an option for Blender.Get/Set
2007-11-28 Campbell Barton
Patch [#7829] "compressfile" parameter for Blender.Set() from JMS
2007-08-05Python APIKen Hughes
---------- Fix documentation for Blender.CountPackedFiles(), incorrectly referred to Blender.Blender_CountPackedFiles() instead.
2006-12-30* theme save script now saves iconThemes and supports string types.Campbell Barton
* added .iconTheme variable * bugfix. drawType was not being saved because Py_BuildValue and __members__ was missing an "s" * added Blender.Get('icondir')
2006-09-21from looking at patch 4934 made all user preference paths settable with ↵Campbell Barton
Blender.Set('val', data), also added exception errors which were on the todo. image.filename was being limited to FILE_MAXDIR rather then FILE_MAXDIR + FILE_MAXFILE when setting.
2006-07-12A little spell-checkage.Stephen Swaney
Some return types changed from PyNone ( a C name ) to None.
2006-05-17Added Blender.Get('rt') so that the pythoner can access the valueChris Want
of the rt button for setting debugging levels.
2006-05-06Applied pack unpack from Pablo Martin (caedes),Campbell Barton
http://projects.blender.org/tracker/?func=detail&atid=127&aid=3246&group_id=9 adds Blender.c: Blender.UnpackModes (dict with the unpack modes) Blender.UnpackAll(mode) Blender.PackAll() Blender.CountPackedFiles() Image.c: image.packed (this was working) image.pack() image.unpack() Sound.c: sound.packed sound.pack() sound.unpack()
2005-10-03BPython bug fixes:Willian Padovani Germano
- #2781, reported by Ed Blake: crash on undo when there were active space handlers. Space Handler script links belong to screen areas, which do not get saved on undo. Thanks Ton for pointing out the function that restores ui pointers gone bad. - Applied patch #2822 by Ken Hughes for bug #2647 ("Setting a Face UV"), reported by Campbell Barton. - #3022, reported by Timothy Wakeham: "Blender.BGL.glDrawPixels crashes when drawing more pixels then buffer size". Made glDrawPixels check buffer dimensions. - #2882, reported by Campbell: crash in nmesh.getMaterials(arg == 0 or 1) when nmesh came from GetRawFromMesh(). Raw nmeshes are not linked to Blender meshes, so the method doesn't support these options (getting mat info from the actual mesh) for it. - #2817, reported by Tod Koeckeritz: Dir_Depth var was not being decremented in BPY_Menus.c, causing dir depth limits to be reached prematurely. - #2954, reported by Daniel Holtz: "Python scripts crash hard with valid windows paths". Blender.Load() was not meant for background mode, now it's been update to support it, using BKE_read_file instead of BIF_read_file in this case. Also found another issue with command line scripts using Blender.Load() that could crash Blender: trying to free the Text when it wasn't available anymore (loading a new .blend already removed it). There are still issues with one case, though, causing a crash on start or "Memoryblock winopen: double free" at end, when running a script that is already a Blender Text (only if the script calls Blender.Load, of course). Will investigate. - #2897: reported by Timothy Wakeham: object.setMaterials was asking the length of a Python list w/o confirming first if the passed obj was really a list. Thanks all for the help and for being patient (long delay, again).
2005-05-09BPython:Willian Padovani Germano
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events). Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None). - Updated Window and Window.Theme with new theme vars and the Time space. - Script links: -- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered. -- Added "Enable Script Links" button in the script buttons tab. Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default. "blender -y" also disables all slinks as happened before with OnLoad ones only. -- Other small changes in the script buttons tab: When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it. Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type. Cancel the popup to leave the string button empty (link exists, but has no script assigned). A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown. With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name. -- Implemented Ton's space handler script links: Right now only for the 3d View, but it's trivial to add for others. There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window. Ton's idea was to give scripts a controlled way to integrate better within Blender. Here's how it works: - scripts must have a proper header, like: # SPACEHANDLER.VIEW3D.EVENT and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu. Check (mark, click on it) a script to make it active. EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module: import Blender from Blender import Draw evt = Blender.event if evt == Draw.AKEY: print "a" elif evt == Draw.LEFTMOUSE: print "left mouse button" else: return # ignore, pass event back to Blender Blender.event = None # tell Blender not to process itself the event DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes. To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always. Still need to code some nice example, which should also serve to test properly space handlers. Simple tests went fine. - doc updates about the additions. ======= Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable. Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are. The tooltips may not be accepted either, since other menus don't use them. Opinions welcomed.
2005-04-21BPython:Willian Padovani Germano
- 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-16Note: this commit includes new functionality to save and restore scripts ↵Willian Padovani Germano
configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor. Scripts: - Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part). - Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course. - New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves. - Added new menu: System, available in the Scripts win. - Updated sys_info.py, help_browse.py and the AC3D importer and exporter. - Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly. - Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir. - Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/) - Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr): http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9 BPython: - Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths. - Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts. - Improved function Blender.Run() to also work with gui and file select scripts. - Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace) - doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea). - Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-03-19BPython:Willian Padovani Germano
- 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-01-13BPython:Willian Padovani Germano
- Added Blender.UpdateMenus() + doc: so scripts can automatically update Blender menus when they create (or download or whatever) new scripts to be registered. - Removed a long deprecated function from the Blender module (release dict). Matt (broken) mentioned the UpdateMenus function a couple weeks ago. I also updated the Save Current Theme script to use it. This is all related to his ideas to use scripts to save and restore themes and e.g. render presets.
2004-11-02BPython:Willian Padovani Germano
-- 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-09-21- Blender: added option 'scriptsdir' to Blender.Get();Willian Padovani Germano
- small updates to the docs; - Object: small fix to getMatrix: check during_script() to avoid undesired loops; added old behavior (pre 2.34) as option: .getMatrix('oldlocal'); - tentative fix for bug #1275: scene REDRAW scriptlinks were not being executed (the call to do so was missing): http://projects.blender.org/tracker/index.php?func=detail&aid=1275&group_id=9&atid=125 added the call in drawview.c, in drawview3dspace(). This causes the scriptlink to be called for each visible view3d, but that's what happens with object redraw scriptlinks, too. Anyway, this is still a test. The place was chosen based on the idea that a scene redraw scriptlink is like an object redraw one, but for all objs in the scene at once. - Window.Theme: new submodule, to get/set theme options in Blender; - Added the script save_theme.py (Help menu for now), to save the current theme in Blender as an executable script (currently shown in the Scripts->Misc menu). There's more work to do for themes, like defining a proper place for them in the interface, adding documentation (for now the added script and the ones it generates can give a pretty good idea of how to use the new module), probably extending themes to support SpaceScript and so on.
2004-08-17** Note: two new files added, projectfiles will need an update.Willian Padovani Germano
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-07-25BPython:Willian Padovani Germano
- 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-20Trying to fix bug reported by Peter den Bak and Meino Christian Cramer ↵Willian Padovani Germano
(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-03Interface:Willian Padovani Germano
- added submenu "Scripts" in both View3D->Object and Mesh menus. Put them on top (it's better to follow some guideline, so users don't have to search for "Scripts" submenu in a different position in each menu), feel free to change. - added button 'previous win' to SpaceScript, makes accessing buttons win, for example, much faster. Maybe all spaces could have this button. BPython: - added Window.EditMode(), to check, enter and leave edit mode. Scripts that change mesh data need this to leave edit mode before making changes to the active (G.obedit) mesh, of course. - updated script bevel_center to use the above function and also popup an error msg if the active obj is not a mesh. - doc updates, minor fixes. Forgot to mention in my previous commit that I also updated the "-P" command-line option (for running script files) to be able to run already loaded Blender Texts, too. So, if you have a script called 'Text' in foo.blend, you can run it with blender foo.blend -P Text .
2004-07-03New scripts:Willian Padovani Germano
- 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-06-24BPython:Willian Padovani Germano
- Added function Blender.Save(filename) to save .blend files. - Added scriptlink-related methods (get, clear, add) to Scene and Materials. Will still add method remove and add these methods to World, Object, Camera and Lamp. - Updates and small fixes in docs.
2004-06-10- small updates to scripts and bpython docs, also fixed two warnings;Willian Padovani Germano
- added function Blender.sys.exists(path) to check if a given file exists; - forgot to mention: in my previous commit the blender.html file was also updated slightly.
2004-05-23BPython:Willian Padovani Germano
- updated docs with recently added functions - dynamic menu entries now are sorted (alphabetically, of course) - added new menu categories for scripts: Wizards, Modifiers, Generators, Materials, Animation: only added to list of options, didn't mess with any Blender header. They are already available from the "Scripts" menu in the scripts win, but not elsewhere. - added option 'datadir' to Blender.Get(option): so scripts can use .blender/bpydata for reading / writing their data files.
2004-05-19BPython:Willian Padovani Germano
-- Added two new functions to the Draw module, to display int and float popup buttons: Both contributed by Campbell Barton, thanks! -- Fixed a couple warnings.
2004-05-02- Documentation for the new python APIJoseph Gilbert
2004-04-25BPython:Willian Padovani Germano
-- epydoc Documentation for eeshlo's Noise module + small typo fix in Noise.c -- BPY_end_python closes .blend file opened by Library module when script doesn't do it by itself.
2004-04-25BPython:Willian Padovani Germano
- New module + doc: Blender.Library: It's like File->Append, loads datablocks from .blend files. - small updates to fix warnings and accomodate for the new module, in readfile.[ch] - New Blender.sys module function: time, a wrapper of the PIL get time function. - Updated original makefile and scons builds.
2004-03-02Documentation for mathutils.Joseph Gilbert
2004-01-23Blender's debug mode only worked on startup:Willian Padovani Germano
- G.f's G_DEBUG flag was being erased in blenkernel/intern/blender.c's setup_app_data: G.f= bfd->globalf // added a line above it to fix this: if (G.f & G_DEBUG) bfd->globalf |=G_DEBUG; G.f= bfd->globalf; BPython: - debug info now only shown if Blender is started with '-d' option - added ~/.blender/scripts to modules sys.path - added two new functions to Blender.sys: basename and splitext - added doc for Blender.sys, updated other docs
2004-01-23BPython:Willian Padovani Germano
- local tentative fix for BLI_gethome(), which returns '.blender' appended only on some Windows systems. Created bpymenu_gethome() to check and add '.blender' if needed. - changed name: .Bpymenus to Bpymenus as suggested by GSR - trivial additions: Object module: added methods .set/getSize Armature/Bone module: bone.set???() methods now accept both n floats or a list of n floats: fff or (fff). All these additions were requested by user Carlos Lopez (Klopes). - New doc: for module Registry.
2003-11-24BPython: small update to Types.c and the docs, to finish welcoming the new ↵Willian Padovani Germano
modules.
2003-11-23BPython:Willian Padovani Germano
-- New module: Blender.Texture, by new developer Alex Mole. Most of it is done: guess only Ipo, envmap, colorband and plugin were not implemented yet.
2003-11-08BPython:Willian Padovani Germano
- Fixed uninitialized NMFace.mode var in NMesh.c - Incref'ed a couple Py_None's in Object.c - Minor update in the docs, changed required version to 2.30
2003-08-06Exppython:Willian Padovani Germano
- Update method scene.update(): To accept an optional parameter for a "full" update (using set_scene_bg()). - Updated the docs accordingly.
2003-07-22Exppython docs:Willian Padovani Germano
- Updates and fixes to the documentation files, only, no code involved.
2003-07-17Exppython docs:Willian Padovani Germano
- Minor: fixed wrong url to www.python.org/doc (had written 'docs').
2003-07-16Exppython docs:Willian Padovani Germano
- Added a very brief intro to the api doc and updated the command to generate the documentation (it's in a comment in Blender.py). Improved the NMesh ex.
2003-07-13Exppython:Willian Padovani Germano
- "last minute" updates to documentation and two modules.
2003-07-12Exppython:Willian Padovani Germano
- A few more changes to integrate the documentation: Instructions to build it with epydoc are on the file Blender.py.
2003-07-12Exppython:Willian Padovani Germano
- More documentation files for epydoc. - Few minor changes in other files.
2003-07-04Exppython:Willian Padovani Germano
- Fixed a problem with control of the global Python dictionary persistence: Blender.ReleaseGlobalDict(bool) should now work fine. - Trying to fix the sigsegv crashes on Windows: They happen when we try to "print" our objects, like Lamps or Cameras. Following advice from the Python Embedding doc, removed the tp_print method from Camera and also improved its tp_repr one, that will be used as print, repr() and str() for Cameras. If this test works all other objs will be updated accordingly.
2003-06-28- More renaming all around to follow our conventionsWillian Padovani Germano
- Implemented partially Blender.Sys - Worked on issues related to sys, path - Took away most "debug" printfs
2003-06-25* Documentation and a simple test for BGL.Willian Padovani Germano
2003-06-24* Added more doc files for epydoc and a test for the camera module.Willian Padovani Germano
* Moved public declarations in camera and lamp to a new file: bpy_types.h. * Fixed minor bugs in material, rgbTuple and Lamp + other minor changes. * Made part of the changes to conform to decided naming conventions.