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-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-13RNA & PyAPICampbell Barton
* 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.
2009-07-102.5:Brecht Van Lommel
* RNA: enum items with "" indentifier are now interpreted as separators. * Add Object menu: added consistent names, separators.
2009-07-082.5: Various FixesBrecht Van Lommel
* Context panel now draws without header, with arrows, no scene name. * Softbody vertex group search popup. * Improve names for autogenerated shortcut keys in menus. * Make most Select menus in the 3D view header work. * Fix armature border select selection syncing. * Add POSE_OT_select_constraint_target, MESH_OT_select_by_number_vertices, MESH_OT_select_vertex_path. * Merge mesh select similar into one operator. * Don't give MESH_OT_select_random Space hotkey. * Add DAG_object_flush_update to many mesh edit tools, not calling this will crash with modifiers. * RNA_def_enum_funcs for dynamic enums in operators, but not very useful without context yet. * Fix refresh issue with image window header + editmode. * Fix drawing of shadow mesh for image painting. * Remove deprecated uiDefMenuButO and uiDefMenuSep functions. * Remove keyval.c, code is in wm_keymap.c already. * Rename WM_operator_redo to WM_operator_props_popup.
2009-06-29RNABrecht Van Lommel
Implementation of RNA side of foreach_get/foreach_set, Campbell will do python code. Three functions for efficiently setting some property for all items in a collection. RNA_property_collection_raw_array gives access to the properties as an array with length, stride, and type specified, if this is possible, i.e. not when it uses a ListBase, or if a manual get/set function is implemented. Two other functions take a C array pointer and get/set it using the a collection + property name, using efficient array access if possible, and otherwise using slower RNA iterator. RNA_property_collection_raw_get RNA_property_collection_raw_set The number of type conversion required here got a bit out of hand, it could be more efficient still if checking for more cases, but function is already long enough. Example: http://www.pasteall.org/6362/c
2009-06-202.5Brecht Van Lommel
* Optimized RNA property lookups and path resolving, still can be much better, but now the 1000 IPO example on bf-taskforce25 runs at reasonable speed. * Also an optimization in the depsgraph when dealing with many objects, this was actually also a bottleneck here.
2009-06-18RNABrecht Van Lommel
Merging changes made by Arystanbek in the soc-2009-kazanbas branch, plus some things modified and added by me. * The API files now all in the makesrna module, convention is to call them e.g. rna_mesh_api.c for rna_mesh.c. Note for visual studio build maintainers, the rna_*_api.c files are compiled as part of "makesrna", but do not have rna_*_gen.c generated as part of the library. SCons/cmake/make were updated. * Added function flags FUNC_USE_CONTEXT and FUNC_USE_REPORTS, to allow RNA functions to get context and error reporting parameters optionally. Renamed FUNC_TYPESTATIC to FUNC_NO_SELF. * RNA collections now have a pointer to add/remove FunctionRNA's, this isn't actually used anywhere yet, purpose is to make an alias main.meshes.add() for main.add_mesh() in python. * Fixes to make autogenerating property set/get for multidimensional arrays work, though a 4x4 matrix will be exposed as a length 16 one dimensional RNA array. * Functions and properties added: * Main.add_mesh() * Main.remove_mesh() * Object.matrix * Object.create_render_mesh() * WindowManager.add_fileselect()
2009-06-16RNABrecht Van Lommel
* Added icon to property and enum property items. The latter is responsible for the large number of files changed. * For RNA functions, added PROP_RNAPTR flag to ask for a PointerRNA as argument instead of a C pointer, instead of doing it implicitly with the AnyType type. * Material: properly wrap diffuse/specular param variables, and rename some things for consistency. * MaterialTextureSlot: added "enabled" property (ma->septex). * Image: make animated property editable. * Image Editor: make some things editable, notifiers, respect state. * Context: fix issue with screen not being set as ID.
2009-06-07RNA:Brecht Van Lommel
* Accept None as NULL pointers through python function calls. * Added type callback for pointers back, it's useful still in some cases. Made Object.data editable using this, the pointer type varying based on object type. * Wrap pin ID pointer in buttons space. * Added subclasses for text and surface curve ID blocks, to organize data better and get proper icons. * Added RNA_type_to_ID_code and ID_code_to_RNA_type functions. * Update RNA_access.h with new RNA types.
2009-06-04UI/RNA:Brecht Van Lommel
* Added an icon entry to RNA structs, instead of the UI_GetIconRNA function, to keep code together a bit more and make the lookup faster.
2009-05-29RNA:Brecht Van Lommel
* Automatically do us++ and us-- reference counting in ID pointer set functions. * Added an enum property callback to dynamically vary the list of available items. * Added some functions to do removes on pointers and collections runtime defined for RNA and using ID properties. * Constraints now have owner/target space wrapped, and most pointers made editable. They can be ported to use python layouts. * Also other pointers made editable that I think are see now with the automatic reference counting.
2009-05-20RNA:Brecht Van Lommel
* Any Struct can now have ID properties, by creating a callback function to create/return an IDProperty. * Wrapped PoseChannel ID properties. * Note there is still no way to create ID Properties in 2.5, though the callback to get/create the initial group is now exposed through RNA_struct_idproperties.
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-07RNA: Commit of the API patch by vekoon. This adds Functions to RNA,Brecht Van Lommel
which can be defined to call C functions with defined parameters. * Parameters are RNA properties, with the same types. * Parameters are stored in a ParameterList, which is like a small stack with the values. This is then used to call the C function. * Includes Python integration. * Only one test function is part of this commit, ID.rename. * Integration with the editors/ module is not included in this commit, there's some issues to be worked out for that still.
2009-03-23RNA:Brecht Van Lommel
* Allow pointers to be editable, did SpaceTextEditor.text as a test. * Changed PROP_NOT_EDITABLE to PROP_EDITABLE, and added RNA_def_property_clear_flag. * Removed rna_dependency.c test code.
2009-03-19ContextBrecht Van Lommel
* Made it based on string lookups rather than fixed enum, to make it extensible by python scripts. * Context callbacks now also have to specify RNA type when returning pointers or collections. For non-RNA wrapped data, UnknownType can be used. * RNA wrapped context. The WM entries are fixed, for data context only main and scene are defined properties. Other data entries have to be dynamically looked up. * I've added some special code in python for the dynamic context lookups. Tried to hide it behind RNA but didn't find a clean way to do it yet. Still unused/untested. * Also minor fix for warning about propertional edit property in transform code, and fix for usage of operator poll with checking if it was NULL.
2009-02-18RNA:Brecht Van Lommel
* Added Particle wrapping patch by Roelf de Kock. It's not complete yet and I haven't reviewed it, but committing anyway, will get to it later. * Added "Percentage" subtype for floats. Doesn't really do much besides making auto rna buttons into sliders rather than numeric inputs, but can later display in % rather than 0.0-1.0.
2009-02-02RNA: C APIBrecht Van Lommel
* 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
2009-01-11RNABrecht Van Lommel
* 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.
2009-01-09added rna property "parent" so nested RNA structs can access their parent ↵Campbell Barton
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.
2009-01-08RNABrecht Van Lommel
* The generated code is now split into multiple files instead of a single big one. Scons, make and cmake are updated to deal with this.
2009-01-02RNABrecht Van Lommel
* Added skeleton code for particle/object_force/userdef. * More Object properties wrapped. * Added User Preferences display in outliner.
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);
2009-01-01RNABrecht Van Lommel
* Added support for sending notifiers and updates when setting RNA properties. Per property, there is a notifier NC_/ND_ flag, and a function that is called. Currently only used for Object.loc/rot/size. * RNA_property_update that does this is not automatically called in every _set function, it has do be done separate, and is being done by buttons with RNA data. * Perhaps for python there could be a trick to accumulate these flags rather than update each time, though for now the python RNA code could just do them everytime. Did not add these calls in the python code yet because it needs context, not sure where to get that from?
2008-12-31RNABrecht Van Lommel
* DNA_text_types.h done, patch by Roelf de Kock. * Minor naming fixes in RNA-RNA.
2008-12-31RNABrecht Van Lommel
* Store RNA collections different in ID properties, using a generic ID property array, using the patch provided by Joe. * Fix bug accessing registered operator properties in the wm from the outliner. * In the outliner, only use the RNA icon for RNA data, and use dot again for unknown icon. * Also, show pointer properties data in the second column, and auto expand two levels when opening them. * Added small RNA_struct_defined_properties function to get only the defined properties without builtin and undefined id properties (for py operators).
2008-12-19added "description" and "readonly" properties to RNA Structs (also ↵Campbell Barton
accessible via python) Many descriptions are not written, grep for DOC_BROKEN if you have some spare time to write struct descriptions.
2008-12-19Small RNA changesCampbell Barton
* rna_validate_identifier now checks identifiers are not python keywords such as if, and, from (builtins like max, object and sort are ok) * rna_validate_identifier prints an error explaining why it fails * renamed Struct's "from" to "base" - to point to the struct inherited from. * renamed ImageUsers's "pass" and "layer" to "renderPass" and "renderLayer" * use the identifier as the key for ENUM's (matching structs and properties)
2008-12-18Use the identifier for struct property access tooCampbell Barton
struct.properties['pulse_false_level'] instead of struct.properties['Pulse False Level']
2008-12-18Use the identifier rather then the struct name to access a collection of ↵Campbell Barton
structs. bpydoc.structs.keys() - ['Actuator', 'ActuatorSensor', 'AlwaysSensor', 'AndController'.... etc now reads... bpydoc.structs.keys() - ['Actuator', 'Actuator Sensor', 'Always Sensor', 'And Controller'... This is more correct since an identifier is supposted to be unique when a name might not be.
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-15RNA:Brecht Van Lommel
Added some functionality to make inspecting all RNA structs possible. Not used yet, but can be tested by replacing this line in space_outliner.c: RNA_main_pointer_create(G.main, &cell.ptr); with: RNA_blender_rna_pointer_create(&cell.ptr);
2008-11-24RNABrecht Van Lommel
* Wrap most user editable data in DNA_mesh_types.h and DNA_meshdata_types.h. Still needs to be improved in some areas though, especially how to deal with data layers (expose per element or as array, or both?), and data in face corners (bmesh type data structures are more logical here). Tweaks to RNA defining to make some cases easier: * Added range callback function for int/float. * Added 'skip' callback for listbase and array iterators to skip items in the collection. * Extra error print when calling wrong define_property_*_sdna functions. * Also made button code respect non_editable flag, is quick change though, need to add support for properly graying out etc.
2008-11-21RNABrecht Van Lommel
* More ID property support. What was already possible was showing ID properties as RNA properties. Now it is possible to define RNA properties and have an ID property automatically created the first time it is set (if not set it retuns the default). * Added support for defining RNA structs and properties at runtime. This is useful for python and plugins, and could also be used for operators, not sure yet what is best there, they could be done in preprocess for speed, but not sure how to do that while keeping operator registration a single function. * Added quick functions to get/set properties based on names, to be used for operators. * Added some simple support for inheritance, was already doing this but having it as a feature simplifies things. Two things were added for this: when defining a struct you can give a 'from' struct whose properties will be copied, and structs like ID, operator, modifier, can define a refine callback that will return the more specific type of the struct like ID -> Object, Mesh, .. . * Added simple windowmanager wrap with only the registered operators list, used for testing RNA for operators.
2008-11-18RNA minor changesBrecht Van Lommel
* Added start of lamp wrapping (code by Michael Fox). * Add back Object.data, was crashing with unknown data type. * Added support for using consecutive variables like float r, g, b; as an array without writing a manual get/set function. * Also note the RNA documentation is updated now to be more about how to define RNA and use it, including some diagrams. http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA
2008-11-17RNABrecht Van Lommel
* Added support for ID properties, mapped as follows: * IDP Int = RNA Int * IDP Float, Double = RNA Float * IDP_String = RNA String * IDP Group = RNA IDPropertyGroup Struct * IDP_Array = RNA Array * PropertyRNA and StructRNA are now defined private for the module, to force external code to always use accessor functions.
2008-11-14RNABrecht Van Lommel
* Rename cname to identifier. * Rename PropertyEnumItem to EnumPropertyItem. * Wrapped min/max/step/precision, pointer type for RNA. * Draw FLT_MAX a bit better in buttons.
2008-11-14RNABrecht Van Lommel
* Added RNA list viewer. This is currently drawn in the outliner window, the UI is limited but it is just intended to test RNA at the moment. * Added UI names for currently wrapped properties. * Made iterating collections a bit more convenient.
2008-11-14RNABrecht Van Lommel
* Added accessor functions for structs and properties instead of direct access, in preparation of wrapping ID properties. * Added more error prints for wrong defines. * Wrap RNA data structures with RNA. * Disable dependency code for now to avoid confusion.