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-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]
2008-11-30PyRNACampbell Barton
Can now assign RNA arrays from python lists of bools/ints/floats eg -> rna.scenes["Scene"].layer = [True] * 20 Also added exceptions when trying to set readonly properties.
2008-11-30mistake in comparing pointers. (causing memfree prints)Campbell Barton
2008-11-29PyRNA - can write variables now (float, int, bool, enums, strings - but not ↵Campbell Barton
pointers, RNA limitation too). also fixed reading enums.
2008-11-29* Fix Makefiles to compile python.Brecht Van Lommel
* Tweak SConscript priorities to link ed_util. * Added RNA_struct_is_ID function for python.
2008-11-29Python RNA APICampbell Barton
* Matches the C/RNA api structure * Thin wrapper ~(600 lines) * No functions specific to any blender object type. * Defines 2 types, BPy_StructRNA and BPy_PropertyRNA. * Python 3.0 target (compatible with python 2.4,5,6) * http://wiki.blender.org/index.php/BlenderDev/Blender2.5/PyRNA - continue docs/discussion here. Todo * Collection iterators * Write access to data * Define how constants should be accessed (as strings or some special type) * Solve the "Python keeping invalid blender pointers" problem. This cant just be solved in the py api - we need blender to notify when ID's are removed Examples Here are some examples that work with the current implementation of the api. rna.lamps["Lamp.006"].energy -> (1.0) rna.lamps["Lamp.007"].shadow -> ("NOSHADOW") rna.materials.keys() -> ['flyingsquirrel_eye', 'frankie_skin', 'frankie_theeth'] rna.scenes["hud"].objects["num_text_p2_4"].data.novnormalflip -> False rna.meshes["mymesh"].uv_layers.keys() -> ['UVTex', 'UVTex'] rna.meshes.items() For a dump of yo-frankie level see - http://pasteall.org/3294/python Notes * Added python back, can only execute scripts from the command line with -P script.py * bpy_interface.c is just enough functionality to run a python file.
2008-11-13Merge of trunk into blender 2.5:Brecht Van Lommel
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416 Issues: * GHOST/X11 had conflicting changes. Some code was added in 2.5, which was later added in trunk also, but reverted partially, specifically revision 16683. I have left out this reversion in the 2.5 branch since I think it is needed there. http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683 * Scons had various conflicting changes, I decided to go with trunk version for everything except priorities and some library renaming. * In creator.c, there were various fixes and fixes for fixes related to the -w -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done differently. Since this is changed so much, and I don't think those fixes would be needed in 2.5, I've left them out. * Also in creator.c: there was code for a python bugfix where the screen was not initialized when running with -P. The code that initializes the screen there I had to disable, that can't work in 2.5 anymore but left it commented as a reminder. Further I had to disable some new function calls. using src/ and python/, as was done already in this branch, disabled function calls: * bpath.c: error reporting * BME_conversions.c: editmesh conversion functions. * SHD_dynamic: disabled almost completely, there is no python/. * KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled. * text.c: clipboard copy call. * object.c: OB_SUPPORT_MATERIAL. * DerivedMesh.c and subsurf_ccg, stipple_quarttone. Still to be done: * Go over files and functions that were moved to a different location but could still use changes that were done in trunk.
2008-11-08* typo fixNathan Letwory
2008-11-08=== BPy API ===Nathan Letwory
* add two optional arguments to control click step and precision of Number buttons.
2008-11-07[#17958] Windows path fix for image_edit.py script.Campbell Barton
Modified to work in linux too, on my system subprocess.Popen(appstring) only works when appstring is a list. Blenders __import__ didnt support keywords like pythons causing the subprocess module to fail for me. added keywords to blenders c/api import to match pythons.
2008-11-02Bugfix #17942Ton Roosendaal
Python dict error: when trying to access a Bone via a key, and the key was not found, a wrong error message got printed. Fix provided by reporter Gregor Riepl. Thanks!
2008-11-01fix a bug in matrix.invert() for 2x2 matricesRemigiusz Fiedler
reported by Hans in http://blenderartists.org/forum/showthread.php?t=139748
2008-10-30* Build aborts when giving options on command-line when WITH_BF_DOCS=TrueNathan Letwory
- make sure epydoc generation doesn't get a fit over options given on scons command-line -> don't use arguments from command-line.
2008-10-28bpy access to image premul was missing.Campbell Barton
2008-10-28Python APIKen Hughes
---------- Bugfix #17911: Mesh.getFromObject() incorrectly decremented the mesh's material user refcount when the material was linked to the object.
2008-10-27face transp option CLIP wasnt added to the py api.Campbell Barton
added gameObject.replaceMesh(meshname) - needed this for an automatically generated scene where 100's of objects would have needed logic bricks automatically added. Quicker to run replace mesh on all of them from 1 script.