more epy doc updates
authorCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2007 06:09:03 +0000 (06:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 5 May 2007 06:09:03 +0000 (06:09 +0000)
added a constant dict "Blender.Object.IpoKeyTypes" to pass to ob.insertIpoKey(keytype), previously these constants were not documented well and added to Blender.Object directly

release/scripts/bvh_import.py
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/bpy_config.c
source/blender/python/api2_2x/doc/Object.py
source/blender/python/api2_2x/doc/Scene.py

index aa21cc82c57c9ae23044e675b2e63134a41ed0ac..d027956a50740d4c5950f64087f1c2dd1cd63d50 100644 (file)
@@ -354,7 +354,7 @@ def bvh_node_dict2objects(bvh_nodes, IMPORT_START_FRAME= 1, IMPORT_LOOP= False):
                        
                        bvh_node.temp.rot= rx*DEG2RAD,ry*DEG2RAD,rz*DEG2RAD
                        
-                       bvh_node.temp.insertIpoKey(Blender.Object.LOCROT)
+                       bvh_node.temp.insertIpoKey(Blender.Object.IpoKeys.LOCROT)
        
        scn.update(1)
        return objects
@@ -741,9 +741,12 @@ def main():
        Blender.Window.FileSelector(load_bvh_ui, 'Import BVH', '*.bvh')
 
 if __name__ == '__main__':
+       #def foo():
        main()
        '''
        scn = bpy.data.scenes.active
-       for ob in list(scn.objects): scn.objects.unlink(ob)
+       for ob in list(scn.objects):
+               if ob.name!='arm__':
+                       scn.objects.unlink(ob)
        load_bvh_ui('/test.bvh', False)
        '''
\ No newline at end of file
index 810748e21a35ae56f6f64f773714a22e7ed697e0..8404945485b8090043c482a73ddbe93120d10d77 100644 (file)
@@ -5220,6 +5220,27 @@ static PyObject *M_Object_RBShapeBoundDict( void )
        return M;
 }
 
+static PyObject *M_Object_IpoKeyTypesDict( void )
+{
+       PyObject *M = PyConstant_New(  );
+
+       if( M ) {
+               BPy_constant *d = ( BPy_constant * ) M;
+               PyConstant_Insert( d, "LOC", PyInt_FromLong( IPOKEY_LOC ) );
+               PyConstant_Insert( d, "ROT", PyInt_FromLong( IPOKEY_ROT ) );
+               PyConstant_Insert( d, "SIZE", PyInt_FromLong( IPOKEY_SIZE ) );
+               PyConstant_Insert( d, "LOCROT", PyInt_FromLong( IPOKEY_LOCROT ) );
+               PyConstant_Insert( d, "LOCROTSIZE", PyInt_FromLong( IPOKEY_LOCROTSIZE ) );
+               
+               PyConstant_Insert( d, "PI_STRENGTH", PyInt_FromLong( IPOKEY_PI_STRENGTH ) );
+               PyConstant_Insert( d, "PI_FALLOFF", PyInt_FromLong( IPOKEY_PI_FALLOFF ) );
+               PyConstant_Insert( d, "PI_SURFACEDAMP", PyInt_FromLong( IPOKEY_PI_SURFACEDAMP ) );
+               PyConstant_Insert( d, "PI_RANDOMDAMP", PyInt_FromLong( IPOKEY_PI_RANDOMDAMP ) );
+               PyConstant_Insert( d, "PI_PERM", PyInt_FromLong( IPOKEY_PI_PERM ) );
+       }
+       return M;
+}
+
 /*****************************************************************************/
 /* Function:    initObject                                             */
 /*****************************************************************************/
@@ -5233,12 +5254,15 @@ PyObject *Object_Init( void )
        PyObject *PITypesDict = M_Object_PITypesDict( );
        PyObject *RBFlagsDict = M_Object_RBFlagsDict( );
        PyObject *RBShapesDict = M_Object_RBShapeBoundDict( );
+       PyObject *IpoKeyTypesDict = M_Object_IpoKeyTypesDict( );
 
        PyType_Ready( &Object_Type ) ;
 
        module = Py_InitModule3( "Blender.Object", M_Object_methods,
                                 M_Object_doc );
-
+       
+       
+       /* We Should Remove these!!!! */
        PyModule_AddIntConstant( module, "LOC", IPOKEY_LOC );
        PyModule_AddIntConstant( module, "ROT", IPOKEY_ROT );
        PyModule_AddIntConstant( module, "SIZE", IPOKEY_SIZE );
@@ -5256,7 +5280,9 @@ PyObject *Object_Init( void )
        PyModule_AddIntConstant( module, "VORTEX",PFIELD_VORTEX );
        PyModule_AddIntConstant( module, "MAGNET",PFIELD_MAGNET );
        PyModule_AddIntConstant( module, "WIND",PFIELD_WIND );
-
+       /* Only keeping above so as not to break compat */
+       
+       
        if( DrawModesDict )
                PyModule_AddObject( module, "DrawModes", DrawModesDict );
        if( DrawTypesDict )
@@ -5271,7 +5297,8 @@ PyObject *Object_Init( void )
                PyModule_AddObject( module, "RBFlags", RBFlagsDict );
        if( RBShapesDict )
                PyModule_AddObject( module, "RBShapes", RBShapesDict );
-       
+       if( IpoKeyTypesDict )
+               PyModule_AddObject( module, "IpoKeyTypes", IpoKeyTypesDict );   
 
                /*Add SUBMODULES to the module*/
        dict = PyModule_GetDict( module ); /*borrowed*/
index bdb5e3c3b47580f62d6d832215269212125ea249..5942ee562562cdde73f86bf70c479005680358fa 100644 (file)
@@ -286,19 +286,19 @@ static PyGetSetDef Config_getseters[] = {
         (void *)EXPP_CONF_ATTR_UNDOSTEPS},
        {"textureTimeout",
         (getter)getIntAttr, (setter)setIntAttrClamp,
-        "undo steps",
+        "time for textures to stay in openGL memory",
         (void *)EXPP_CONF_ATTR_TEX_TIMEOUT},
        {"textureCollectRate",
         (getter)getIntAttr, (setter)setIntAttrClamp,
-        "undo steps",
+        "intervel for textures to be tagged as used",
         (void *)EXPP_CONF_ATTR_TEX_COLLECT_RATE},
        {"sequenceMemCacheLimit",
         (getter)getIntAttr, (setter)setIntAttrClamp,
-        "undo steps",
+        "maximum memory for the sequencer to use as cache",
         (void *)EXPP_CONF_ATTR_MEM_CACHE_LIMIT},
        {"fontSize",
         (getter)getIntAttr, (setter)setIntAttrClamp,
-        "undo steps",
+        "user interface font size",
         (void *)EXPP_CONF_ATTR_FONT_SIZE},
         
        /* Paths */
index 3e8cb5b044eeef97cc7d0334941ac2732777b431..a837fd058c153c03700aac27fc9fbf5bc6ac7403 100644 (file)
@@ -97,6 +97,20 @@ Example::
                - ANISOTROPIC: Enable anisotropic friction (requires ACTOR, DYNAMIC)
                - CHILD: reserved
 
+@type IpoKeyTypes: readonly dictionary
+@var IpoKeyTypes: Constant dict used for with L{Object.insertIpoKey} attribute.
+       Values can be ORed together.
+               - LOC
+               - ROT
+               - SIZE
+               - LOCROT
+               - LOCROTSIZE
+               - PI_STRENGTH
+               - PI_FALLOFF
+               - PI_SURFACEDAMP
+               - PI_RANDOMDAMP
+               - PI_PERM
+
 @type RBShapes: readonly dictionary
 @var RBShapes: Constant dict used for with L{Object.rbShapeBoundType}
        attribute.  Only one type can be selected at a time.  Values are
@@ -125,8 +139,8 @@ def New (type, name='type'):
                object = Blender.Object.New('Lamp')
                lamp = Blender.Lamp.New('Spot')
                object.link(lamp)
-               scene = Blender.Scene.GetCurrent()
-               scene.link(object)
+               sce = Blender.Scene.GetCurrent()
+               sce.link(object)
 
                Blender.Redraw()
        @Note: if an object is created but is not linked to object data, and the
@@ -764,11 +778,11 @@ class Object:
                the scene and prints the name and location of each object::
                        import Blender
 
-                       objects = Blender.Object.Get()
+                       sce = Blender.Scene.GetCurrent()
 
-                       for obj in objects:
-                               print obj.getName()
-                               print obj.getLocation()
+                       for ob in sce.objects:
+                               print obj.name
+                               print obj.loc
                @note: the worldspace location is the same as ob.matrixWorld[3][0:3]
                """
 
@@ -817,11 +831,10 @@ class Object:
                the scene and prints the name of each object::
                        import Blender
 
-                       scn= Blender.Scene.GetCurrent()
-                       objects = scn.getChildren()
+                       sce= Blender.Scene.GetCurrent()
 
-                       for obj in objects:
-                               print obj.getName()
+                       for ob in sce.objects:
+                               print ob.getName()
                """
 
        def getParent():
@@ -881,10 +894,10 @@ class Object:
                true number 'pi'.  A better, less error-prone value of pi is math.pi from the python math module.::
                        import Blender
 
-                       objects = Blender.Object.Get()
+                       sce = Blender.Scene.GetCurrent()
 
-                       for obj in objects:
-                               if obj.getType() == 'Camera':
+                       for obj in sce.objects:
+                               if obj.type == 'Camera':
                                        obj.LocY = -obj.LocY
                                        obj.RotZ = 3.141592 - obj.RotZ
 
@@ -896,19 +909,9 @@ class Object:
 
        def insertIpoKey(keytype):
                """
-               Inserts keytype values in object ipo at curframe. Uses module constants.
-               @type keytype: Integer
-               @param keytype:
-                               -LOC
-                               -ROT
-                               -SIZE
-                               -LOCROT
-                               -LOCROTSIZE
-                               -PI_STRENGTH
-                               -PI_FALLOFF
-                               -PI_PERM
-                               -PI_SURFACEDAMP
-                               -PI_RANDOMDAMP
+               Inserts keytype values in object ipo at curframe.
+               @type keytype: int
+               @param keytype: A constant from L{IpoKeyTypes<Object.IpoKeyTypes>}
                @return: None
                """
 
index c28460825d22f5bfafbf0eb3d41fdc33e125b905..fb852f2aa49ad618d46f9ae44c8894d2cef73c22 100644 (file)
@@ -112,7 +112,7 @@ class Scene:
        @type timeline: Timeline
        @ivar timeline: The L{timeline<TimeLine.TimeLine>} for this scene, named markers are stored here. (read only)
        @type render: RenderData
-       @ivar render: The scenes L{render<Render>} settings. (read only)
+       @ivar render: The scenes L{render<Render.RenderData>} settings. (read only)
        @type radiosity: RenderData
        @ivar radiosity: The scenes L{radiosity<Radio>} settings. (read only)
        """