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:
authorJoseph Eagar <joeedh@gmail.com>2010-09-04 09:31:25 +0400
committerJoseph Eagar <joeedh@gmail.com>2010-09-04 09:31:25 +0400
commitbb7339a7aec37bdb2ee8a21599e6c65b37ef1277 (patch)
tree6fb8da94c6e43098c606f768e722484b04b8645c /source/blender/editors/render/render_shading.c
parent37f2c8a64c3277f100ab084ef1bb3846bc7b2c62 (diff)
parent8a320974f1b3e6004db3b3ad64f97742f878cbee (diff)
merge with trunk at r31523
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index f96e82a30f4..27ab8d06b04 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -52,7 +52,6 @@
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
-#include "BKE_utildefines.h"
#include "BKE_world.h"
#include "BKE_tessmesh.h"
@@ -210,6 +209,21 @@ static void image_changed(Main *bmain, Image *ima)
texture_changed(bmain, tex);
}
+static void scene_changed(Main *bmain, Scene *sce)
+{
+ Object *ob;
+ Material *ma;
+
+ /* glsl */
+ for(ob=bmain->object.first; ob; ob=ob->id.next)
+ if(ob->gpulamp.first)
+ GPU_lamp_free(ob);
+
+ for(ma=bmain->mat.first; ma; ma=ma->id.next)
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+}
+
void ED_render_id_flush_update(Main *bmain, ID *id)
{
if(!id)
@@ -231,6 +245,9 @@ void ED_render_id_flush_update(Main *bmain, ID *id)
case ID_IM:
image_changed(bmain, (Image*)id);
break;
+ case ID_SCE:
+ scene_changed(bmain, (Scene*)id);
+ break;
default:
break;
}
@@ -313,11 +330,11 @@ static int material_slot_assign_exec(bContext *C, wmOperator *op)
}
}
else if(ELEM(ob->type, OB_CURVE, OB_SURF)) {
- ListBase *editnurb= ((Curve*)ob->data)->editnurb;
Nurb *nu;
+ ListBase *nurbs= ED_curve_editnurbs((Curve*)ob->data);
- if(editnurb) {
- for(nu= editnurb->first; nu; nu= nu->next)
+ if(nurbs) {
+ for(nu= nurbs->first; nu; nu= nu->next)
if(isNurbsel(nu))
nu->mat_nr= nu->charidx= ob->actcol-1;
}
@@ -372,13 +389,13 @@ static int material_slot_de_select(bContext *C, int select)
*/
}
else if ELEM(ob->type, OB_CURVE, OB_SURF) {
- ListBase *editnurb= ((Curve*)ob->data)->editnurb;
+ ListBase *nurbs= ED_curve_editnurbs((Curve*)ob->data);
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
- for(nu= editnurb->first; nu; nu=nu->next) {
+ for(nu= nurbs->first; nu; nu=nu->next) {
if(nu->mat_nr==ob->actcol-1) {
if(nu->bezt) {
a= nu->pntsu;