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
2010-12-31update python api with changes from Joshua's commit r33917. translate ↵Campbell Barton
reports into python errors.
2010-12-03Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for ↵Campbell Barton
'const char's,. Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03fix for some pedantic warnings.Campbell Barton
2010-11-23minor edits to exception formatting (remove ... or \n from suffix)Campbell Barton
2010-09-01bugfix [#23285] Exporters not available whel using special characters in ↵Campbell Barton
path name - ID properties now suopport non utf-8 strings for their values but not their keys. - moved utility functions into py_capi_utils.c from bpy_utils and bpy_rna. - import/export paths have to be printed with repr() or %r, so non utf-8 chars are escaped.
2010-08-14- PyLineSpit() - used to print the filename and line number for internal ↵Campbell Barton
errors now works when executing class functions in a module. - replaced PySys_GetObject("modules") with PyImport_GetModuleDict() - use defaults for keymap import/export rather then setting the same value every time from the UI scripts.
2010-03-16made argument conversion for much more verbose, wasnt giving enough info ↵Brecht Van Lommel
with bad operator args. (commit 27432 by Campbell from render25 branch)
2010-03-14remove unused includesCampbell Barton
2010-02-12correct fsf addressCampbell Barton
2010-02-01bpy.props.IntVectorProperty & BoolVectorPropertyCampbell Barton
2009-12-31remove python api cruft from custom operator registrationCampbell Barton
2009-12-07use sets rather then tuples for enum/flags so you can use bitfield operatorsCampbell Barton
2009-11-23workaround for an error with BKE_reportf (actually BLI_dynstr_vappendf)Campbell Barton
fixes a crash that happens when formatting a python exception into a report. - for now use pythons string formatting function. happens when running the simple operator template so not sure if its worth re-tagging :S
2009-11-10fix error with python exceptions in BPy_errors_to_reportCampbell Barton
2009-11-05- missing return valuesCampbell Barton
- more detailed exceptions (always give file:line incase the python exception doesnt) - fix some errors in the edit docs editing docs still fails, need to figure out why.
2009-09-03remove Py_CmpToRich (copy of py3.0 function), instead only support == and != ↵Campbell Barton
for PyRNA and KX_PySequence types. mesh1 > mesh2 # will raise an error.
2009-08-152.5: warning fixesBrecht Van Lommel
Directories intern/ and source/blender/ now compile warning free again here with scons/gcc.
2009-08-10fix for build problem with audiospace and implicit declaration.Campbell Barton
2009-08-10remove python2.x supportCampbell Barton
2009-07-19Python operatorsCampbell Barton
- simplified C operator API bpy.__ops__ since its wrapped by python now. - needs the class to have an __idname__ rather then __name__ (like menus, headers) - convert python names "console.exec" into blender names "CONSOLE_OT_exec" when registering (store the blender name as class.__idname_bl__, users scripters wont notice) - bpy.props.props ???, removed
2009-07-11PyApiCampbell Barton
* refcount error if StringIO or io modules could not be imported * importing python modules like math didnt work because the script registration overwrote the script path. now just prepend the path.
2009-07-10RNABrecht Van Lommel
* Enums can now be dynamically created in the _itemf callback, using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking for enum items now need to potentially free the items. * This callback now also gets context, this was added specifically for operators. This doesn't fit design well at all, needed to do some ugly hacks, but can't find a good solution at the moment. * All enums must have a default list of items too, even with an _itemf callback, for docs and fallback in case there is no context. * Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation. * Also changes some operator properties that were enums to booleas (unselected, deselect), to make them consistent with other ops.
2009-06-22PyAPI Mathutils Vector callbacks, referencing other PyObjects rather then ↵Campbell Barton
thin wrapping vectors which is crash prone. in short, vectors can work as if they are thin wrapped but not crash blender if the original data is removed. * RNA vector's return Mathutils vector types. * BGE vectors for GameObject's localPosition, worldPosition, localPosition, localScale, worldScale, localInertia. * Comment USE_MATHUTILS define to disable returning vectors. Example... * 2.49... * loc = gameOb.worldPosition loc[1] = 0 gameOb.worldPosition = loc * With vectors... * gameOb.worldPosition[1] = 0 * But this wont crash... * loc = gameOb.worldPosition gameOb.endObject() loc[1] = 0 # will raise an error that the objects removed. This breaks games which assume return values are lists. Will add this to eulers, matrix and quaternion types later.
2009-06-182.5 PythonBrecht Van Lommel
Merging changes made by Arystanbek in the soc-2009-kazanbas branch, plus some things modified and added by me. * Operator exec is called execute in python now, due to conflicts with python exec keyword. * Operator invoke/execute now get context argument. * Fix crash executing operators due to bpy_import_main_set not being set with Main pointer. * The bpy.props module now has the FloatProperty/IntProperty/ StringProperty/BoolProperty functions to define RNA properties for operators. * Operators now have an __operator__ property to get the actual RNA operator pointers, this is only temporary though. * bpy.ops.add now allows the operator to be already registered, it will simply overwrite the existing one. * Both the ui and io directories are now scanned and run on startup.
2009-06-14Blender/Python APICampbell Barton
Send the full python stack trace to the reporting api, added BPY_exception_buffer which temporarily overrides sys.stdout and sys.stderr to get the output (uses the io module in py3 StringIO in py2 to avoid writing into a real file), pity the Py/C api has no function to do this. fix for crash when showing menu's that have no items.
2009-05-28rna_define.c, RNA_def_struct - set the py_type to NULL when making an rna ↵Campbell Barton
struct based on another. bpy_util.c, PyObSpit - print refcount with PyObject
2009-05-25Store the context for python in a static variable with assessor functions - ↵Campbell Barton
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-04-19RNA: Generic Type RegistrationBrecht Van Lommel
The Python API to define Panels and Operators is based on subclassing, this makes that system more generic, and based on RNA. Hopefully that will make it easy to make various parts of Blender more extensible. * The system simply uses RNA properties and functions and marks them with REGISTER to make them part of the type registration process. Additionally, the struct must provide a register/unregister callback to create/free the PanelType or similar. * From the python side there were some small changes, mainly that registration now goes trough bpy.types.register instead of bpy.ui.addPanel. * Only Panels have been wrapped this way now. Check rna_ui.c to see how this code works. There's still some rough edges and possibilities to make it cleaner, though it works without any manual python code. * Started some docs here: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration * Also changed some RNA_property and RNA_struct functions to not require a PointerRNA anymore, where they were not required (which is actually the cause of most changed files).
2009-04-082.5:Brecht Van Lommel
* Fix to make python panels callbacks get the actual blender Panel as an argument, instead of any instance. * Fix for callback validation in python 2.5, worked OK in python 3.0 but gave error in 2.5 because it's a method instead of a function there.
2009-04-01Python Panels WIPCampbell Barton
- Register python panels - Added a generic class checking function BPY_class_validate() for panels/operators. - No button drawing yet Brecht, Added RNA_enum_value_from_id() and RNA_enum_id_from_value() to rna_access.c to do lookups between identifiers and values of EnumPropertyItem's, Not sure if these should go here.
2009-03-21get rid of warnings, fix for a refcount errorCampbell Barton
2009-03-21- lazy subtype initialization rna, was initializing every type in bpy.types ↵Campbell Barton
at startup, which is slow and doesn't allow access to dynamically added types. - bpy.types isnt a module anymore, defined as its own PyType, getattr looks up the rna collection each time. - refcounting fixes - fixe epydoc generation with undefined values
2009-03-19* removed warnings and fixed some python refcount errorsCampbell Barton
* operator class names - Changed 'name' to '__label__' (since __name__ is already used for the class name) - Changed 'properties' to '__props__' * added a PyObject_GetAttrStringArgs(), utility function which Id like to see in pythons C api. PyObject_GetAttrStringArgs(pyob, "someattr", "foo", "bar") /* pyob.someattr.foo.bar */
2009-03-11WIP PyAPI from winter camp discussions, make subtypes of the base RNA python ↵Campbell Barton
type, eventually allowing us to have python defined RNA classes in python - lux/pov/renderman materials, lamps etc as well as operators. At the moment there are 2 ways to do this, The first is like subclassing from python, another (disabled) method copies the base PyTypeObject struct and makes some changes. The PyType is stored in the RNA Struct for reuse, right now there are no access functions - needs to be improved. Added a python script for printing all blend file data to the console which helps testing the api. dir(rna) wont work for python 2.x now, use rna.__dir__() instead.
2009-03-02* errors in bpyui draw scripts were segfaultingCampbell Barton
* added PyLineSpit(), useful for debugging so you can easily find the line of the python script running.
2009-02-28Python experimental UI APICampbell Barton
Can draw panels in the scripts space containing RNA and operator buttons. * Added bpyui.register() so scripts can draw buttons and panels into the scripts space type. * wrapped drawBlock, drawPanels and matchPanelsView2d * Operator buttons take a python dictionary used to set the button defaults. * BPY_getFileAndNum utility function to get the filename and line number python is currently running.
2009-02-26update to build with python 3.0.1 which removed Py_InitModule3, added ↵Campbell Barton
richcompare functions to the operator api.
2009-01-29include Py_CmpToRich for python versions lower then 3Campbell Barton
2008-12-28include order is important here :/Campbell Barton
2008-12-28missing bpy_compat.h for <3.0 pyCampbell Barton
2008-12-28PyOperator invoke function now receives the wmEvent and default properties ↵Campbell Barton
as 2 python dictionary args. the Python invoke function can then edit the properties based on the event, once its finished the properties are copied back to the operator. python exec and invoke functions can now return RUNNING_MODAL, CANCELLED, FINISHED, PASS_THROUGH flags Still need to look into how python operators can make use of invoke/exec for a practical case. (Need to bring back the popup menu's)