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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-02 22:55:32 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-02 22:55:32 +0400
commit30f1f28a8af3b393608b5869512a8823111294ad (patch)
tree035cee751100c31e25b55087efa476145b29af64 /source/blender/blenkernel/intern/world.c
parent97a0ae3e1b7eea3c069da8c6d3c7a3535734059d (diff)
Nodes: add support for shader nodes on world and lamps, in addition to materials.
The internal render engine does not support them, and they are not accesible in the UI yet, but cycles will use them.
Diffstat (limited to 'source/blender/blenkernel/intern/world.c')
-rw-r--r--source/blender/blenkernel/intern/world.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 5797c6c3f15..c7d2763774d 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -42,12 +42,14 @@
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
-#include "BKE_world.h"
-#include "BKE_library.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
-#include "BKE_main.h"
#include "BKE_icons.h"
+#include "BKE_library.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_node.h"
+#include "BKE_world.h"
void free_world(World *wrld)
{
@@ -63,6 +65,12 @@ void free_world(World *wrld)
BKE_free_animdata((ID *)wrld);
+ /* is no lib link block, but world extension */
+ if(wrld->nodetree) {
+ ntreeFreeTree(wrld->nodetree);
+ MEM_freeN(wrld->nodetree);
+ }
+
BKE_icon_delete((struct ID*)wrld);
wrld->id.icon_id = 0;
}
@@ -119,6 +127,9 @@ World *copy_world(World *wrld)
id_us_plus((ID *)wrldn->mtex[a]->tex);
}
}
+
+ if(wrld->nodetree)
+ wrldn->nodetree= ntreeCopyTree(wrld->nodetree);
if(wrld->preview)
wrldn->preview = BKE_previewimg_copy(wrld->preview);
@@ -143,6 +154,9 @@ World *localize_world(World *wrld)
}
}
+ if(wrld->nodetree)
+ wrldn->nodetree= ntreeLocalize(wrld->nodetree);
+
wrldn->preview= NULL;
return wrldn;