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
2009-04-11Added back importing UI scripts rather then running,Campbell Barton
The bug was todo with bpy.data and bpy.types becoming invalid, temporary fix is to re-assign them to the bpy module before running python operators or panels. will look into a nicer way to get this working.
2009-04-11Python ApiCampbell Barton
own error with refcounting and raise an error when bpy.types cant generate a subtype (though it shouldn't happen)
2009-04-11undo previous commit, changing running the script to importing it somehow ↵Campbell Barton
made it crash when running the class functions. will look into this further.
2009-04-11Changed the script UI registration to import rather then run each python script,Campbell Barton
this means it caches the compiled pyc files after importing fro the first time. My times for importing 501 buttons_objects.py files were. - running each as a script 1.9sec - importing for the first time 1.8sec - importing a second time (using pyc files) 0.57sec Also added "bpy" to sys.modules so it can be imported.
2009-04-11UI:Brecht Van Lommel
* Added very basic loading of .py files on startup to define panels. It now executes all .py files in .blender/ui on startup. Right now this contains the object buttons, the C code for it is commented out. These files should get embedded in the blender executable as well eventually, that's a bit more complicated so this works for now. * For scons and cmake it seems to copy & find the files OK, for make only "make release" works (same with scripts/ folder it seems). * Added BLI_gethome_folder function in BLI_util.h. This is adapted from bpy_gethome, and gives the path to a folder in .blender like scripts or ui. There's plenty of things to figure out here about paths, embedding, caching, user configs ...
2009-04-11RNA: python support for REQUIRED flag for function parameters.Brecht Van Lommel
2009-04-09talked to vekoon and he's ok about using pythons CFunction rather then our ↵Campbell Barton
own pytype. If printing PyTypes becomes important we can do it a different way which is still less then 10 lines.
2009-04-09Added rna functions so they get included in a dir(rna_struct) from python.Campbell Barton
Added a check that a panel panel is a subclass of bpy.types.Panel (need a better way to access this type)
2009-04-09Experimental removal of pyrna_func_Type (ifdef'd out)Campbell Barton
Since adding a new type gives quite a lot of extra boiler plate functions. Return PyCFunction's main disadvantage is it does not have a uniqie name when you print it.
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-07py <2.5 dont have lenfuncCampbell Barton
2009-04-07RNA: fix for compile error on msvc, and a warning fix.Brecht Van Lommel
2009-04-07RNA: Commit of the API patch by vekoon. This adds Functions to RNA,Brecht Van Lommel
which can be defined to call C functions with defined parameters. * Parameters are RNA properties, with the same types. * Parameters are stored in a ParameterList, which is like a small stack with the values. This is then used to call the C function. * Includes Python integration. * Only one test function is part of this commit, ID.rename. * Integration with the editors/ module is not included in this commit, there's some issues to be worked out for that still.
2009-04-02UI: various panels fixes.Brecht Van Lommel
* Fix sometimes non-working close/open button. * Fix panels being a bit out of the view on startup. * Fix too large totrct region for view2d. * Fix wrong panel order when changing vertical <-> horizontal. * Fix wrong panel positions after switching contexts. * Fix an access of freed memory when collapsing panels. * Free align mode works again. * Animations work again.
2009-04-02forgot to add bpy_panel_wrap.cCampbell Barton
2009-04-012.5: Temporary compile fix. Campbell, bpy_panel_wrap.c seems to be missing.Brecht Van Lommel
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-29missed PyLong_FromSize_t -> PyLong_FromSsize_t in bpy_ui.cCampbell Barton
2009-03-29- python api was returning incorrect int values from rna because it was ↵Campbell Barton
using PyLong_FromSize_t rather than PyLong_FromSsize_t, this messed up the default values in documentation. - renamed POSE_OT_select_hierarchy "add_to_sel" property to "extend" - some property names were wrong (giving errors in the console at startup)
2009-03-262.5: Remove OOPS code from the outliner space, as discussedBrecht Van Lommel
this can be brought back as a new space if someone decides to work on it. This also fixes remaining issues with the outliner tree open and close buttons not working sometimes.
2009-03-23Python:Brecht Van Lommel
* Fix for not printing syntax error when running script from the text editor, and crash on exit. Campbell, please check if this is OK?
2009-03-23PythonBrecht Van Lommel
* Add support for setting RNA pointers. * Fix __repr__ for structs and properties, it was printing a garbage string here, but not sure I did what was intended.
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-202.5Ton Roosendaal
Makes older python's compile.
2009-03-202.5 compiles again with scons. Commented out some lines referring to code in ↵Joshua Leung
the missing file rna_context.c
2009-03-19ContextBrecht Van Lommel
* Made it based on string lookups rather than fixed enum, to make it extensible by python scripts. * Context callbacks now also have to specify RNA type when returning pointers or collections. For non-RNA wrapped data, UnknownType can be used. * RNA wrapped context. The WM entries are fixed, for data context only main and scene are defined properties. Other data entries have to be dynamically looked up. * I've added some special code in python for the dynamic context lookups. Tried to hide it behind RNA but didn't find a clean way to do it yet. Still unused/untested. * Also minor fix for warning about propertional edit property in transform code, and fix for usage of operator poll with checking if it was NULL.
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-182.50: some warning fixes.Brecht Van Lommel
2009-03-16failed building with python 2.5 and olderCampbell Barton
2009-03-162.5 PyAPICampbell Barton
Support for subclassing blenders operator, to be registered as a new operator. Still need to... * add constants like Operator.FINISHED * wrap context (with rna?) * poll() cant work right now because there is no way to access the operatorType that holds the python class. * Only float, int and bool properties can be added so far. working example operator. http://wiki.blender.org/index.php/BlenderDev/Blender2.5/WinterCamp/TechnicalDesign#Operator_Example_Code
2009-03-152.5Andrea Weikert
fix compile error with python on MSVC.
2009-03-14return operators as a PyCFunction rather then having our own callable ↵Campbell Barton
operator type
2009-03-132.5: UI Layout Engine, initial code.Brecht Van Lommel
* As a test, used by: * Object buttons, tried to make it match the mockup. * Text window header. * Text window properties panel. * Panel interaction with view2d is still problematic, need to make this work properly still. * Templates are very basic, the ones there are simple but already can follow the object buttons mockup quite closely. * It's based on a three level system: panels, templates and items. To get an idea of what that means in practice, see: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/UI_LayoutEngine#Panels.2C_Templates_and_Items
2009-03-132.5 Python apiCampbell Barton
- rearranged modules bpyui -> bpy.ui, bpy -> bpy.data, remove bpydoc - new module bpy.types, stores a list of all struct types - added __rna__ attribute to types - eg bpy.types.World.__rna__ so you can access the rna data from a type. (so bpydoc.structs isnt needed anymore) - removed unused subtyping method (use python subclassing rather then C PyTypeObject)
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-07added python api function to register an operator into a keymapCampbell Barton
example... bpyui.registerKey( C, bpyui.spaceTypes.SEQ, 0, "Sequencer", "SEQUENCER_OT_view_selected", bpyui.keyTypes.A, bpyui.keyValTypes.PRESS, 0,0, {}) May want to split this into multiple functions.
2009-03-05small commit to allow bpy_operator.c to compile in msvcShaul Kedem
2009-03-05PyRNA API: some RNA types were crashing on looping, also return None rather ↵Campbell Barton
then an RNA struct when the ptr->data is NULL
2009-03-05Make RNA an Operator dir() work in py 2.5 - 3.0Campbell Barton
removed epy docstrings from RNA python api, since Python can get this info from rna. (could be redone in python if getting doc's on RNA is needed) epy_doc_gen works again
2009-03-052.5 / PyRNANathan Letwory
* a collection of small changes after review together with Campbell.
2009-03-04run script in the text editor is back. UI scripts dont work yet.Campbell Barton
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-282.5 \ Python APINathan Letwory
* put back #if PY_VERSION_HEX check again, so we without Python 3.0 can still compile - Campbell, please don't remove it again, ok?
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-27Restore the #if around the ui_module declaration, this made compiled failDiego Borghetti
with python 2.5 (< 3.0).
2009-02-27added defAutoButR() and blockSetFlag() and some flags for the experimental ↵Campbell Barton
python UI, which just wraps C the functions.
2009-02-26update to build with python 3.0.1 which removed Py_InitModule3, added ↵Campbell Barton
richcompare functions to the operator api.
2009-02-16WIP, low level python UI functions, so far tested popup menu to work with ↵Campbell Barton
bpyui.pupMenuBegin, menuItemO and pupMenuEnd functions. And a popup block with python callback with bpyui.pupBlock, beginBlock, popupBoundsBlock and endBlock funcions. These functions should not be accessed by scripters directly.
2009-02-12* Added description string to operator types, should be set along with ↵Campbell Barton
ot->idname when defining ops. * User interface uses this as a tooltip when NULL or "" is given. * Python doc generation includes this description * Python defined ops take the description as an argument. * NULL check to image_ops.c, was crashing on exit when there was an image open.