Age | Commit message (Collapse) | Author |
|
|
|
- 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.
|
|
- minor cleanup for Py/C api functions that define rna properties from python.
|
|
were not always called causing bugs).
fix for a leak when trying to run a text with a syntax error too.
|
|
also fixed smoke comparing a float's mem-location rather then its value.
|
|
you can copy operator strings from buttons or the reporting interface and run them in the console.
- Ctrl+C over an operator button copies its python string to the clipboard.
- Paste in the console (1 line only for now).
- operators run from python no longer require all arguments.
|
|
- returned ID types from RNA funcs didnt get their ID's assigned which crashed in some cases (still not working for members of ID types).
- ob.create_remder_mesh() wasnt assigning any materials.
|
|
if 0'd the exec() workaround for running python scripts incase windows devs want to test.
theeth said the problem is when you compile a debug blender against a non debug python (or the ther way I assume), you can get a FILE struct mismatch.
A quick way to test this on windows is to run this from the command line.
blender -P somescript.py
Somescript.py can be anything
|
|
- 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.
|
|
calling rna functions with the wrong argument type would raise an error like..
expected a string type
Added an error prefix so now the message is..
TypeError: UILayout.item_enumO(): error with argument 3, "value" - expected a string type
|
|
|
|
supports packing the function args into a string.
|
|
useful later.
removed a check in exotic.c that should be added back later.
|
|
they were not working and we have plans for better script integration in 2.5
|
|
* ID blocks can now get RNA properties defined from python, e.g.:
bpy.types.Scene.BoolProperty(..)
* RNA structs/functions/properties can now get pointers duplicated
(mostly strings), since we can't point to some static string then.
* Added ExtensionRNA struct to add into *Type structs for subclassing,
is a bit more compact than defining the 4 variables each time.
Only disadvantage is it requires including RNA in more places.
|
|
|
|
set PYTHONHOME as well as PYTHONPATH, quiets some warnings.
|
|
|
|
|
|
bpy_interface.c - change order of checking scripts to avoid calling stat on .py files.
|
|
|
|
containing an __init__.py)
- BLI_add_slash returns the new string length.
- BLI_where_am_i() would often have /./ in the path (not incorrect but annoying, got into python exceptions)
- release/ui/space_image.py, py error referencing invalid keyword args.
|
|
* Moved brush NKEY panel from C to Python. Could use some UI review :)
* Added a NULL check in bpy_internal_import.c, was crashing here on Python errors
* Added RNA for vpaint brush and for weight paint
* Added context for vpaint/wpaint similar to edit_object and sculpt_object
|
|
- 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
|
|
causing end of array corruption errors when running operators that took bool array options - transform.
|
|
* 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
|
|
|
|
-> some.operator
this works for the calling operators from python and using the RNA api.
bpy.ops.CONSOLE_exec() is now bpy.ops.console.exec()
eg.
split.itemO("PARTICLE_OT_editable_set", text="Free Edit") becomes... split.itemO("particle.editable_set", text="Free Edit")
For now any operator thats called checks if its missing _OT_ and assumes its python syntax and converts it before doing the lookup.
bpy.ops is a python class in release/ui/bpy_ops.py which does the fake submodules and conversion, the C operator api is at bpy.__ops__
personally Id still rather rename C id-names not to contain the _OT_ text which would avoid the conversion, its called a lot since the UI has to convert the operators.
|
|
Calling rna functions with invalid keywords, too many keywords and too many args would fail silently
- now raise an error with invalid keywords and a list of valid ones, raise an error when too many args are given.
- calling rna functions would alloc a ParameterList each time, changed to use a stack variable (2 pointers and an int).
- store the number of parameters ParameterList
- python exception types were wrong in many cases, (using attribute error rather then type error)
- fixes to small errors in python UI scripts.
|
|
* ensure all SConscripts are ready for win64-vc (where necessary).
* ensure we have proper _DEBUG flag for Python when we're doing a debug build.
* some cleaning up of linking etc.
* ensure /EHsc is there for game engine modules.
|
|
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 :)
|
|
* interactive console python console.
* display reports and filter types. defaults to operator display so you can see the python commands for tools as you use them,
eventually it should be possible to select commands and make macto/tools from them.
Example use of autocomp. b<tab>, bpy.<tab>, bpy.<tab>, bpy.data.<tab> etc.
basic instructions are printed when opening the console.
Details...
* Console exec and autocomp are done with operators written in python.
* added CTX_wm_reports() to get the global report list.
* The window manager had a report ListBase but reports have their own struct, switched to allocate and assign when initializing the WM since the type is not available in DNA.
* changed report types flags for easier display filtering.
* added report type RPT_OPERATOR
* logging operators also adds a python-syntax report into CTX_wm_reports() so they can be displayed in the console as well as calling a notifier for console to redraw.
* RnaAPI context.area.tag_redraw() to redraw the current area from a python operator.
Todo...
* better interactions with the console, scrolling, copy/paste.
* the text displayed doesnt load back.
* colors need to be themed.
* scroll limit needs to be a user pref.
* only tested with cmake and scons.
|
|
* support for dynamic enums to be inspected enumProp.items() from python.
* fix, enums check for a separator was flipped, meant no enums were in docs.
* dynamic enum functions now check for a NULL context and return all possible options for the "items" attribute used for docs.
* added an arg for rna arrays to free the array there looping over (needed to free dynamically allocated enum items)
* python api checks for NULL items since this can happen in some cases.
* python api, When getting an enum ID from an int in an array - If it failed it would get the first enum identifier and return that. Brecht? dont understand, making it return an empty string in these cases.
|
|
Now with KX_Python.h line 35 commented YoFrankie 1.1 should run unmodified in blender2.5
|
|
error value.
brecht, switched the order back to fix this, added an argument for WM_operatortype_find() to fail without printing an error.
|
|
* refcount error if StringIO or io modules could not be imported
* importing python modules like math didnt work because the script registration overwrote the script path. now just prepend the path.
|
|
* Enums can now be dynamically created in the _itemf callback,
using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
for operators. This doesn't fit design well at all, needed to do
some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
_itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
(unselected, deselect), to make them consistent with other ops.
|
|
This means checks like this work.
isinstance(bpy.data.meshes[0], bpy.types.ID)
bpy.types.Mesh.__base__ == bpy.types.ID
|
|
Now this will return True
isinstance(bpy.data.meshes[0], bpy.types.Mesh)
Use the StructRNA identifier for the new classes name properties because classes were being named by the data names rather then the type names.
Set the __module__ for the new type which makes printing the class not use the script name where the type is first initialized.
eg: bpy.types.Mesh instead of buttons_object.Mesh
This still isnt quite right since opertators and panels all get their own type, when they should all use an operator type.
|
|
Monthly cleaning round to make it compile warning free.
Mostly it was const stuff (strings, Context), but also
a couple useful fixes, like wrong use of temp pointers.
Only Mathutils callback struct I left alone... design issue.
|
|
eg..
mesh = bpy.data.meshes.get("SomeMesh", fallback)
Set length limits for python string formatting.
|
|
Brecht, double checked and pyc or pyo files arent used because of the (file_extension[3] == '\0') test.
|
|
* 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.
|
|
Copied some Python compat stuff to get py 2.3 running... just
googled for it on python.org mailing list.
|
|
* PyRNA - id_struct.keyframe_insert("path", index, frame)
|
|
* Fix crash in python with enum properties, and don't throw
error if no matching identifier is found. This shouldn't
happen, but it should break a python script either, which
is not at fault.
* Fix a wrong variable initialization in fluidsim.
|
|
Windows #ifdef code missed semicolon.
|
|
|
|
This lets us distribute blender with our own python module directory (next to ui and io), and avoids the need for a shell script to start blender.
|
|
modules with blender, #if 0'd for now but having it is useful for testing.
This works by copying /usr/lib/python3.1 to a dir called "python", next to blenders "ui" and "io" dirs.
|