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-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.
2008-12-242.5Ton Roosendaal
Fix: popup menus were not freeing operators. Made a new Popup menu call for this case: uiPupmenuOperator(C, maxrow, op, propname, menustr); It will set enum "propname" to the menu item and call operator, register it optionally and free it. Use it in "invoke" calls. Next: automatic menu generating for enum properties!
2008-12-242.5 / SConsNathan Letwory
New priorities for most libs, at least core. This is still for Blender proper, BGE and such still to come.
2008-12-21Adding back python 3.0 calls, they didn't build with py2.x because I missed ↵Campbell Barton
including bpy_compat.h, tested building with 2.6
2008-12-212.5Ton Roosendaal
New Python code: Fixes for Makefile and compat hacks for py 2.3 Campbell should check though!
2008-12-212.5 - Compiling 'hacks' for pyJoshua Leung
* Unicode calls in bpy_idprop.c were causing linking errors here. Probably Py-libs for windows would need recompiling with unicode before we can enable this. For now, commented out the offending calls.
2008-12-21wip operator py-apiCampbell Barton
"operator.ED_VIEW3D_OT_viewhome(center=1)" calls the operator, converting keyword args to properties. Need a way to run scripts in the UI for useful testing. Still need to deal with operator exceptions and verifying args against operator options. Added temporary WM_operatortype_first() to allow python to return a list if available operators, can replace this with something better later (operator iterator?)
2008-12-19string args were given in wrong order.Campbell Barton
2008-12-19epy doc generator that runs inside blender2.5, in background mode.Campbell Barton
Automatic support for... * cross references to struct types * extracts descriptions/names * RNA "base" types are converted to python subclasses * number min/max, string max length, array's, array lengths, valid enum types, readonly flag. interesting pages (abusing autobuilder ftp :/) http://www.graphicall.org/builds/builds/autobuilds/rna/class-tree.html http://www.graphicall.org/builds/builds/autobuilds/rna/rna.Sequence-class.html http://www.graphicall.org/builds/builds/autobuilds/rna/identifier-index.html docs are generated in source/blender/python/doc
2008-12-16Added "bpydoc" to the global namespace of python scripts, making ↵Campbell Barton
documentation available no matter what data is open in the current blend file, Directory type was also missing from the subtype enum causing the test rna-dump script to fail.
2008-12-12started whiping cmake into shape for 2.5 still need to figure outKent Mein
the rna stuff but its close. Need to get it working for blender then copy over same to game engine. Kent
2008-12-02Made PyRNA props iterable, so you can do things like...Campbell Barton
for ob in bpy.objects: print(ob.name) for i, lay in bpy.scenes["Scene"].layer: print('%d %d' % i, lay)
2008-12-02Added RNA functions from PyRNACampbell Barton
* RNA_property_enum_value * RNA_property_enum_identifier To get an enum string from a value and a value from an enum. BPy_StructRNA types (objects, meshes, images etc) can now be used as dictionary keys.
2008-12-02mingw was giving errors...Campbell Barton
source\blender\python\intern\bpy_rna.c:1018: error: initializer element is not constant source\blender\python\intern\bpy_rna.c:1018: error: (near initialization for `pyrna_prop_Type.tp_get Assign get generic get/sets before PyType_Ready runs
2008-12-02* after discussion with cambo on IRC, change the #ifndef's to #undefs instead:Nathan Letwory
Pre-Python 3.0 has strings default non-unicode, so checks and handling should be done so too.
2008-12-02* make sure there are no redefinitions (I'm using py2.5 and ie ↵Nathan Letwory
PyUnicode_Check define exists
2008-12-01PyRNA structs and properties can now be subtyped to add functionality in python.Campbell Barton
rna_actuator.c was missing an enum
2008-11-30PyRNA epydoc style docstrings.Campbell Barton
examples... RNA Lamp: Lamp ============== @ivar rna_type: RNA type definition. *readonly* @type rna_type: PyRNA PointerProperty @ivar name: Unique datablock ID name. (22 maximum length) @type name: string @ivar adapt_thresh: Threshold for Adaptive Sampling. in (0.000, 1.000) @type adapt_thresh: float @ivar area_shape: Shape of the Area lamp @type area_shape: enum in [SQUARE, RECTANGLE] @ivar area_size: Size of the area of the Area Lamp. in (0.000, 100.000) @type area_size: float @ivar area_sizey: Size of the area of the Area Lamp. in (0.000, 100.000) @type area_sizey: float - snip RNA Object: Object ================== @ivar rna_type: RNA type definition. *readonly* @type rna_type: PyRNA PointerProperty @ivar name: Unique datablock ID name. (22 maximum length) @type name: string @ivar data: Object data. *readonly* @type data: PyRNA PointerProperty @ivar fake_user: Saves this datablock even if it has no users @type fake_user: bool @ivar library: Library file the datablock is linked from. *readonly* @type library: PyRNA PointerProperty @ivar loc: in (-inf, inf) @type loc: float[3]