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
2007-12-17Reverting to 2_2x BPYMartin Poirier
I was careful in selectively rolling back revisions, but if you've committed changes unrelated to BPY mixed with BPY changes, I might have reverted those too, so please double check.
2007-12-07miscellaneous edits from python development branch merged back into trunkCampbell Barton
2007-11-22SetPivot, patch from malefico, #7785 also added GetPivotCampbell Barton
2007-10-26==Python API==Campbell Barton
layerMask access for bone and armatures Window.PoseMode() similar to Window.EditMode()
2007-09-15new view option, SolidTex, to draw textures in solid mode.Campbell Barton
In the view panel as well as the shortcut Shift+T this works in editmode as well as object mode giving results like this http://members.optusnet.com.au/cjbarton/temp1.jpg where before you could only see textures in textured draw type like this http://members.optusnet.com.au/cjbarton/temp2.jpg
2007-09-02== imagebrowser ==Andrea Weikert
Initial commit of imagebrowser in trunk. BIG COMMIT! Main changes: * completely reworked imasel space * creation and storage of the preview images for materials, textures, world and lamp * thumbnails of images and movie files when browsing in the file system * loading previews from external .blend when linking or appending * thumbnail caching according to the Thumbnail Managing Standard: http://jens.triq.net/thumbnail-spec/ * for now just kept imasel access mostly as old imgbrowser (CTRL+F4, CTRL+F1) a bit hidden still. * filtering of file types (images, movies, .blend, py,...) * preliminary managing of bookmarks ('B' button to add, XKEY while bookmark active to delete) More detailed info which will be updated here: http://wiki.blender.org/index.php/User:Elubie/PreviewImageBrowser Places that need special review (and probably fixes): * BLO_blendhandle_get_previews in readblenentry * readfile.c: do_version and refactorings of do_library_append * UI integration TODO and known issues still: * Accented characters do not display correctly with international fonts * Crash was reported when browsing in directory with movie files * Bookmark management still needs some UI work (second scrollbar?), feedback here is welcome! Credits: Samir Bharadwaj (samirbharadwaj@yahoo.com) for the icon images. Many thanks to everyone who gave feedback and helped so far!
2007-07-25removing unneeded checksCampbell Barton
2007-06-16missing decref.. win Window.RedrawAll() pointed out by kenCampbell Barton
2007-06-16Python API, more METH_VARARGS to METH_OCampbell Barton
2007-06-08added an optional window ID arg to Window.ViewLayers so you can set the ↵Campbell Barton
layer for each viewport.
2007-03-30added Window.Get/SetActiveLayer() and changed how scn.objects.new() works, ↵Campbell Barton
if scn is the active scene it uses the 3d views active layer to create the object in.
2007-02-21adding menu slot ArmatureCampbell Barton
adding menu slot ScriptTemplate new script scripttemplate_mesh_edit is a template for an editmesh script. The function Text makeCurrent() is a dummy until I can get it working when the script runs from a menu.
2007-02-15Bugfix #6049Ton Roosendaal
Calling a pop_space_text(st) crashed in Python code that was drawing areas. Why this was there? No idea... remainder of NaN days. Ugly, bad, go away!
2007-01-31Bugfix for #5000Stephen Swaney
Setup for Armature weak ref list was missing from some places where we execute py code. This confused the interpreter and gave random attribute/tuple parse errors. Changed name of weak ref list to "__arm_weakrefs" to avoid name collision with user variables.
2007-01-29Bugfix for #5846 erratic error with in "ob.getData(mesh=1)"Stephen Swaney
It looks like the changes for bug #5000 Changin EditMode in Script wrecks memory break the python interpreter. Since this is critical, I have #ifdef'ed those out of BPY_interface.c and Window.c. Did not touch Armature.c. The ifdefs are tagged with /* bug 5000 */ This means bug #5000 is back in play. Interesting to note that according to #5846, only scripts run from the script menu and not via Alt-P were broken.
2007-01-25Bug fix for:Joseph Gilbert
[ #5000 ] Changin EditMode in Script wrecks memory Armatures create weakreferences in __main__.__dict__. When Window.Editmode is called, the weaklist it iterated over and armatures are updated.
2007-01-09fixes spelling of filename.Campbell Barton
Window.c was calling undo_push_mesh, even for non mesh objects, exiting editmode would crash for any non mesh object (found with the armature symmetry script), bad juju.
2006-12-30Python API:Willian Padovani Germano
-Added missing access to Node win theme (thanks Mickaël Le-bihan for pointing) and also options group and group_active. -Added Node space to Window.Types dict. -Tiny update to the save theme script version numbers (keeping 2.42 for now to avoid popups, but should change to 2.43 right before release). BTW: Happy New Year everyone :).
2006-09-28-> Enter/Exit editmode wait cursor flagsGeoffrey Bantle
The wait cursor was being called during editmode enter and exit for meshes. This was a problem for several reasons. First of all, python modules like Mesh now make use of editmode features. These methods that wrap editmode tools may be called many times during the execution of a script and lead to the wait cursor rapidly flickering on and off. The other problem was that the wait cursor wasn't being called for editmode enter and exit of all data types. This is unified now. -New Arguments enter_editmode() should be passed a nonzero integer or simply EM_WAITCURSOR if the wait cursor is desired. Currently only the python API passes a '0' to enter_editmode() exit_editmode() has several options and they are passed in as the bitflags EM_FREEDATA, EM_FREEUNDO and EM_WAITCURSOR. These flags are defined in BDR_editobject.h.
2006-04-16a little spring cleaning to remove some compiler warnings forStephen Swaney
implicit declarations, redundant redeclarations, missing initializers, nested externs and other cruft. Cleaned up includes and moved extern _Type decls from Types.h into Types.c since that is the only place where they are needed now. Did not touch Ipo.[ch] since work is on-going there.
2006-01-16Fixed Window.Editmode(0) so that it only calls undo_push_mesh() whenKen Hughes
U.undosteps is nonzero. Also added optional parameter to avoid pushing undo info alltogether if desired.
2005-08-17- update to constant.cJoseph Gilbert
- give it the key/items interface - creates some factory functions for const generation - genutils methods - method for getting module constants - method for throwing errors with a print string - updates to function names - clean up interpreter launch a bit
2005-07-18Header file clean up and warning fixesJoseph Gilbert
- Mostly this cleans up the #includes and header files in the python project. - Warning fixes are mostly casting issues and misc fixes. General warning clean up. - #include Python.h MUST come as the first include to avoid the POSIX redefine warning in the unix makefiles - fno-strict-aliasing flag added to makefile to fix a unavoidable type punning warning in types.c
2005-07-14Mathutils updateJoseph Gilbert
- also included is some fixes for preprocessor inclues and some clean up of the previous commit -rewrite and bugfixes ---------------------------------- Here's my changelog: -fixed Rand() so that it doesn't seed everytime and should generate better random numbers - changed a few error return types to something more appropriate - clean up of uninitialized variables & removal of unneccessary objects - NMesh returns wrapped vectors now - World returns wrapped matrices now - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks - Removed memory allocation (unneeded) from all methods - Vector's resize methods are only applicable to new vectors not wrapped data. - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1 - Euler.rotate does internal rotation now - Slice assignment now works better for all types - Vector * Vector and Quat * Quat are defined and return the DOT product - Mat * Vec and Vec * Mat are defined now - Moved #includes to .c file from headers. Also fixed prototypes in mathutils - Added new helper functions for incref'ing to genutils - Major cleanup of header files includes - include Mathutils.h for access to math types - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes - Matrix() with no parameters now returns an identity matrix by default not a zero matrix - printf() now prints with 6 digits instead of 4 - printf() now prints output with object descriptor - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4) - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence. index cannot go above the row size of the matrix. - slice operations on matrices work with sequences now (rows of the matrix) example: mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data. - slice assignment will no longer modify the data if the assignment operation fails - fixed error in matrix * scalar multiplication - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used - Quats can be created with angle/axis, axis/angle - 4x4 matrices can be multiplied by 3D vectors (by popular demand :)) - vec *quat / quat * vec is now defined - vec.magnitude alias for vec.length - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none') - these methods have been deprecated (still functioning but suggested to use the corrected functionality): * CopyVec() - replaced by Vector() functionality * CopyMat() - replaced by Matrix() functionality * CopyQuat() - replace by Quaternion() functionality * CopyEuler() - replaced by Euler() functionality * RotateEuler() - replaced by Euler.rotate() funtionality * MatMultVec() - replaced by matrix * vector * VecMultMat() - replaced by vector * matrix - New struct containers references to python object data or internally allocated blender data for wrapping * Explaination here: math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python * otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
2005-06-11BPython bug fixes:Willian Padovani Germano
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible) http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9 - #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix) http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9 - gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example). Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all. - added syntax colors access to Window.Theme module. Scripts: - updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature; - updates by Campbell Barton: obj import / export, console; - tiny: converted vrml97 export to unix line endings; - updates in ac3d exporter, help browser, save theme. Thanks all mentioned above.
2005-05-22Roll back changes from Big Mathutils Commit on 2005/05/20.Stephen Swaney
2005-05-20-rewrite and bugfixesJoseph Gilbert
---------------------------------- Here's my changelog: -fixed Rand() so that it doesn't seed everytime and should generate better random numbers - changed a few error return types to something more appropriate - clean up of uninitialized variables & removal of unneccessary objects - NMesh returns wrapped vectors now - World returns wrapped matrices now - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks - Removed memory allocation (unneeded) from all methods - Vector's resize methods are only applicable to new vectors not wrapped data. - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1 - Euler.rotate does internal rotation now - Slice assignment now works better for all types - Vector * Vector and Quat * Quat are defined and return the DOT product - Mat * Vec and Vec * Mat are defined now - Moved #includes to .c file from headers. Also fixed prototypes in mathutils - Added new helper functions for incref'ing to genutils - Major cleanup of header files includes - include Mathutils.h for access to math types - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes - Matrix() with no parameters now returns an identity matrix by default not a zero matrix - printf() now prints with 6 digits instead of 4 - printf() now prints output with object descriptor - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4) - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence. index cannot go above the row size of the matrix. - slice operations on matrices work with sequences now (rows of the matrix) example: mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data. - slice assignment will no longer modify the data if the assignment operation fails - fixed error in matrix * scalar multiplication - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used - Quats can be created with angle/axis, axis/angle - 4x4 matrices can be multiplied by 3D vectors (by popular demand :)) - vec *quat / quat * vec is now defined - vec.magnitude alias for vec.length - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none') - these methods have been deprecated (still functioning but suggested to use the corrected functionality): * CopyVec() - replaced by Vector() functionality * CopyMat() - replaced by Matrix() functionality * CopyQuat() - replace by Quaternion() functionality * CopyEuler() - replaced by Euler() functionality * RotateEuler() - replaced by Euler.rotate() funtionality * MatMultVec() - replaced by matrix * vector * VecMultMat() - replaced by vector * matrix - New struct containers references to python object data or internally allocated blender data for wrapping * Explaination here: math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python * otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
2005-05-20BPython: bug fixes / patches from trackersWillian Padovani Germano
(excuse me for not committing earlier) Patches by Ken Hughes (thanks for all bug fixes!): 1) Setting a scene's MapOld and MapNew values in python does nothing: bug #2566 submitted by Dominic Agoro-Ombaka (dmao): https://projects.blender.org/tracker/?func=detail&aid=2566&group_id=9&atid=125 patch #2571: https://projects.blender.org/tracker/index.php?func=detail&aid=2571&group_id=9&atid=127 2) Calling the file selector after setting the progress bar crashes Blender: bug #2418 submitted by Alessandro Garosi (brandano): https://projects.blender.org/tracker/?func=detail&aid=2418&group_id=9&atid=125 patch #2568: https://projects.blender.org/tracker/index.php?func=detail&aid=2568&group_id=9&atid=127 3) Menus always generate same event when canceled: bug #2429 submitted by Campbell Barton: https://projects.blender.org/tracker/?func=detail&aid=2429&group_id=9&atid=125 patch #2579: https://projects.blender.org/tracker/?func=detail&aid=2579&group_id=9&atid=127 4) Add a vertex to a mesh with groups using a script and then edit that mesh hangs blender: bug #2211 reported by German Alonso Tamayo (servivo): https://projects.blender.org/tracker/index.php?func=detail&aid=2211&group_id=9&atid=125 patch #2580 #https://projects.blender.org/tracker/index.php?func=detail&aid=2580&group_id=9&atid=127 About bug #2033, I'm still looking at it, committing a small fix now. ===== Patches by Campbell Barton (thanks!): #2482: BGL pydocs fix broken links https://projects.blender.org/tracker/index.php?func=detail&aid=2482&group_id=9&atid=127 #2426: Large text in Draw.Text and Draw.GetStreingWidth https://projects.blender.org/tracker/index.php?func=detail&aid=2462&group_id=9&atid=127 #2521: scene.getActiveObject() https://projects.blender.org/tracker/index.php?func=detail&aid=2521&group_id=9&atid=127 #2523: NMesh.GetNames() https://projects.blender.org/tracker/index.php?func=detail&aid=2523&group_id=9&atid=127 - docs also updated
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-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-03-09big warning hunt commitJean-Luc Peurière
lot of casts, added prototypes, missing includes and some true errors
2005-02-16BPython bug fixes:Willian Padovani Germano
-- Ton caught a redraw trying to free a busy slider button in a script. Made sure the redraws don't happen in the scripts win during slider updates, but the realtime slider (automatically updates the 3d view) isn't working yet as it probably shouldn't with the current code. There's a pre 2.25 comment in Draw.c about it being hackish and wrong; -- Melchior FRANZ reported a bug related to a script dict being freed too early (when two instances of the same script were on: one with a gui and the other with a file selector -- selecting the file triggered the problem); -- bug #2074 reported by Roland Hess: totally empty string button -- no prepended but->str (e.g. "OB:") neither but->poin (the actual string) -- crashing Blender. Crash happened on editscreen.c: screen_delayed_push_undo calls strncpy() without checking the passed string. Didn't mess with it, better let the coder in charge of undo (Ton, right?) choose a preferred way to deal with it (report error, simply use blank string). Staying on the python side at least for now, I just made but->str = " " (a space) when user doesn't define it, so the crash shouldn't happen anymore. http://projects.blender.org/tracker/?func=detail&atid=125&aid=2074&group_id=9 Thanks guys for reporting the problems.
2005-01-22BPython:Willian Padovani Germano
- Stephane Soppera added long missed support for edge data in Blender.NMesh + related doc; - Michael Reimpell improved script registration (fixes bug report #2160) and the file and image selectors in Blender.Window (improved with suggestions from Yann Vernier). They now suppport methods as callbacks; - World.get/setMode were not registered, so could not be directly called (reported by Ken Hughes). Still needs some work to improve things, including docs. Scripts: - Jean-Michel Soler updated his texture baker based on input from Appolux; - Campbell and Jean-Michel improved the bvh importer: faster, better float units scaling (by Campbell); supports Poser 3.01 files (by jms). Thanks guys!
2004-12-05BPython, two bug fixes:Willian Padovani Germano
- #1911: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1911&group_id=9 BOOL properties were returning True always, small mistake in logic.c's getData method. - #1944: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1944&group_id=9 G.vd was not being checked against NULL in Window.ViewLayer, causing a crash when this function was called from a command line script. Now it returns an error in such cases. - small doc updates, tiny minor change in Object.c.
2004-10-31BPython -- a few fixes:Willian Padovani Germano
-- fixed bug #1689: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9 Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window. It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list. -- fixed bug #1568: http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125 Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :). I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'. Ref doc already updated. -- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts: Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway. Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
2004-10-20BPython:Willian Padovani Germano
- 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-07Another step in the Big Bpy Cleanup.Stephen Swaney
- move static declarations and data definitions out of headers. the BGL module still need cleaning. - move declarations out of modules.h and into appropriate .h files. modules.h still exists as a container for the few modules that need to #include almost everything. - all files now have a $Id tag and have been formatted by indent there are no changes to executable code. pre-commit versions are tagged with bpy-cleanup-pre-20041007 for the sake of paranoia.
2004-09-26Another round in the Great BPy Cleanup:Stephen Swaney
Run everything thru indent to cleanup spaces vs tabs. Clean up some of the comments by hand. BGL.c was not touched due to all that macro wackyness. There are no functional changes to the code. Pre-indent versions of source are tagged with tag bpy-cleanup-20040925 , just in case.
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-09-18One small part of the Great Bpy Code Cleanup.Stephen Swaney
Add cvs $Id tag to files
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-08-09Fix for #1509Nathan Letwory
Running the system info script with a text window (empty) open caused dereferencing of a null-pointer with obviously unwanted results. Catching the possible situation before it happens.
2004-07-28Scripts:Willian Padovani Germano
- Campbell Barton updated his sel_same.py script; - Added to Mesh scripts a call to Window.EditMode(0) to leave editmode before changing meshes. BPython: - small doc fixes / updates; - added a call to undo_push_mesh inside Window.EditMode(0). Mesh scripts could change the mesh but not the editmesh -- that would then overwrite the changed mesh. Made all mesh scripts leave edit mode before changing a mesh.
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-16Demo mode and BPython:Willian Padovani Germano
- 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-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-04-11BPython: cleaning some bug tracker entries:Willian Padovani Germano
(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-02-29Mathutils library for the python APIJoseph Gilbert
- support for quaternions, euler, vector, matrix operations. - euler supports unique rotation calculation - new matrix memory construction and internal functions - quaternion slerp and diff calculation - 2d, 3d, 4d vector construction and handling - full conversion support between types - update to object/window to reflect to matrix type - update to types/blender/module to reflect new module