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-11NLA SoC: Merge from 2.5 soc-2009-aligorithJoshua Leung
21470 to 21512 Next up, NLA-branch to 2.5 :)
2009-07-10RNABrecht Van Lommel
* 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.
2009-07-10Use python subtypes so bpy.types.Mesh is a subtype of bpy.types.IDCampbell Barton
This means checks like this work. isinstance(bpy.data.meshes[0], bpy.types.ID) bpy.types.Mesh.__base__ == bpy.types.ID
2009-07-10PyRNA api wasnt using python subclasses most of the time.Campbell Barton
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.
2009-07-10NLA SoC: Merge from 2.5Joshua Leung
21330 to 21469
2009-07-092.5Ton Roosendaal
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.
2009-07-09Dictionary style get() to property rna.Campbell Barton
eg.. mesh = bpy.data.meshes.get("SomeMesh", fallback) Set length limits for python string formatting.
2009-07-09removed check for pyc when scanning the directory of python files.Campbell Barton
Brecht, double checked and pyc or pyo files arent used because of the (file_extension[3] == '\0') test.
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-07-082.5Ton Roosendaal
Copied some Python compat stuff to get py 2.3 running... just googled for it on python.org mailing list.
2009-07-08* workaround for PySys_SetArgv() in python3 needing wchar_tCampbell Barton
* PyRNA - id_struct.keyframe_insert("path", index, frame)
2009-07-032.5:Brecht Van Lommel
* 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.
2009-07-032.5Ton Roosendaal
Windows #ifdef code missed semicolon.
2009-07-03fix for own missing var in recent commit.Campbell Barton
2009-07-03set the PYTHONPATH to BLI_gethome_folder("python") if it exists.Campbell Barton
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.
2009-07-03NLA SoC: Merge from 2.5Joshua Leung
21301 to 21329
2009-07-02out own Py_GetPath() function to replace pythons, so we can bundle python ↵Campbell Barton
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.
2009-07-02NLA SoC: Merge from 2.5Joshua Leung
21210 to 21300 Note to self: the next merge will be messy again, since 2 commits occurred this one was complete
2009-07-02needed for building with py2Campbell Barton
2009-07-01slice support working in py3 for Vector and Matrix types.Campbell Barton
Added slice to PyRNA collections and arrays (py3 only). eg. some_verts = mesh.verts[0:10] some_rna_array[4:-1] = [0,1,2,3] Collections dont support assignment, when assigning slices, resizing the array isnt support like with python lists.
2009-07-01disabling foreach_get/set for python2.x, since it uses new buffer api.Campbell Barton
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-30python access to RNA arrays.Campbell Barton
coords = array.array('f', [0.0]) * len(me.verts) * 3 m.verts.foreach_get('co', coords) the reverse works with set also. currently works for python buffers or sequences (slower) Quick speed test with 1,179,654 verts. *foreach_get* list 0.377 array 0.032 py 10.29 *foreach_set* list 0.184 array 0.028 py 9.79 where python was done like this... ---- i= 0 for v in m.verts: co = v.co l[i] = co[0]; l[i+1] = co[0]; l[i+2] = co[0] i+=3 ---- some of the error checking here needs to be cleaned up to account for different invalid bad inputs.
2009-06-30Python APICampbell Barton
Mathutils support for subclassing Vector, Quat, Euler and Matrix types. Removed C docstrings, prefer to make sure our epydocs are well maintained rather then duplicate, vague doc strings. Will convert scripts to detect missing docs from the BGE.
2009-06-29BGE PyAPI support for subclassing any BGE game type from python, scripters ↵Campbell Barton
define extra functions on gameObjects. Adding a UI to set the type on startup can be added easily. # ---- class myPlayer(GameTypes.KX_GameObject): def die(self): # ... do stuff ... self.endObject() # make an instance player = myPlayer(gameOb) # gameOb is made invalid now. player.die() # ---- One limitation (which could also be an advantage), is making the subclass instance will return that subclass everywhere, you cant have 2 different subclasses of the same BGE data at once.
2009-06-28PyNumberMethods needed ifdefs for python3.x and some other corrections.Campbell Barton
2009-06-27NLA SoC: Merge from 2.5 - 21146 to 21178Joshua Leung
2009-06-27RNABrecht Van Lommel
* Added support for passing collections to/from RNA functions, this is done using a ListBase of CollectionPointerLink, which is a standard ListBase link + PointerRNA. * Added editable active uv/vcol layer to Mesh. * Armature.bones now includes all bones, not only the ones without parents. * Modifier UV layer fields now are allowed to be empty, previously this would set the name during modifier evaluation if there was none.
2009-06-26Made Mathutils use radians rather then degrees. defining USE_MATHUTILS_DEG ↵Campbell Barton
for testing existing scripts. Added conversion for BGE Quaternion WXYZ (Blender/C) -> XYZW (Moto C++). BGE Python API now uses WXYZ following mathutils (break script warning).
2009-06-25PyAPI RNA/BGECampbell Barton
* all mathutils types now have optional callbacks * PyRNA returns mathutils quat and euler types automatically when they have the rotation subtype. * PyRNA, reuse the BPy_StructRNA PyObject rather name making a new one for each function returned. * use more arithb.c functions for Mathutils quaternion type (less inline cruft). * BGE Mathutils integration mostly finished- KX_PyMath now converts to Mathutils types rather then lists. * make all mathutils types share the same header so they can share a number of functions - dealloc, getWrapped, getOwner.
2009-06-25At last... this merge should finally do the trick!Joshua Leung
21073 to 21145
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-24RNABrecht Van Lommel
* RNA_struct_name_get_alloc function to get the name from a pointer, instead of having to deal with name property. * CTX_data_pointer_get_type to get data from context with a check for the RNA type.
2009-06-23modified patch from Arystanbek, allow assigning of mathutils matrix to an ↵Campbell Barton
rna matrix
2009-06-23PyRNA API support for matrix types as Mathutils matrix (with callbacks) ↵Campbell Barton
rather then a generic rna sequence of floats. Any 3x3 or 4x4 rna matrix will automatically be returned as a Mathutils matrix. This makes useful stuff like multiplying a vector location by an object matrix possible. ob = bpy.data.scenes[0].objects[0] print (ob.data.verts[0].co * ob.matrix) Also added mathutils matrix types to the BGE GameObject.localOrientation, worldOrientation * MT_Matrix3x3 added getValue3x3 and setValue3x3, assumed a 4x3 float array. * KX_GameObject.cpp convenience functions NodeSetGlobalOrientation, NodeGetLocalOrientation, NodeGetLocalScaling, NodeGetLocalPosition. * 2.5 python api now initializes modules BGL, Mathutils and Geometry * modules py3 PyModuleDef's use PyModuleDef_HEAD_INIT, rather then {}, was making msvc fail to build. * added macros for Vector_ReadCallback, Vector_WriteCallback etc. to check if the callback pointer is set before calling the function.
2009-06-23small changes...Campbell Barton
- allow RNA_property_enum_items to take the totitems int pointer as NULL (spares a loop on all the enum items). this change also makes enums types with no enum array crash in some places, could support these though Id rather disallow them, generating docs is a quick way to test for this. - open recent file operator used and enum to open the recent file without an enum array, changed to an int type. - added space_logic.py poll functions
2009-06-23SVN maintenance.Guillermo S. Romero
2009-06-23removing files that should not be in blender2.5, added (by mistake?) r19226Campbell Barton
2009-06-222.5: warning fixesBrecht Van Lommel
Mostly harmless ones, except for one about "gzopen64" being undeclared. This needs some defines in BLI_storage.h to be set before <unistd.h> is included. Might fix a crash in compressed file reading, though I'm not sure since it's hard to repeat the crash consistently.
2009-06-22PyAPI Mathutils Vector callbacks, referencing other PyObjects rather then ↵Campbell Barton
thin wrapping vectors which is crash prone. in short, vectors can work as if they are thin wrapped but not crash blender if the original data is removed. * RNA vector's return Mathutils vector types. * BGE vectors for GameObject's localPosition, worldPosition, localPosition, localScale, worldScale, localInertia. * Comment USE_MATHUTILS define to disable returning vectors. Example... * 2.49... * loc = gameOb.worldPosition loc[1] = 0 gameOb.worldPosition = loc * With vectors... * gameOb.worldPosition[1] = 0 * But this wont crash... * loc = gameOb.worldPosition gameOb.endObject() loc[1] = 0 # will raise an error that the objects removed. This breaks games which assume return values are lists. Will add this to eulers, matrix and quaternion types later.
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-20ContextBrecht Van Lommel
Python dir(context) now gives the items from the data context too, modified context callbacks to also return a list of items in the context.
2009-06-20RNA FixesCampbell Barton
* Python apis iterator didnt work, for example [f for f in mesh.faces] # failed. * Python apis collection.items(), collections without names now return (index,value) pairs, better then returning nothing. * bpy.ui and bpy.props modules were incorrectly named * Mesh vertex colors red/blue needed to be swapped on getting/setting. * Mesh vertex colors were not clamped.
2009-06-20ObColor wasnt converted into an RNA string.Campbell Barton
Updated Mathutils.Vector/Euler/Quaternion/Matrix so these are types rather then module methods, each type now has a tp_new function, matching python builtins float/int/str. Also cleaned up float conversion and arg passing. Changed buttons_objects.py... if ob in groups.objects: # no longer works if ob.name in groups.objects: # is the new syntax ...its more dict like and a lot faster (avoids python iterating over each item and comparing each, use a single rna lookup instead).
2009-06-19Update Mathutils for py3kCampbell Barton
* removed coercing types which has been removed from py3. * matrix uses getset's rather then getset items. * removed deprecated functions.
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-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-182.5Brecht Van Lommel
* Update cmake and makefiles to link python generic. * Fix game engine building for cmake and makefiles. * Fix compile error with py 3.x, due to 2.x compat fix.
2009-06-18fix for building with py2.3Campbell Barton
2009-06-18Fixing gl/glw.h compiiler errorDaniel Genrich