Age | Commit message (Collapse) | Author |
|
|
|
errors.
eg:
- console calls operator
- operator calls report
- report went into header rather them back into the console as an error.
|
|
then importing.
|
|
|
|
and returns -1 as an error value
|
|
|
|
|
|
- rename layout.operator_enums -> operator_enum (since we have operator_menu_enum, only called in 4 places)
|
|
internal interpreter problems.
Replace most with RuntimeError.
|
|
no functionality change.
|
|
- operators which reload G.main would crash blender if called from python and then accessed bpy.data.*
- WM_read_homefile_exec was setting the contexts Scene to NULL as a signal for the event system, this didnt work in background mode, crashing when property update functions expected scene to be set.
|
|
- now writing to RNA is disabled when inside render() call.
- disallow calling operators when writes are disabled.
Rendering runs in a thread so running operators from the thread is not safe unless rendering becomes a blocking operator again.
|
|
MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
|
|
reports into python errors.
|
|
in all cases except for the render engine.
this allows python to NULL its internal context while scripts are not running.
|
|
|
|
- Python calling operators didn't run WM_operator_properties_sanitize() so enum functions called from python were given a NULL context.
- PROP_ENUM_NO_CONTEXT and PROP_NEVER_NULL used the same value in the enum (possible conflict).
|
|
being treated as None.
|
|
WM_operator_poll() could fail in cases WM_operator_name_call() would succeed because calling the operator would setup the context before calling poll.
this would result in python raising an invalid error or menu items being greyed out.
now python can also check with an operator context:
bpy.ops.object.editmode_toggle.poll('INVOKE_SCREEN')
|
|
to sys.modules directly, no functional change.
|
|
warnings.
applied to python api and exotic.c, removed some args being passed down which were not needed.
keyword args for new mathutils types were being ignored when they should raise an error.
|
|
messages when poll fails, at the moment only python uses this but theres nothing python specific.
only added 1 message to a poll function, so messages still need to be set in many more places to be useful.
|
|
|
|
eg:
if bpy.ops.object.mode_set.poll():
...
|
|
errors now works when executing class functions in a module.
- replaced PySys_GetObject("modules") with PyImport_GetModuleDict()
- use defaults for keymap import/export rather then setting the same value every time from the UI scripts.
|
|
WM_operatortype_find
- hopefully fix reported problem with MSVC.
|
|
|
|
assign to the right variable).
|
|
|
|
|
|
Dicts are converted to operator properties like this:
bpy.ops.armature.extrude_forked(TRANSFORM_OT_translate={"value":(2,0,1)})
Note that this doesn't work quite well if one operator is twice in the same macro, but that's a problem at the RNA level too. I'll have to deal with that eventually.
|
|
before)
|
|
matches the set that python operators themselves return. eg.
{'MODAL'} or... {'FINISHED'}
|
|
|
|
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).
|
|
* operators now return sets (converted into flags)
* can't remove bpy_operator_wrap.c since macro's still use the custom register funcs
|
|
menus, headers & render engines since there was a fair bit of duplicate functionality.
will remove the old system and update scripts next.
|
|
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.
|
|
|
|
|
|
other script
|
|
* Added 'active node' panel for the Nodes Editor. This panel, in the NKEY region, shows the settings for the active node. Included in this panel is a field used for editing the unique-name of the node too.
* Fixed a number of uninitialised vars warnings that I missed in previous commit...
|
|
The aim of this is to avoid having to set the selection each time before running an operator from python.
At the moment this is set as a python dictionary with string keys and rna values... eg.
C = {}
C["active_object"] = bpy.data.objects['SomeOb']
bpy.ops.object.game_property_new(C)
# ofcourse this works too..
bpy.ops.object.game_property_new({"active_object":ob})
# or...
C = {"main":bpy.data, "scene":bpy.data.scenes[0], "active_object":bpy.data.objects['SomeOb'], "selected_editable_objects":list(bpy.data.objects)}
bpy.ops.object.location_apply(C)
|
|
3D add menu can be shared.
|
|
way to test the overhead of the python api (printed to the consoel on exit).
- rename WM_OT_ten_timer to WM_OT_redraw_timer
- added iterations argument to run more then 10 times (10 is default still)
- use report api rather then always calling a popup directly.
- added a new test that draws every region without swapping.
- dont show the info popup when operators are called from python.
- operators called from python now print reports, useful with the interactive console.
eg.
>>> bpy.ops.wm.redraw_timer(type='DRAW_WIN', iterations=300)
Info: 300 x Draw Window: 4168.56 ms, average: 13.8952
|
|
solved by wrapping all polling in WM_operator_poll and
adding a special callback for python.
|
|
writes all operators (including PyOperators) and their default values into a textblock.
Useful for an overview and checking consistancy.
eg. http://www.pasteall.org/7918/python
added rna functions text.clear() and text.write(str)
|
|
a reference to Reports locally allocated in the api functions, which would crash and burn later when the operator would actually stop.
This commit introduces a flag at the Reports level that can be used to indicate that it needs to be freed (on top of the flag already existing in the operator, which I guess could be removed).
Reports for operators called through python are only persisted if they indicate that they are running modal.
|
|
(requested by algorith)
example. bpy.ops.tfm.rotate('INVOKE_REGION_WIN', pivot=(0,1,2), ......)
bpy_array.c - was too strict with types, 0 should be allowed as well as 0.0 in a float array.
|
|
|