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-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-08compiler fix part 1Joseph Eagar
[[Split portion of a mixed commit.]]
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-162.5Joshua Leung
Added RNA wrapping for F-Curve colour settings
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.
2009-02-02RNA: C APIBrecht Van Lommel
* RNA_blender.h is now generated along with the other files. It is not used anywhere yet, and still located quite hidden next to the other rna_*_gen.c files. Read only access for now. * Inherited properties are not copied from the base anymore but iterated over. Patch by Vekoon, thanks! * Array get/set callbacks now do the whole array instead of getting an index. This is needed for some layers for example so python can set the array as a whole, otherwise the check that one layer has to be enabled at all times gets in the way. Also nicer for the C API. * Also some changes to returning pointers to make the API cleaner, got rid of the type() callback and instead let get() return PointerRNA with the type included. The C API looks like this currently: http://users.pandora.be/blendix/RNA_blender.h
2009-01-29include Py_CmpToRich for python versions lower then 3Campbell Barton
2009-01-29python3 couldn't generate epydocs because python3 needs richcompare ↵Campbell Barton
functions for C defined PyTypes (it seems).
2009-01-232.5: multiple small fixesBrecht Van Lommel
- wm draw method is now initialized correct when reading older files, but the SDNA bug causing the problem is still unsolved. is due to // char pad[8]; not being recognized as commented. - triple buffer proxy texture test follows spec better now, was disabling triple buffer unnecessarily on some drivers. - some cmake compile fixes related to sequencer pthread usage and removed bad level calls lib for player. - show outliner header buttons in oops mode as well until that can be switched in the UI. - fix region data free issue for tooltips - warning fixes
2009-01-21basic transform for sequencer stripsCampbell Barton
can transform the strips or move their handles Still todo, click-drag transform, metastrips support, snapping, markers overlap checks and constrain to valid channels.
2009-01-18Changes to functions from blender/windowmanager/intern/wm_event_system.cCampbell Barton
Python operator api was using WM_operator_name_call() which was confusing things too much. Added WM_operator_call_py() which ended up being a very small function and split out operator creation into wm_operator_create() Python operator now runs the poll() function and raises an error if it fails. Eventually there should be error messages for poll that python can use to give the exact reason for failing (eg - library linked data, no active object...)
2009-01-11RNABrecht Van Lommel
* Finished DNA_lamp_types.h, DNA_world_types.h and DNA_sound_types.h. * Renamed "parent" struct property to "nested", and also remaining "from" usage to "base". * Added a NEVER_NULL subtype for pointers and use it for all properties that apply. * Make sure all structs have a description, and fix any other DOC_BROKEN descriptions, also many other naming consistency improvements.
2009-01-102.5Ton Roosendaal
Instead of many commits, here 1! - Constraint edit code back - Removed XXX stubs for constraints (make parent follow path works) - Removed XXX stubs for armature (make parent deform, do center, etc works) - Found a bad uninitialized global Scene * in code, especially in kernel it wreaked havoc. - added missing include in blenkernel/brush.c - fixed Nicholas' fix for editmode subsurf crash (It needed to check for editmode)
2009-01-09added rna property "parent" so nested RNA structs can access their parent ↵Campbell Barton
RNA struct This is used for generating docs so a nested RNA struct such as MaterialRaytraceTransparency are listed under Material rather then in the global struct list) These RNA structs are used for grouping properties and don't correspond to a C structure.
2009-01-08RNA: fix crash in python code, forgot to update this part in a previous commit.Brecht Van Lommel
2009-01-052.5Ton Roosendaal
Cleanup: - Makefile was using confused link order, now all intern and and extern libs are put after blender and editor libs - Old stubs.c in editors/screen removed. The leftover python stubs calls were moved to python module.
2009-01-042.5 / CleanupNathan Letwory
- remove Verse support. This will be brought back in The Future (probably jiri + me) This means 5k lines less in blenkernel. - fix two small errors for global cleanup, now compiles properly with FFMPEG enabled too.
2009-01-02python support for reporting with operators.Campbell Barton
* errors in python called operators are raised as errors * Python defined operators errors are reported as errors (not full traceback yet) * added BKE_reports_string, same as BKE_reports_print but it returns a string rather then printing it. * WM_operator_name_call optionally takes an initialized report struct
2009-01-01RNABrecht Van Lommel
* Object has some more properties wrapped, mostly game related. * Scene frame changes now send a notifier. * Added functions to create/free operator properties for calling operators. This also simplifies some duplicated code that did this. Ideally though this kind of thing should use the properties pointer provided by buttons and keymap items. Example code: PointerRNA ptr; WM_operator_properties_create(&ptr, "SOME_OT_name"); RNA_int_set(&ptr, "value", 42); WM_operator_name_call(C, "SOME_OT_name", WM_OP_EXEC_DEFAULT, &ptr); WM_operator_properties_free(&ptr);
2008-12-31Added some more directory includes for CMake.Nicholas Bishop
2008-12-302.5Nathan Letwory
* make bpy compile with msvc again. The forward declaration of the array with no length was a problem. Instead, I switched the tables and made the function a forward declaration.
2008-12-29* was using __members__ to get a list of attributes, has been deprecated in ↵Campbell Barton
python for a while now. use a "__dir__" method instead. now dir() works for rna and operator types. * added array support for bpyoperator doc generation
2008-12-29added RNA access to operators pointers to be documented with epy_doc_gen.py.Campbell Barton
eg: print (bpyoperator.VIEW3D_OT_viewnumpad.rna.__members__) docs for bpyoperator http://www.graphicall.org/ftp/ideasman42/html/bpyoperator-module.html
2008-12-28minor changes and error checking.Campbell Barton
tested first PyOperator, basics work now, invoke/exec can be used to make an operator that edits RNA or calls other operators.
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)
2008-12-27* converting operator props to strings was using a float as in int.Campbell Barton
* PyOperators were always calling the python functions with default args. * Made operator prints only happen when G.f & G_DEBUG is enabled.
2008-12-27python operators (in bpy_opwrapper.*)Campbell Barton
This means you can define an operator in python that is called from C or Python - like any other operator. Python functions for invoke and exec can be registered with an operator name. keywords are read from the python exec() function, then used to create operator properties. The default python values are used to set the property type and defaults. def exec(size=2.0, text="blah"): ... is equivalent to... prop = RNA_def_property(ot->srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_default(prop, 2.0f); prop = RNA_def_property(ot->srna, "size", PROP_STRING, PROP_NONE); RNA_def_property_string_default(prop, "blah"); TODO - * make use of events * return OPERATOR_CANCELLED/OPERATOR_FINISHED.. etc * add support for array args * more testing
2008-12-27run python when starting blender like 2.4x does (was start/stopping python ↵Campbell Barton
for each script before) This way python can call the operator to run other scripts eg... bpyoperator.SCRIPT_OT_run_pyfile(filename = "myop.py")
2008-12-26* Added bSound to rna (still need to do bSample and bSoundListener structs)Campbell Barton
* rna epy doc-gen was failing when trying to sort None
2008-12-26removed ED_ prefix from script operator.Campbell Barton
python operator api was crashing when unknown operators were called.
2008-12-262.5Ton Roosendaal
Operator calls: extended WM_operator_name_call() with options whether to call the exec() (operate immediate) or invoke() (check user input) entry. This will allow python to use it more efficiently, but also solves the dreaded pulldown case that showed another menu for confirmation. New names to learn: :) WM_OP_EXEC_DEFAULT WM_OP_INVOKE_DEFAULT on todo still: allow hotkey definitions to do same.
2008-12-25* temporary PKey in the script and 3D view runs "./test.py" (for testing ↵Campbell Barton
PyOperators that need to run in the user interface context atm) * added ED_SCRIPT_OT_run_pyfile that takes a filename argument. * RNA_property_string_set didn't add a value to ID props if the prop wasnt there (like ints, floats and bools do) * bpy_operator.c - raise an error when unknown keyword args are passed to any operator . Examples of bpy operator api... bpyoperator.ED_VIEW3D_OT_viewhome(center=1) bpyoperator.ED_SCR_OT_frame_offset(delta=10) bpyoperator.ED_VIEW3D_OT_make_parent(type='OBJECT') At the moment there is no way to stop the operators .invoke() function from running so ED_VIEW3D_OT_make_parent still opens the menu even though it doesn't need to.
2008-12-25* PyOperators now parse args using the PyRNA api (wraps ID props internally), Campbell Barton
this means it can reuse the function for converting python to RNA types - giving more useful errors. * Incorrect enum args lists valid values in their exception message (used for PyRNA and PyOperators). * remove bpy_idprop.c and bpy_idprop.h PyOperators are not usable since they run outside the UI loop atm.