Age | Commit message (Collapse) | Author |
|
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.
|
|
Added RNA wrapping for F-Curve colour settings
|
|
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.
|
|
* 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
|
|
|
|
functions for C defined PyTypes (it seems).
|
|
- 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
|
|
can transform the strips or move their handles
Still todo, click-drag transform, metastrips support, snapping, markers overlap checks and constrain to valid channels.
|
|
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...)
|
|
* 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.
|
|
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)
|
|
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.
|
|
|
|
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.
|
|
- 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.
|
|
* 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
|
|
* 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);
|
|
|
|
* 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.
|
|
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
|
|
eg: print (bpyoperator.VIEW3D_OT_viewnumpad.rna.__members__)
docs for bpyoperator
http://www.graphicall.org/ftp/ideasman42/html/bpyoperator-module.html
|
|
tested first PyOperator, basics work now, invoke/exec can be used to make an operator that edits RNA or calls other operators.
|
|
|
|
|
|
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)
|
|
* PyOperators were always calling the python functions with default args.
* Made operator prints only happen when G.f & G_DEBUG is enabled.
|
|
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
|
|
for each script before)
This way python can call the operator to run other scripts
eg...
bpyoperator.SCRIPT_OT_run_pyfile(filename = "myop.py")
|
|
* rna epy doc-gen was failing when trying to sort None
|
|
python operator api was crashing when unknown operators were called.
|
|
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.
|
|
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.
|
|
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.
|
|
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!
|
|
New priorities for most libs, at least core. This is still for Blender proper, BGE and such still to come.
|
|
including bpy_compat.h, tested building with 2.6
|
|
New Python code: Fixes for Makefile and compat hacks for py 2.3
Campbell should check though!
|
|
* 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.
|
|
"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?)
|
|
|
|
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
|
|
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.
|
|
the rna stuff but its close. Need to get it working for
blender then copy over same to game engine.
Kent
|
|
for ob in bpy.objects:
print(ob.name)
for i, lay in bpy.scenes["Scene"].layer:
print('%d %d' % i, lay)
|
|
* 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.
|
|
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
|
|
Pre-Python 3.0 has strings default non-unicode, so checks and handling should be done so too.
|
|
PyUnicode_Check define exists
|
|
rna_actuator.c was missing an enum
|
|
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]
|