[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10985] branches/pyapi_devel/source/ blender/python/api2_2x: Tested Material List and its now a mostly finished subtype of list.

Campbell Barton cbarton at metavr.com
Wed Jun 20 17:45:15 CEST 2007


Revision: 10985
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10985
Author:   campbellbarton
Date:     2007-06-20 17:45:14 +0200 (Wed, 20 Jun 2007)

Log Message:
-----------
Tested Material List and its now a mostly finished subtype of list.

Modified Paths:
--------------
    branches/pyapi_devel/source/blender/python/api2_2x/Camera.c
    branches/pyapi_devel/source/blender/python/api2_2x/Curve.c
    branches/pyapi_devel/source/blender/python/api2_2x/Group.c
    branches/pyapi_devel/source/blender/python/api2_2x/Lamp.c
    branches/pyapi_devel/source/blender/python/api2_2x/Material.c
    branches/pyapi_devel/source/blender/python/api2_2x/Metaball.c
    branches/pyapi_devel/source/blender/python/api2_2x/Object.c
    branches/pyapi_devel/source/blender/python/api2_2x/Scene.c
    branches/pyapi_devel/source/blender/python/api2_2x/Text.c
    branches/pyapi_devel/source/blender/python/api2_2x/Text3d.c
    branches/pyapi_devel/source/blender/python/api2_2x/World.c
    branches/pyapi_devel/source/blender/python/api2_2x/gen_library.h
    branches/pyapi_devel/source/blender/python/api2_2x/material_list.c

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Camera.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Camera.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Camera.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -361,7 +361,8 @@
 /* Python attributes get/set structure:                                      */
 /*****************************************************************************/
 static PyGetSetDef BPy_Camera_getseters[] = {
-	GENERIC_LIB_GETSETATTR_WITH_SCRIPTLINK,
+	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_SCRIPTLINK,
 	{"orthographic",
 	 (getter)Camera_getOrtho, (setter)Camera_setOrtho,
 	 "camera orthographic mode",

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Curve.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Curve.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Curve.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -1111,6 +1111,7 @@
 
 static PyGetSetDef Curve_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_MATERIAL,
 	{"pathlen",
 	 (getter)Curve_getPathLen, (setter)Curve_setPathLen,
 	 "The path length,  used to set the number of frames for an animation (not the physical length)",
@@ -1167,10 +1168,6 @@
 	 (getter)Curve_getKey, (setter)NULL,
 	 "The shape key for the curve (if any)",
 	NULL},
-	{"materials",
-	 (getter)GenericLib_getMaterials, (setter)GenericLib_setMaterials,
-	 "The materials associated with the curve",
-	NULL},
 	{NULL,NULL,NULL,NULL,NULL}  /* Sentinel */
 
 };

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Group.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Group.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Group.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -204,7 +204,7 @@
 /*****************************************************************************/
 /* Python BPy_Group getsetattr funcs:                                        */
 /*****************************************************************************/
-static int Group_setLayers( BPy_Group * self, PyObject * value )
+static int Group_setLayerMask( BPy_Group * self, PyObject * value )
 {
 	unsigned int laymask = 0;
 	
@@ -225,7 +225,7 @@
 	return 0;
 }
 
-static PyObject *Group_getLayers( BPy_Group * self )
+static PyObject *Group_getLayerMask( BPy_Group * self )
 {
 	return PyInt_FromLong( self->group->layer );
 }
@@ -235,8 +235,8 @@
 /*****************************************************************************/
 static PyGetSetDef BPy_Group_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
-	{"layers",
-	 (getter)Group_getLayers, (setter)Group_setLayers,
+	{"layerMask",
+	 (getter)Group_getLayerMask, (setter)Group_setLayerMask,
 	 "layer mask for this group",
 	 NULL},
 	{"objects",

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Lamp.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Lamp.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Lamp.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -234,6 +234,7 @@
 /*****************************************************************************/
 static PyGetSetDef BPy_Lamp_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_SCRIPTLINK,
 	{"bias",
 	 (getter)Lamp_getBias, (setter)Lamp_setBias,
 	 "Lamp shadow map sampling bias",

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Material.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Material.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Material.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -333,6 +333,7 @@
 
 static PyGetSetDef BPy_Material_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_SCRIPTLINK,
 	
 	/* custom types */
 	{"textures", /* TODO - set textures - was not in 2.44 though */

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Metaball.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Metaball.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Metaball.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -179,10 +179,7 @@
 /*****************************************************************************/
 static PyGetSetDef BPy_Metaball_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
-	{"materials",
-	 (getter)GenericLib_getMaterials, (setter)GenericLib_setMaterials,
-	 "Number of metaball users",
-	 NULL},
+	GENERIC_LIB_GETSETATTR_MATERIAL,
 	{"elements",
 	 (getter)Metaball_getElements, (setter)NULL,
 	 "Elements in this metaball",

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Object.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Object.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Object.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -3813,11 +3813,9 @@
 }
 
 static PyGetSetDef BPy_Object_getseters[] = {
-	GENERIC_LIB_GETSETATTR_WITH_SCRIPTLINK,
-	{"materials",
-	 (getter)GenericLib_getMaterials, (setter)GenericLib_setMaterials,
-	 "List of materials",
-	 NULL},
+	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_SCRIPTLINK,
+	GENERIC_LIB_GETSETATTR_MATERIAL,
 	{"LocX",
 	 (getter)getFloatAttr, (setter)setFloatAttr,
 	 "The X location coordinate of the object",
@@ -3915,14 +3913,10 @@
 	 (getter)getFloat3Attr, (setter)setFloat3Attr,
 	 "The delta (X,Y,Z) size of the object",
 	 (void *)EXPP_OBJ_ATTR_DSIZE},
-	{"Layer",
+	{"layerMask",
 	 (getter)getIntAttr, (setter)Object_setLayersMask,
 	 "The object layers (bitfield)",
 	 (void *)EXPP_OBJ_ATTR_LAYERMASK},
-	{"Layers",
-	 (getter)getIntAttr, (setter)Object_setLayersMask,
-	 "The object layers (bitfield)",
-	 (void *)EXPP_OBJ_ATTR_LAYERMASK},
 	{"layers",
 	 (getter)Object_getLayers, (setter)Object_setLayers,
 	 "The object layers (list of ints)",

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Scene.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Scene.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Scene.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -243,8 +243,9 @@
 /* Python attributes get/set structure:                                      */
 /*****************************************************************************/
 static PyGetSetDef BPy_Scene_getseters[] = {
-	GENERIC_LIB_GETSETATTR_WITH_SCRIPTLINK,
-	{"layers",
+	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_SCRIPTLINK,
+	{"layerMask",
 	 (getter)Scene_getLayerMask, (setter)Scene_setLayerMask,
 	 "Scene layer bitmask",
 	 NULL},

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Text.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Text.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Text.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -298,6 +298,7 @@
 /*****************************************************************************/
 static PyGetSetDef BPy_Text_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_MATERIAL,
 	{"filename", (getter)Text_getFilename, (setter)NULL,
 	 "text filename", NULL},
 	{"mode", (getter)Text_getMode, (setter)NULL,

Modified: branches/pyapi_devel/source/blender/python/api2_2x/Text3d.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/Text3d.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/Text3d.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -310,6 +310,7 @@
 /*****************************************************************************/
 static PyGetSetDef BPy_Text3d_getseters[] = {
 	GENERIC_LIB_GETSETATTR, /* didnt have any attributes, at least lets have the standard ID attrs */
+	GENERIC_LIB_GETSETATTR_MATERIAL,
 	
 	{"text",
 	 (getter)Text3d_getText, (setter)Text3d_setText,

Modified: branches/pyapi_devel/source/blender/python/api2_2x/World.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/World.c	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/World.c	2007-06-20 15:45:14 UTC (rev 10985)
@@ -139,6 +139,7 @@
 /*****************************************************************************/
 static PyGetSetDef BPy_World_getseters[] = {
 	GENERIC_LIB_GETSETATTR,
+	GENERIC_LIB_GETSETATTR_SCRIPTLINK,
 	{"range", (getter)World_getRange, (setter)World_setRange,
 	 "range settings", NULL},
 	//{"skytype", (getter)World_getSkytype, (setter)World_setSkytype,

Modified: branches/pyapi_devel/source/blender/python/api2_2x/gen_library.h
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/gen_library.h	2007-06-20 12:09:05 UTC (rev 10984)
+++ branches/pyapi_devel/source/blender/python/api2_2x/gen_library.h	2007-06-20 15:45:14 UTC (rev 10985)
@@ -66,13 +66,19 @@
 	 NULL}
 
 /* for types that have scriptlinks */
-#define GENERIC_LIB_GETSETATTR_WITH_SCRIPTLINK \
-	GENERIC_LIB_GETSETATTR, \
+#define GENERIC_LIB_GETSETATTR_SCRIPTLINK \
 	{"scriptlinks",\
 	 (getter)GenericLib_getScriptLinkSeq, (setter)GenericLib_setScriptLinkSeq,\
 	 "script link sequence",\
 	 NULL}
 
+/* for types that have materials */
+#define GENERIC_LIB_GETSETATTR_MATERIAL \
+	{"materials",\
+	 (getter)GenericLib_getMaterials, (setter)GenericLib_setMaterials,\
+	 "material list",\
+	 NULL}
+
 /* Dummy struct for getting the ID from a libdata BPyObject */
 typedef struct {
 	PyObject_HEAD		/* required python macro */

Modified: branches/pyapi_devel/source/blender/python/api2_2x/material_list.c
===================================================================
--- branches/pyapi_devel/source/blender/python/api2_2x/material_list.c	2007-06-20 12:09:05 UTC (rev 10984)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list