Page Menu
Home
Search
Configure Global Search
Log In
Files
F1526
Material.c.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Johnny Matthews (guitargeek)
Nov 13 2013, 12:58 PM
Size
5 KB
Subscribers
None
Material.c.patch
View Options
Index: source/blender/python/api2_2x/Material.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Material.c,v
retrieving revision 1.30
diff -u -r1.30 Material.c
--- source/blender/python/api2_2x/Material.c 9 Mar 2005 19:45:55 -0000 1.30
+++ source/blender/python/api2_2x/Material.c 18 Mar 2005 16:42:21 -0000
@@ -37,6 +37,7 @@
#include <MEM_guardedalloc.h>
#include <DNA_ID.h>
#include <BLI_blenlib.h>
+#include <BSE_editipo.h>
#include "constant.h"
#include "gen_utils.h"
@@ -46,7 +47,7 @@
#include "Material.h"
#include "Ipo.h"
-
+#include "modules.h"
/* only used for .oopsLoc at the moment */
#include "DNA_oops_types.h"
#include "DNA_space_types.h"
@@ -149,7 +150,15 @@
#define EXPP_MAT_MIRRTRANSADD_MAX 1.0
-
+#define IPOKEY_RGB 0
+#define IPOKEY_ALPHA 1
+#define IPOKEY_HALOSIZE 2
+#define IPOKEY_MODE 3
+#define IPOKEY_ALLCOLOR 10
+#define IPOKEY_ALLMIRROR 14
+#define IPOKEY_OFS 12
+#define IPOKEY_SIZE 13
+#define IPOKEY_ALLMAPPING 11
@@ -368,6 +377,17 @@
if( Modes )
PyModule_AddObject( submodule, "Modes", Modes );
+
+ PyModule_AddIntConstant( submodule, "RGB", 0 );
+ PyModule_AddIntConstant( submodule, "ALPHA", 1 );
+ PyModule_AddIntConstant( submodule, "HALOSIZE", 2 );
+ PyModule_AddIntConstant( submodule, "MODE", 3 );
+ PyModule_AddIntConstant( submodule, "ALLCOLOR", 10 );
+ PyModule_AddIntConstant( submodule, "ALLMIRROR", 14 );
+ PyModule_AddIntConstant( submodule, "OFS", 12 );
+ PyModule_AddIntConstant( submodule, "SIZE", 13 );
+ PyModule_AddIntConstant( submodule, "ALLMAPPING", 11 );
+
return ( submodule );
}
@@ -470,6 +490,9 @@
PyObject * args );
static PyObject *Material_clearScriptLinks( BPy_Material * self );
+static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args );
+
+
/*****************************************************************************/
/* Python BPy_Material methods table: */
/*****************************************************************************/
@@ -556,6 +579,8 @@
"(Blender Ipo) - Change Material's Ipo"},
{"clearIpo", ( PyCFunction ) Material_clearIpo, METH_NOARGS,
"(Blender Ipo) - Unlink Ipo from this Material"},
+ {"insertIpoKey", ( PyCFunction ) Material_insertIpoKey, METH_VARARGS,
+ "(Blender Ipo) - Insret IPO Key at current frame"},
{"setMode", ( PyCFunction ) Material_setMode, METH_VARARGS,
"([s[,s]]) - Set Material's mode flag(s)"},
{"setRGBCol", ( PyCFunction ) Material_setRGBCol, METH_VARARGS,
@@ -1231,6 +1256,82 @@
return EXPP_incr_ret_False(); /* no ipo found */
}
+
+static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args )
+{
+ int key = 0, map;
+
+ if( !PyArg_ParseTuple( args, "i", &( key ) ) )
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected int argument" ) );
+
+ map = texchannel_to_adrcode(self->material->texact);
+
+ if(key==IPOKEY_RGB || key==IPOKEY_ALLCOLOR) {
+ insertkey((ID *)self->material, MA_COL_R);
+ insertkey((ID *)self->material, MA_COL_G);
+ insertkey((ID *)self->material, MA_COL_B);
+ }
+ if(key==IPOKEY_ALPHA || key==IPOKEY_ALLCOLOR) {
+ insertkey((ID *)self->material, MA_ALPHA);
+ }
+ if(key==IPOKEY_HALOSIZE || key==IPOKEY_ALLCOLOR) {
+ insertkey((ID *)self->material, MA_HASIZE);
+ }
+ if(key==IPOKEY_MODE || key==IPOKEY_ALLCOLOR) {
+ insertkey((ID *)self->material, MA_MODE);
+ }
+ if(key==IPOKEY_ALLCOLOR) {
+ insertkey((ID *)self->material, MA_SPEC_R);
+ insertkey((ID *)self->material, MA_SPEC_G);
+ insertkey((ID *)self->material, MA_SPEC_B);
+ insertkey((ID *)self->material, MA_REF);
+ insertkey((ID *)self->material, MA_EMIT);
+ insertkey((ID *)self->material, MA_AMB);
+ insertkey((ID *)self->material, MA_SPEC);
+ insertkey((ID *)self->material, MA_HARD);
+ insertkey((ID *)self->material, MA_MODE);
+ insertkey((ID *)self->material, MA_TRANSLU);
+ insertkey((ID *)self->material, MA_ADD);
+ }
+ if(key==IPOKEY_ALLMIRROR) {
+ insertkey((ID *)self->material, MA_RAYM);
+ insertkey((ID *)self->material, MA_FRESMIR);
+ insertkey((ID *)self->material, MA_FRESMIRI);
+ insertkey((ID *)self->material, MA_FRESTRA);
+ insertkey((ID *)self->material, MA_FRESTRAI);
+ }
+ if(key==IPOKEY_OFS || key==IPOKEY_ALLMAPPING) {
+ insertkey((ID *)self->material, map+MAP_OFS_X);
+ insertkey((ID *)self->material, map+MAP_OFS_Y);
+ insertkey((ID *)self->material, map+MAP_OFS_Z);
+ }
+ if(key==IPOKEY_SIZE || key==IPOKEY_ALLMAPPING) {
+ insertkey((ID *)self->material, map+MAP_SIZE_X);
+ insertkey((ID *)self->material, map+MAP_SIZE_Y);
+ insertkey((ID *)self->material, map+MAP_SIZE_Z);
+ }
+ if(key==IPOKEY_ALLMAPPING) {
+ insertkey((ID *)self->material, map+MAP_R);
+ insertkey((ID *)self->material, map+MAP_G);
+ insertkey((ID *)self->material, map+MAP_B);
+ insertkey((ID *)self->material, map+MAP_DVAR);
+ insertkey((ID *)self->material, map+MAP_COLF);
+ insertkey((ID *)self->material, map+MAP_NORF);
+ insertkey((ID *)self->material, map+MAP_VARF);
+ insertkey((ID *)self->material, map+MAP_DISP);
+ }
+
+ allspace(REMAKEIPO, 0);
+ allqueue(REDRAWIPO, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWNLA, 0);
+
+ Py_INCREF( Py_None );
+ return Py_None;
+}
+
static PyObject *Material_setName( BPy_Material * self, PyObject * args )
{
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1c/d2/ff43cccb7e68a32e60ecd0b7abf2
Event Timeline
Log In to Comment