[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21259] branches/soc-2009-yukishiro/source /blender: job and undo/redo don't go together...
Jingyuan Huang
jingyuan.huang at gmail.com
Tue Jun 30 07:56:41 CEST 2009
Revision: 21259
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21259
Author: yukishiro
Date: 2009-06-30 07:56:41 +0200 (Tue, 30 Jun 2009)
Log Message:
-----------
job and undo/redo don't go together...
Modified Paths:
--------------
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
branches/soc-2009-yukishiro/source/blender/makesdna/DNA_windowmanager_types.h
Modified: branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c 2009-06-30 04:37:00 UTC (rev 21258)
+++ branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c 2009-06-30 05:56:41 UTC (rev 21259)
@@ -236,42 +236,22 @@
Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C);
VPaint *lp= scene->toolsettings->lpaint;
- Base *base= NULL;
- Object *ob;
+ Object *ob= CTX_data_active_object(C);
Mesh *me;
DerivedMesh *dm;
int totface= 0;
- for (base = scene->basact; base; base = base->next) {
- ob = base->object;
- me = get_mesh(ob);
- if (me == NULL) continue;
+ me= get_mesh(ob);
+ if (me == NULL) return OPERATOR_CANCELLED;
- dm = mesh_get_derived_final(scene, ob, v3d->customdata_mask);
- totface += dm->getNumFaces(dm);
- }
+ dm = mesh_get_derived_final(scene, ob, v3d->customdata_mask);
+ totface += dm->getNumFaces(dm);
- if (totface == 0) {
- G.f &= ~G_LIGHTPAINT;
- return OPERATOR_FINISHED;
- }
-
if(totface >= MAXINDEX) {
- ob= CTX_data_active_object(C);
- me= get_mesh(ob);
-
- if(me==NULL || object_data_is_libdata(ob)) {
- G.f &= ~G_VERTEXPAINT;
- return OPERATOR_FINISHED;
- }
- if(me && me->totface>=MAXINDEX) {
- // TODO: output error message or pop out error message
- printf("Maximum number of faces: %d", MAXINDEX-1);
- G.f &= ~G_VERTEXPAINT;
- return OPERATOR_FINISHED;
- }
+ G.f &= ~G_VERTEXPAINT;
+ return OPERATOR_CANCELLED;
}
-
+
if(G.f & G_LIGHTPAINT) {
G.f &= ~G_LIGHTPAINT;
if(lp) {
@@ -282,17 +262,20 @@
else {
G.f |= G_LIGHTPAINT;
- light_paint_compute(C, 0);
-
if(lp==NULL)
lp= scene->toolsettings->lpaint= new_lpaint();
toggle_paint_cursor(C);
brush_check_exists(&scene->toolsettings->lpaint->brush);
+
+ //light_paint_compute(C, 0);
+ if (scene->lightenv == NULL)
+ add_lightenv(scene, "LightEnv");
+ SH_computeSceneCoefficients(scene,
+ get_viewedit_datamask(CTX_wm_screen(C)), 0, 0);
+ WM_event_add_notifier(C, NC_LIGHTENV|ND_SH_RESULT, NULL);
}
- // TODO: add to depsgraph?
-
ED_area_tag_redraw(CTX_wm_area(C));
return OPERATOR_FINISHED;
}
@@ -750,7 +733,7 @@
ot->idname = "PAINT_OT_light_paint_recompute";
ot->exec= light_paint_recompute;
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ //ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
Modified: branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c 2009-06-30 04:37:00 UTC (rev 21258)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c 2009-06-30 05:56:41 UTC (rev 21259)
@@ -2376,12 +2376,13 @@
}
if (G.f & G_LIGHTPAINT) {
- if (!(scene->flag & SCE_SH_RESULT)) {
- if (rv3d->rflag & RV3D_SHRESULT) {
- scene->flag |= SCE_SH_RESULT;
- }
+ if (rv3d->rflag & RV3D_SHRESULT) {
+ scene->flag |= SCE_SH_RESULT;
+ } else {
+ scene->flag &= ~SCE_SH_RESULT;
}
- if (rv3d->rflag & RV3D_SHRESULT) {
+
+ if (scene->flag & SCE_SH_RESULT) {
shcol= DM_get_face_data_layer(dm, CD_SH_MCOL);
if (shcol == NULL) shcol = add_sh_mcol_dm(scene, ob, dm);
Modified: branches/soc-2009-yukishiro/source/blender/makesdna/DNA_windowmanager_types.h
===================================================================
--- branches/soc-2009-yukishiro/source/blender/makesdna/DNA_windowmanager_types.h 2009-06-30 04:37:00 UTC (rev 21258)
+++ branches/soc-2009-yukishiro/source/blender/makesdna/DNA_windowmanager_types.h 2009-06-30 05:56:41 UTC (rev 21259)
@@ -121,8 +121,8 @@
/* should be somthing like DNA_EXCLUDE
* but the preprocessor first removes all comments, spaces etc */
-#
-#
+
+
typedef struct wmOperatorType {
struct wmOperatorType *next, *prev;
More information about the Bf-blender-cvs
mailing list