Revision: 20787
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20787
Author:   yukishiro
Date:     2009-06-10 18:34:36 +0200 (Wed, 10 Jun 2009)

Log Message:
-----------
merge with Ton's brush fix (20781:20785)

Modified Paths:
--------------
    branches/soc-2009-yukishiro/release/ui/space_sequencer.py
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/library.c
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/lightenv.c
    branches/soc-2009-yukishiro/source/blender/blenloader/intern/readfile.c
    branches/soc-2009-yukishiro/source/blender/blenloader/intern/writefile.c
    branches/soc-2009-yukishiro/source/blender/editors/include/UI_interface.h
    branches/soc-2009-yukishiro/source/blender/editors/interface/interface.c
    
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_handlers.c
    
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_regions.c
    
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_utils.c
    
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_widgets.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
    
branches/soc-2009-yukishiro/source/blender/editors/space_view3d/view3d_buttons.c
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/DNA_world_types.h
    branches/soc-2009-yukishiro/source/blender/makesdna/intern/makesdna.c
    branches/soc-2009-yukishiro/source/blender/makesrna/intern/rna_sequence.c
    branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c

Modified: branches/soc-2009-yukishiro/release/ui/space_sequencer.py
===================================================================
--- branches/soc-2009-yukishiro/release/ui/space_sequencer.py   2009-06-10 
15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/release/ui/space_sequencer.py   2009-06-10 
16:34:36 UTC (rev 20787)
@@ -391,7 +391,7 @@
                if not strip:
                        return False
                
-               return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
+               return strip.type in ('MOVIE', 'IMAGE', 'SOUND')
        
        def draw(self, context):
                layout = self.layout
@@ -404,13 +404,16 @@
                sub = split.column() 
                sub.itemR(strip, "directory", text="")
                
-               # TODO - get current element!
+               # Current element for the filename
                split = layout.split(percentage=0.3)
                sub = split.column()
                sub.itemL(text="File Name:")
-               sub = split.column() 
-               sub.itemR(strip.elements[0], "filename", text="")
+               sub = split.column()
                
+               elem = strip.getStripElem(context.scene.current_frame)
+               if elem:
+                       sub.itemR(elem, "filename", text="") # 
strip.elements[0] could be a fallback
+               
                """
                layout.itemR(strip, "use_crop")
                

Modified: branches/soc-2009-yukishiro/source/blender/blenkernel/intern/library.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenkernel/intern/library.c      
2009-06-10 15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/source/blender/blenkernel/intern/library.c      
2009-06-10 16:34:36 UTC (rev 20787)
@@ -80,6 +80,7 @@
 #include "DNA_windowmanager_types.h"
 #include "DNA_anim_types.h"
 #include "DNA_gpencil_types.h"
+#include "DNA_lightenv_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_dynstr.h"
@@ -209,6 +210,8 @@
                        return &(mainlib->wm);
                case ID_GD:
                        return &(mainlib->gpencil);
+                case ID_LE:
+                        return &(mainlib->lightenv);
        }
        return 0;
 }
@@ -388,6 +391,9 @@
                case ID_GD:
                        id = MEM_callocN(sizeof(bGPdata), "Grease Pencil");
                        break;
+                case ID_LE:
+                        id = MEM_callocN(sizeof(LightEnv), "light env");
+                        break;
        }
        return id;
 }
@@ -594,6 +600,9 @@
                case ID_GD:
                        free_gpencil_data((bGPdata *)id);
                        break;
+                case ID_LE:
+                        free_lightenv((LightEnv *)id);
+                        break;
        }
 
        if (id->properties) {

Modified: 
branches/soc-2009-yukishiro/source/blender/blenkernel/intern/lightenv.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenkernel/intern/lightenv.c     
2009-06-10 15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/source/blender/blenkernel/intern/lightenv.c     
2009-06-10 16:34:36 UTC (rev 20787)
@@ -49,7 +49,7 @@
 
 #include "SH_api.h"
 
-LightEnv deflightenv;
+//LightEnv deflightenv;
 
 
 // TODO: simple function to return value for 3 channels. needs improvement
@@ -90,17 +90,16 @@
         IMB_freeImBuf(ibuf);
 }
 
-/* called on startup, in SH_init() */
-void init_def_lightenv(void)
-{
-        deflightenv.type = LE_DEFAULT;
-        deflightenv.func = def_synthetic;
-        SH_ComputeLightCoefficients(&deflightenv);
-}
+///* called on startup, in SH_init() */
+//void init_def_lightenv(void)
+//{
+//        deflightenv.type = LE_DEFAULT;
+//        deflightenv.func = def_synthetic;
+//        SH_ComputeLightCoefficients(&deflightenv);
+//}
 
 void free_lightenv(LightEnv *env)
 {
-        // free probe 
 }
 
 
@@ -110,6 +109,7 @@
 
        env= alloc_libblock(&G.main->lightenv, ID_LE, name);
         env->type = LE_DEFAULT;
+        env->func = def_synthetic;
         SH_ComputeLightCoefficients(env);
 
         return env;
@@ -118,11 +118,10 @@
 
 LightEnv* get_scene_lightenv(Scene *scene)
 {
-        World *world = scene->world;
+        if (scene->lightenv == NULL)
+                scene->lightenv = add_lightenv("LightEnv");
 
-        if (world == NULL) return &deflightenv;
-        if (world->lightenv == NULL) return &deflightenv;
-        return world->lightenv;
+        return scene->lightenv;
 }
 
 

Modified: 
branches/soc-2009-yukishiro/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenloader/intern/readfile.c     
2009-06-10 15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/source/blender/blenloader/intern/readfile.c     
2009-06-10 16:34:36 UTC (rev 20787)
@@ -71,6 +71,7 @@
 #include "DNA_key_types.h"
 #include "DNA_lattice_types.h"
 #include "DNA_lamp_types.h"
+#include "DNA_lightenv_types.h"
 #include "DNA_meta_types.h"
 #include "DNA_material_types.h"
 #include "DNA_mesh_types.h"
@@ -3825,14 +3826,25 @@
                        
                        sce->camera= newlibadr(fd, sce->id.lib, sce->camera);
                        sce->world= newlibadr_us(fd, sce->id.lib, sce->world);
+                       sce->lightenv = newlibadr_us(fd, sce->id.lib, 
sce->lightenv);
                        sce->set= newlibadr(fd, sce->id.lib, sce->set);
                        sce->ima= newlibadr_us(fd, sce->id.lib, sce->ima);
+                       
                        sce->toolsettings->imapaint.brush=
                                newlibadr_us(fd, sce->id.lib, 
sce->toolsettings->imapaint.brush);
                        if(sce->toolsettings->sculpt)
                                sce->toolsettings->sculpt->brush=
                                        newlibadr_us(fd, sce->id.lib, 
sce->toolsettings->sculpt->brush);
-
+                       if(sce->toolsettings->vpaint)
+                               sce->toolsettings->vpaint->brush=
+                                       newlibadr_us(fd, sce->id.lib, 
sce->toolsettings->vpaint->brush);
+                       if(sce->toolsettings->wpaint)
+                               sce->toolsettings->wpaint->brush=
+                                       newlibadr_us(fd, sce->id.lib, 
sce->toolsettings->wpaint->brush);
+                        if(sce->toolsettings->lpaint)
+                               sce->toolsettings->lpaint->brush=
+                                       newlibadr_us(fd, sce->id.lib, 
sce->toolsettings->lpaint->brush);
+                       
                        sce->toolsettings->skgen_template = newlibadr(fd, 
sce->id.lib, sce->toolsettings->skgen_template);
 
                        for(base= sce->base.first; base; base= next) {

Modified: 
branches/soc-2009-yukishiro/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenloader/intern/writefile.c    
2009-06-10 15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/source/blender/blenloader/intern/writefile.c    
2009-06-10 16:34:36 UTC (rev 20787)
@@ -112,6 +112,7 @@
 #include "DNA_lattice_types.h"
 #include "DNA_listBase.h" /* for Listbase, the type of samples, ...*/
 #include "DNA_lamp_types.h"
+#include "DNA_lightenv_types.h"
 #include "DNA_meta_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
@@ -1733,8 +1734,7 @@
 {
         LightEnv *env;
         
-        env = idbase->first;
-        while (env) {
+        for (env = idbase->first; env; env= env->id.next) {
                 if (env->id.us > 0 || wd->current) {
                         writestruct(wd, ID_LE, "LightEnv", 1, env);
                        if (env->id.properties) 
IDP_WriteProperty(env->id.properties, wd);

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/include/UI_interface.h
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/include/UI_interface.h   
2009-06-10 15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/source/blender/editors/include/UI_interface.h   
2009-06-10 16:34:36 UTC (rev 20787)
@@ -399,6 +399,8 @@
 uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, 
int icon, char *str, short x1, short y1, short x2, short y2, char *tip);
 
 uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *func_arg1, 
char *str, short x1, short y1, short x2, short y2, char *tip);
+uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char 
*str, short x1, short y1, short x2, short y2, char *tip);
+
 uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, 
int retval, int icon, short x1, short y1, short x2, short y2, char *tip);
 uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void 
*arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip);
 

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/interface/interface.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/interface/interface.c    
2009-06-10 15:56:38 UTC (rev 20786)
+++ branches/soc-2009-yukishiro/source/blender/editors/interface/interface.c    
2009-06-10 16:34:36 UTC (rev 20787)
@@ -432,6 +432,7 @@
 
 /* ************** BLOCK ENDING FUNCTION ************* */
 
+/* NOTE: if but->poin is allocated memory for every defbut, things fail... */
 static int ui_but_equals_old(uiBut *but, uiBut *oldbut)
 {
        /* various properties are being compared here, hopfully sufficient
@@ -3012,6 +3013,16 @@
        return but;
 }
 
+uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char 
*str, short x1, short y1, short x2, short y2, char *tip)
+{
+       uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, NULL, 0.0, 
0.0, 0.0, 0.0, tip);
+       but->block_create_func= func;
+       but->func_argN= argN;
+       ui_check_but(but);
+       return but;
+}
+
+
 uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, 
char *str, short x1, short y1, short x2, short y2, char *tip)
 {
        uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 
0.0, 0.0, 0.0, 0.0, tip);
@@ -3095,7 +3106,6 @@
        but->flag|= UI_HAS_ICON;
        
        but->flag|= UI_ICON_LEFT|UI_TEXT_LEFT;
-       but->flag|= UI_ICON_SUBMENU;
        
        ui_check_but(but);
        

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_handlers.c
===================================================================
--- 
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_handlers.c
   2009-06-10 15:56:38 UTC (rev 20786)
+++ 
branches/soc-2009-yukishiro/source/blender/editors/interface/interface_handlers.c
   2009-06-10 16:34:36 UTC (rev 20787)
@@ -1494,7 +1494,7 @@
                        }
                        else {
                                func= but->block_create_func;
-                               arg= but->poin;
+                               arg= but->poin?but->poin:but->func_argN;
                        }
                        break;
                case MENU:
@@ -2078,6 +2078,7 @@
 
 static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, 
wmEvent *event)
 {
+       
        if(data->state == BUTTON_STATE_HIGHLIGHT) {
                if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && 
event->val==KM_PRESS) {
                        button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
@@ -3112,7 +3113,7 @@
                        but->block->auto_open= 0;
 
        button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT);
-
+       

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to