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-02-12correct fsf addressCampbell Barton
2010-01-19patch [#20724] Randomize Loc Rot Size py operator for B2.5Campbell Barton
written from scratch by Daniel Salazar (zanqdo). added own modifications. New property type bpy.props.FloatVectorProperty(), only difference with float is it takes a 'size' argument and optional 'default' sequence of floats. moved bpy.props.* functions out of bpy_rna.c into their own C file.
2010-01-16generic operator menu was searching for "type" and using the first enum ↵Campbell Barton
property if it wasnt found. this is too arbitrary and could break if roperty order is changed. store the property in the operator type that is to be used for menu and enum search func's. python function for searching operator enums on invoke. (just need dynamic python enums now) wm.invoke_search_popup(self)
2010-01-16remove duplicate code from operator/macro initializationCampbell Barton
2009-12-31remove python api cruft from custom operator registrationCampbell Barton
2009-12-31Macro registration using the normal rna registration methods (like operators).Martin Poirier
bpy.types.register(MacroClass) instead of bpy.ops.add_macro(MacroClass) The rest is unchanged. Also remove some now unused code for the old registration methods (there's still some remaining).
2009-12-30python macro operators didnt have a compatible draw function assigned. also ↵Campbell Barton
remove duplicate define.
2009-12-24* register operators like other classesCampbell Barton
* operators now return sets (converted into flags) * can't remove bpy_operator_wrap.c since macro's still use the custom register funcs
2009-12-05Support for the C Macro system in Python.Martin Poirier
Basic definition works like a python operator but you derive from "bpy.types.Macro" instead. Operators are added to the macro after it has been added with "bpy.ops.add_macro" through the class method "define" which takes an operator id and returns an OperatorMacroType (new RNA type) for which properties can then be defined to be passed to the operator when run. Example: http://blenderartists.org/~theeth/bf/macro.py Using this system, it should be easy to add an operator to the console that converts selected lines into a macro or even a more generic record macro system.
2009-11-29- access to a nurbs points was broken - sizeof(BPoint) vs sizeof(BPoint *) Campbell Barton
- renamed CurvePoint --> SplinePoint - renamed point.point --> point.co (less stupid, matches vertex.co) - access point.co was a 3D vector rather then a 4D vector with the Nurbs weight included. - rename point.weight --> point.weight_softbody, move point.point[3] --> point.weight - sorted RNA structs (for pedaticness only)
2009-11-29Draw function for operators (just like panels), used for the redo popup, ↵Campbell Barton
file selector and redo tool panel. Used for ply export & select pattern.
2009-11-23fixed some error reporting issues with calling operatorsCampbell Barton
2009-11-20use a metaclass to have operator attributes register and display in the ↵Campbell Barton
order defined.
2009-11-19operators were copying the properties from the rna operator into the class ↵Campbell Barton
instance. however this meant the invoke function could not modify properties for exec to use (unless it called exec directly after) since the popup for eg would re-instance the python class each time. now use the operator properties directly through rna without an automatic copy. now an operator attribute is accessed like this... self.path --> self.properties.path
2009-11-19added 'hidden' option for python defined rna props, means py operators can ↵Campbell Barton
use hidden properties so the popup wont show improved error message when bad args are given to propertyRNA funcs
2009-11-13arbitrary property and function support for rna properties (arrays and ↵Campbell Barton
collections), this means functions can be easily added. eg. scene.objects.link() object.constraints.new() mesh.verts.transform(...) mesh.faces.active PropertyRNA stores an StructRNA pointer where these can be defined.
2009-11-13F8 reload works again, script errors are printed but dont stop loading every ↵Campbell Barton
other script
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-11-02make python operator instances subclasses of the wmOperator when called.Campbell Barton
was subclassing the operator's type before. Removes the need for passing self.__operator__, can pass self directly.
2009-11-02last commit broke running python operatorsCampbell Barton
note that you can still set rna properties like this. bpy.data.__dict__["var"] = 1 print(bpy.data.var) but this is only stored for the python objects lifetime and not actually attached to blenders data
2009-10-31define operator properties in the class, similar to django fieldsCampbell Barton
# Before [ bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""), bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True), bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True), bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True), bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True) ] # After path = StringProperty(attr="", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "") use_modifiers = BoolProperty(attr="", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True) use_normals = BoolProperty(attr="", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True) use_uvs = BoolProperty(attr="", name="Export UVs", description="Exort the active UV layer", default= True) use_colors = BoolProperty(attr="", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
2009-10-31change blender python interface for classes not to ise __idname__ rather ↵Campbell Barton
bl_idname since __somename__ is for pythons internal use. replacements... "__idname__" -> "bl_idname" "__props__" -> "bl_props" "__label__" -> "bl_label" "__register__" -> "bl_register" "__undo__" -> "bl_undo" "__space_type__" -> "bl_space_type" "__default_closed__" -> "bl_default_closed" "__region_type__" -> "bl_region_type" "__context__" -> "bl_context" "__show_header__" -> "bl_show_header" "__URL__" -> "_url"
2009-10-11- add torus back from 2.4x as an operatorCampbell Barton
bpy.ops.mesh.primitive_torus_add(major_radius=1, minor_radius=0.25, major_segments=48, minor_segments=16) - experemental dynamic menus, used for INFO_MT_file, INFO_MT_file_import, INFO_MT_file_export and INFO_MT_mesh_add. these can have items added from python. eg. - removed OBJECT_OT_mesh_add, use the python add menu instead. - made mesh primitive ops - MESH_OT_primitive_plane_add, ...cube_add, etc. work in object mode. - RNA scene.active_object wrapped - bugfix [#19466] 2.5: Tweak menu only available for mesh objects added within Edit Mode ED_object_exit_editmode was always doing an undo push, made this optional using the existing flag - EM_DO_UNDO, called everywhere except when adding primitives.
2009-10-08- object.selected is now editable (uses update function to flag the scene base)Campbell Barton
- editing properties from python wasnt running their update function. - missing commas made dir(context) give joined strings. - added __undo__ as an operator class attribute so python ops can be set as undoable. (like existing __register__)
2009-09-182.5: Python operators now have a working poll() function,Brecht Van Lommel
solved by wrapping all polling in WM_operator_poll and adding a special callback for python.
2009-09-04- rna documentation layout now matches blenders internal layout, ↵Campbell Barton
autogenerate packages for nested modules. bpy.data, bpy.ops.object etc. - added basic docs for bpy.props - omit panel, menu and operator classes (took up too much space and not useful) - exec cant be used as an operator suffix eg- CONSOLE_OT_exec --> CONSOLE_OT_execute (same for file) - fixed some crashes when generating docs Updated docs here http://www.graphicall.org/ftp/ideasman42/html/
2009-08-10remove python2.x supportCampbell Barton
2009-08-09- fix error in last commitCampbell Barton
- added better error feedback when registering operators fails. - added some python benchmark timers (prints on exit), times number of times py scripts run, average time and total % of time running py scripts.
2009-08-07bpy_context_set and bpy_context_clear to replace a number of functions (some ↵Campbell Barton
were not always called causing bugs). fix for a leak when trying to run a text with a syntax error too.
2009-07-26misc py/rna changesCampbell Barton
- running a script from a file now uses the PyRun_File(FILE *, ...) rather then PyRun_String("exec(open(r'/somepath.py').read())"...), aparently FILE struct on windows could not ensured to be the same between blender and python, since we use our own python on windows now it should be ok. - generating docs works again (operator update for py style syntax broke them) - python operator doc strings was being overwritten - added rna property attribute "default" to get the default value of a property, not working on arrays currently because variable length arrays are not supported.
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-18fixes for errors on startup and compiler errors and draw speedup.Campbell Barton
* Drawing the console text now skips all lines outside the view bounds. * Added dummy C operators for console.exec and console.autocomplete so blender wont complain at startup, its not really a problem but people testing reported it a few times. Eventually we should have some way python operators are initialized before the spaces operators are checked. * reordered the imports so the "ui" dir is imported before "io", for now this means bpy.ops is defined before exporters and importers need to use it, was causing a python error on startup. * fixed all compiler warnings for the console (gcc4.4) * stopped operators were printing out the return flag. * removed references to ACT_OT_test, TEXT_OT_console_exec and TEXT_OT_console_autocomplete
2009-07-16- use outliner colors (with subtle stripes) for report so you can see ↵Campbell Barton
divisions between operators with wrapping. - added class option for PyOperators __register__ so you can set if py operators are logged in the console. - PyOperators was refcounting in a more readable but incorrect way. in some cases would be possible to crash so better not drop the reference before using the value. - console zoom operator was registering which meant zooming in to see some text would push it away :)
2009-07-092.5: Mesh and Various FixesBrecht Van Lommel
* 3D view Mesh menu works again, but incomplete. * Add Properties and Toolbar to 3D View menu. * Added "specials" menus back, vertex/edge/face and general. * Various fixes in existing mesh operators, some were not working. * Add MESH_OT_merge. * Merge all subdivide ops into MESH_OT_subdivide, subdivide code changes to make smooth + multi give good results. * Rename all select inverse ops to *_OT_select_inverse. * Fix "search for unknown operator" prints at startup, and some warnings in py code. * Don't run .pyc files on startup. * Remove unused image window header C code.
2009-06-302.5Brecht Van Lommel
Image Window * Unpack operator now works. * Some small layout code tweaks. Info Window Header * Moved to python UI code. * template_running_jobs, template_operator_search added. * Ported external data operators: pack/unpack all, make paths relative/absolute, find/report missing files. Also * Report RPT_INFO too, not only warnings and errors. * Run UI handle functions after RNA and Operators. * Rename particle system add/remove operators, to not include "slot", that's only there for materials because that's what they are called now in RNA.
2009-06-252.5: File Selector: display operator properties in the side region,Brecht Van Lommel
check Save Image or Export PLY operator for example. Also these code changes: * Added some RNA collection iterator macros to simplify code. * Fix bpy.props.BoolProperty not working correct. * Merge uiDefAutoButsRNA/uiDefAutoButsRNA_single into one.
2009-06-21RNA read-only wrapped wmEvent so python operators invoke functionsCampbell Barton
* 2 new enums event_value_items and event_type_items in RNA_enum_types.h * WM_key_event_string now uses an RNA enum lookup rather then its own switch statement. * moved wmEvent from WM_types.h into DNA_windowmanager_types.h * added RNA_enum_identifier and RNA_enum_name to get strings from an enum value.
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-06-13convert non-string pyoperator exceptions into strings if they are not already.Campbell Barton
2009-06-06Merged code passing context to python operator from soc-2009-kazanbas Arystanbek Dyussenov
branch.
2009-06-05PyRNACampbell Barton
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/) - Operators can now take collection args when called from python. - Support for printing operators that use collections (macro recording). - Added RNA_pointer_as_string which prints all pointer prop values as a python dict. Example that can run in the in test.py (F7 key) bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT') for some reason lasso locations always print as 0,0. Need to look into why this is.
2009-05-20RNA: ID properties were not being shown as RNA properties anymore, fixed.Brecht Van Lommel
Python: fix two warnings (initialize to NULL).
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-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-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.