[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21289] branches/soc-2009-yukishiro/source /blender: light node start

Jingyuan Huang jingyuan.huang at gmail.com
Wed Jul 1 19:29:45 CEST 2009


Revision: 21289
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21289
Author:   yukishiro
Date:     2009-07-01 19:29:45 +0200 (Wed, 01 Jul 2009)

Log Message:
-----------
light node start

Modified Paths:
--------------
    branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_node.h
    branches/soc-2009-yukishiro/source/blender/editors/space_node/node_edit.c
    branches/soc-2009-yukishiro/source/blender/editors/space_node/node_header.c
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_node_types.h
    branches/soc-2009-yukishiro/source/blender/nodes/SConscript

Added Paths:
-----------
    branches/soc-2009-yukishiro/source/blender/nodes/LGT_node.h
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_image.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_lightenv.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_output.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_outputFile.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_util.c
    branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_util.h

Modified: branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_node.h
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_node.h	2009-07-01 13:37:52 UTC (rev 21288)
+++ branches/soc-2009-yukishiro/source/blender/blenkernel/BKE_node.h	2009-07-01 17:29:45 UTC (rev 21289)
@@ -416,6 +416,15 @@
 #define TEX_NODE_PROC      500
 #define TEX_NODE_PROC_MAX  600
 
+
+/* *************** LIGHT NODES ************** */
+
+#define LGT_NODE_OUTPUT		601
+#define LGT_NODE_LIGHTENV	602
+#define LGT_NODE_IMAGE		603
+#define LGT_NODE_MIX_RGB	604
+#define LGT_NODE_OUTPUT_FILE	605
+
 extern struct ListBase node_all_textures;
 
 /* API */

Modified: branches/soc-2009-yukishiro/source/blender/editors/space_node/node_edit.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_node/node_edit.c	2009-07-01 13:37:52 UTC (rev 21288)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_node/node_edit.c	2009-07-01 17:29:45 UTC (rev 21289)
@@ -646,6 +646,11 @@
 			snode->nodetree= tx->nodetree;
 		}
 	}
+	else if (snode->treetype==NTREE_LIGHT) {
+		if (scene->lightenv) {
+			// TODO
+		}
+	}
 	
 	/* find editable group */
 	if(snode->nodetree)

Modified: branches/soc-2009-yukishiro/source/blender/editors/space_node/node_header.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_node/node_header.c	2009-07-01 13:37:52 UTC (rev 21288)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_node/node_header.c	2009-07-01 17:29:45 UTC (rev 21289)
@@ -420,7 +420,8 @@
 		uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, "");
 		uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
 
-	} else if(snode->treetype==NTREE_TEXTURE) {
+	}
+	else if(snode->treetype==NTREE_TEXTURE) {
 		uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
 		uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
 		uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, "");
@@ -430,6 +431,10 @@
 		uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, "");
 		uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, "");
 	}
+	else if(snode->treetype==NTREE_LIGHT) {
+		uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, "");
+		uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, "");
+	}
 	else
 		uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");	
 	
@@ -735,6 +740,9 @@
 	xco+= XIC;
 	uiDefIconButI(block, ROW, B_REDR, ICON_TEXTURE_DATA, xco,yco,XIC,YIC-2,
 				  &(snode->treetype), 2.0f, 2.0f, 0.0f, 0.0f, "Texture Nodes");
+	xco+= XIC;
+	uiDefIconButI(block, ROW, B_REDR, ICON_LIGHT_DATA, xco,yco,XIC,YIC-2,
+				  &(snode->treetype), 2.0f, 3.0f, 0.0f, 0.0f, "Light Nodes");
 	xco+= 2*XIC;
 	uiBlockEndAlign(block);
 
@@ -778,6 +786,11 @@
 			}
 		}
 	}
+	else if(snode->treetype==NTREE_LIGHT) {
+		if(snode->from) {
+			// TODO
+		}
+	}
 	
 	UI_view2d_totRect_set(&ar->v2d, xco+XIC+100, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin));
 	

Modified: branches/soc-2009-yukishiro/source/blender/makesdna/DNA_node_types.h
===================================================================
--- branches/soc-2009-yukishiro/source/blender/makesdna/DNA_node_types.h	2009-07-01 13:37:52 UTC (rev 21288)
+++ branches/soc-2009-yukishiro/source/blender/makesdna/DNA_node_types.h	2009-07-01 17:29:45 UTC (rev 21289)
@@ -194,6 +194,7 @@
 #define NTREE_SHADER	0
 #define NTREE_COMPOSIT	1
 #define NTREE_TEXTURE   2
+#define NTREE_LIGHT	3
 
 /* ntree->init, flag */
 #define NTREE_TYPE_INIT	1

Added: branches/soc-2009-yukishiro/source/blender/nodes/LGT_node.h
===================================================================
--- branches/soc-2009-yukishiro/source/blender/nodes/LGT_node.h	                        (rev 0)
+++ branches/soc-2009-yukishiro/source/blender/nodes/LGT_node.h	2009-07-01 17:29:45 UTC (rev 21289)
@@ -0,0 +1,39 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef LGT_NODE_H
+#define LGT_NODE_H
+
+#include "BKE_node.h"
+
+
+#endif


Property changes on: branches/soc-2009-yukishiro/source/blender/nodes/LGT_node.h
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: branches/soc-2009-yukishiro/source/blender/nodes/SConscript
===================================================================
--- branches/soc-2009-yukishiro/source/blender/nodes/SConscript	2009-07-01 13:37:52 UTC (rev 21288)
+++ branches/soc-2009-yukishiro/source/blender/nodes/SConscript	2009-07-01 17:29:45 UTC (rev 21289)
@@ -5,6 +5,7 @@
 cmpsources = env.Glob('intern/CMP_nodes/*.c')
 shdsources = env.Glob('intern/SHD_nodes/*.c')
 texsources = env.Glob('intern/TEX_nodes/*.c')
+lgtsources = env.Glob('intern/LGT_nodes/*.c')
 
 incs = '. ./intern '
 incs += '#/intern/guardedalloc ../editors/include ../blenlib ../makesdna'
@@ -42,3 +43,4 @@
 env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )
 env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )
 env.BlenderLib ( libname = 'bf_texnodes', sources = texsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )
+env.BlenderLib ( libname = 'bf_lgtnodes', sources = lgtsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )

Added: branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_image.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_image.c	                        (rev 0)
+++ branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_image.c	2009-07-01 17:29:45 UTC (rev 21289)
@@ -0,0 +1,69 @@
+/**
+ * $Id: 
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "../LGT_util.h"
+
+static bNodeSocketType outputs[]= {
+	{ SOCK_RGBA, 0, "Image",  0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
+	{ -1, 0, "" }
+};
+
+static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
+{
+	//tex_output(node, in, out[0], &colorfn);
+	//
+	//tex_do_preview(node, out[0], data);
+}
+
+static void init(bNode* node)
+{
+	ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user");
+	node->storage= iuser;
+	iuser->sfra= 1;
+	iuser->fie_ima= 2;
+	iuser->ok= 1;
+}
+
+bNodeType lgt_node_image= {
+	/* *next,*prev */	NULL, NULL,
+	/* type code   */	LGT_NODE_IMAGE,
+	/* name        */	"Image",
+	/* width+range */	120, 80, 300,
+	/* class+opts  */	NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
+	/* input sock  */	NULL,
+	/* output sock */	outputs,
+	/* storage     */	"ImageUser",
+	/* execfunc    */	exec,
+	/* butfunc     */	NULL,
+	/* initfunc    */	init,
+	/* freestoragefunc    */	node_free_standard_storage,
+	/* copystoragefunc    */	node_copy_standard_storage,
+	/* id          */	NULL
+};
+


Property changes on: branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_image.c
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_lightenv.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_lightenv.c	                        (rev 0)
+++ branches/soc-2009-yukishiro/source/blender/nodes/intern/LGT_nodes/LGT_lightenv.c	2009-07-01 17:29:45 UTC (rev 21289)
@@ -0,0 +1,63 @@
+/**
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list