* Multiply for panorama cameras
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 30 Mar 2010 12:15:16 +0000 (12:15 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 30 Mar 2010 12:15:16 +0000 (12:15 +0000)
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
  by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
  Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
  /usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
  by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
  bpy.data.images.load(), missed this call.

(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)

24 files changed:
release/plugins/sequence/blur.c
release/scripts/io/import_scene_obj.py
release/scripts/modules/bpy_types.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_object.py
release/scripts/ui/space_text.py
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_hook.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_intern.h
source/blender/editors/space_file/filelist.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_text/text_ops.c
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/render/intern/raytrace/rayobject.cpp

index 261bfa4035121e2c633e0669c901b2ccf43cc6aa..c23a924ac6508f06274ad3cf8bc4c122e78f2b58 100644 (file)
@@ -160,7 +160,7 @@ void doblur(struct ImBuf *mbuf, float fac, Cast *cast)
        char *irect, *prect, *mrect;
        float *irectf, *prectf, *mrectf;
        
-       /* wich buffers ? */
+       /* which buffers ? */
                                
        if(fac>7.0) fac= 7.0;
        if(fac<=1.0) return;
index e12d0c8eaac4e0f53165122281a10267b7e96ce1..467aa5194b7217c4aa2e2534ede63a2eb435546b 100644 (file)
@@ -322,7 +322,7 @@ def load_image(imagepath, dirname):
 
     for path in variants:
         if os.path.exists(path):
-            return bpy.data.add_image(path)
+            return bpy.data.images.load(path)
         else:
             print(path, "doesn't exist")
 
index 060de71163771d5c3a22aa0507295c909a424cb6..16fac74b9d0f47d52193ed3028c80da0f56c776b 100644 (file)
@@ -490,7 +490,7 @@ class Header(StructRNA, _GenericUI):
 class Menu(StructRNA, _GenericUI):
     __slots__ = ()
 
-    def path_menu(self, searchpaths, operator):
+    def path_menu(self, searchpaths, operator, props_default={}):
         layout = self.layout
         # hard coded to set the operators 'path' to the filename.
 
@@ -511,7 +511,12 @@ class Menu(StructRNA, _GenericUI):
             if f.startswith("."):
                 continue
 
-            layout.operator(operator, text=bpy.utils.display_name(f)).path = path
+            props = layout.operator(operator, text=bpy.utils.display_name(f))
+
+            for attr, value in props_default.items():
+                setattr(props, attr, value)
+
+            props.path = path
 
     def draw_preset(self, context):
         """Define these on the subclass
index 8bf1617c12416689a1b3b0489539f343861262e3..b1013150d4b9b14406105e7672ba5d339940c752 100644 (file)
@@ -689,9 +689,12 @@ class DATA_PT_modifiers(DataButtonsPanel):
             if wide_ui:
                 col = split.column()
             sub = col.column(align=True)
-            sub.label(text="Aspect Ratio:")
-            sub.prop(md, "horizontal_aspect_ratio", text="Horizontal")
-            sub.prop(md, "vertical_aspect_ratio", text="Vertical")
+            sub.prop(md, "aspect_x", text="Aspect X")
+            sub.prop(md, "aspect_y", text="Aspect Y")
+
+            sub = col.column(align=True)
+            sub.prop(md, "scale_x", text="Scale X")
+            sub.prop(md, "scale_y", text="Scale Y")
 
     def WAVE(self, layout, ob, md, wide_ui):
         split = layout.split()
index d83253bf77182ad650f6cf6270ada807033fa789..36aa5c9c29e8b67496f2d7c9ba7f1c83925d106d 100644 (file)
@@ -35,12 +35,15 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
 
     def draw(self, context):
         layout = self.layout
-
+        space = context.space_data
         ob = context.object
 
         row = layout.row()
         row.label(text="", icon='OBJECT_DATA')
-        row.prop(ob, "name", text="")
+        if space.use_pin_id:
+            row.template_ID(space, "pin_id")
+        else:
+            row.prop(ob, "name", text="")
 
 
 class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel):
index 3a789566a6136c745bb9a5a3f50d024924e35c5e..9f52ae25121cd5c97dbdb852ed4056c7bb32b8e0 100644 (file)
@@ -177,7 +177,7 @@ class TEXT_MT_templates(bpy.types.Menu):
     bl_label = "Script Templates"
 
     def draw(self, context):
-        self.path_menu(bpy.utils.script_paths("templates"), "text.open")
+        self.path_menu(bpy.utils.script_paths("templates"), "text.open", {"internal": True})
 
 
 class TEXT_MT_edit_view(bpy.types.Menu):
index 454666566dc6230fab0d544d9ad47a018a3e6a5c..cb61a08f3ba3b72cef009bbdbeda429f5d6a999a 100644 (file)
@@ -53,7 +53,7 @@ int id_unlink(struct ID *id, int test);
 
 int new_id(struct ListBase *lb, struct ID *id, const char *name);
 
-struct ListBase *wich_libbase(struct Main *mainlib, short type);
+struct ListBase *which_libbase(struct Main *mainlib, short type);
 
 #define MAX_LIBARRAY   40
 int set_listbasepointers(struct Main *main, struct ListBase **lb);
index bea641d21403011ca0fbaaca3139a64bb57baeff..0eaafcb67ede7589cc7b2bff96f4145d0a157b23 100644 (file)
@@ -347,7 +347,7 @@ int id_unlink(ID *id, int test)
        if(id->us == 0) {
                if(test) return 1;
 
-               lb= wich_libbase(mainlib, GS(id->name));
+               lb= which_libbase(mainlib, GS(id->name));
                free_libblock(lb, id);
 
                return 1;
@@ -356,7 +356,7 @@ int id_unlink(ID *id, int test)
        return 0;
 }
 
-ListBase *wich_libbase(Main *mainlib, short type)
+ListBase *which_libbase(Main *mainlib, short type)
 {
        switch( type ) {
                case ID_SCE:
@@ -658,7 +658,7 @@ void *copy_libblock(void *rt)
        
        id= rt;
 
-       lb= wich_libbase(G.main, GS(id->name));
+       lb= which_libbase(G.main, GS(id->name));
        idn= alloc_libblock(lb, GS(id->name), id->name+2);
        
        if(idn==NULL) {
@@ -867,7 +867,7 @@ void free_main(Main *mainvar)
 
 ID *find_id(char *type, char *name)            /* type: "OB" or "MA" etc */
 {
-       ListBase *lb= wich_libbase(G.main, GS(type));
+       ListBase *lb= which_libbase(G.main, GS(type));
        return BLI_findstring(lb, name, offsetof(ID, name) + 2);
 }
 
@@ -1175,7 +1175,7 @@ int new_id(ListBase *lb, ID *id, const char *tname)
        if(id->lib) return 0;
 
        /* if no libdata given, look up based on ID */
-       if(lb==NULL) lb= wich_libbase(G.main, GS(id->name));
+       if(lb==NULL) lb= which_libbase(G.main, GS(id->name));
 
        /* if no name given, use name of current ID
         * else make a copy (tname args can be const) */
@@ -1348,7 +1348,7 @@ void test_idbutton(char *name)
        ID *idtest;
        
 
-       lb= wich_libbase(G.main, GS(name-2) );
+       lb= which_libbase(G.main, GS(name-2) );
        if(lb==0) return;
        
        /* search for id */
@@ -1383,7 +1383,7 @@ void rename_id(ID *id, char *name)
        ListBase *lb;
 
        strncpy(id->name+2, name, 21);
-       lb= wich_libbase(G.main, GS(id->name) );
+       lb= which_libbase(G.main, GS(id->name) );
        
        new_id(lb, id, name);                           
 }
index 7dc6babba38d30129b2d073d5c3190e062409b97..3777c920be53603fab3df6ace8e70f5e2eac744c 100644 (file)
@@ -3606,6 +3606,7 @@ static void uvprojectModifier_initData(ModifierData *md)
        umd->flags = 0;
        umd->num_projectors = 1;
        umd->aspectx = umd->aspecty = 1.0f;
+       umd->scalex = umd->scaley = 1.0f;
 }
 
 static void uvprojectModifier_copyData(ModifierData *md, ModifierData *target)
@@ -3621,6 +3622,8 @@ static void uvprojectModifier_copyData(ModifierData *md, ModifierData *target)
        tumd->num_projectors = umd->num_projectors;
        tumd->aspectx = umd->aspectx;
        tumd->aspecty = umd->aspecty;
+       tumd->scalex = umd->scalex;
+       tumd->scaley = umd->scaley;
 }
 
 static CustomDataMask uvprojectModifier_requiredDataMask(Object *ob, ModifierData *md)
@@ -3692,6 +3695,8 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
        char uvname[32];
        float aspx= umd->aspectx ? umd->aspectx : 1.0f;
        float aspy= umd->aspecty ? umd->aspecty : 1.0f;
+       float scax= umd->scalex ? umd->scalex : 1.0f;
+       float scay= umd->scaley ? umd->scaley : 1.0f;
        int free_uci= 0;
        
        aspect = aspx / aspy;
@@ -3829,6 +3834,22 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
                                                project_from_camera(tface->uv[2], coords[mf->v3], projectors[0].uci);
                                                if(mf->v3)
                                                        project_from_camera(tface->uv[3], coords[mf->v4], projectors[0].uci);
+                                               
+                                               if(scax != 1.0f) {
+                                                       tface->uv[0][0] = ((tface->uv[0][0] - 0.5f) * scax) + 0.5f;
+                                                       tface->uv[1][0] = ((tface->uv[1][0] - 0.5f) * scax) + 0.5f;
+                                                       tface->uv[2][0] = ((tface->uv[2][0] - 0.5f) * scax) + 0.5f;
+                                                       if(mf->v3)
+                                                               tface->uv[3][0] = ((tface->uv[3][0] - 0.5f) * scax) + 0.5f;
+                                               }
+                                               
+                                               if(scay != 1.0f) {
+                                                       tface->uv[0][1] = ((tface->uv[0][1] - 0.5f) * scay) + 0.5f;
+                                                       tface->uv[1][1] = ((tface->uv[1][1] - 0.5f) * scay) + 0.5f;
+                                                       tface->uv[2][1] = ((tface->uv[2][1] - 0.5f) * scay) + 0.5f;
+                                                       if(mf->v3)
+                                                               tface->uv[3][1] = ((tface->uv[3][1] - 0.5f) * scay) + 0.5f;
+                                               }
                                        }
                                        else {
                                                /* apply transformed coords as UVs */
@@ -6489,7 +6510,7 @@ static DerivedMesh *screwModifier_applyModifier(ModifierData *md, Object *ob,
                                                                ed_loop_flip= 1;
                                                        }
                                                        else {
-                                                               /* not so simple to work out wich edge is higher */
+                                                               /* not so simple to work out which edge is higher */
                                                                sub_v3_v3v3(tmp_vec1, tmpf1, vc_tmp->co);
                                                                sub_v3_v3v3(tmp_vec1, tmpf2, vc_tmp->co);
                                                                normalize_v3(tmp_vec1);
index a2f30ae5b01ebe4a9967af0b3da8b904d0020dcd..d9fea2483b9468fe37149aaf1f808c6a735f4af9 100644 (file)
@@ -293,10 +293,8 @@ void BLI_adddirstrings()
        struct direntry * file;
        struct tm *tm;
        time_t zero= 0;
-
-       file = &files[0];
        
-       for(num=0;num<actnum;num++){
+       for(num=0, file= files; num<actnum; num++, file++){
 #ifdef WIN32
                mode = 0;
                strcpy(file->mode1, types[0]);
@@ -325,43 +323,43 @@ void BLI_adddirstrings()
 #endif
 
 #ifdef WIN32
-               strcpy(files[num].owner,"user");
+               strcpy(file->owner,"user");
 #else
                {
                        struct passwd *pwuser;
-                       pwuser = getpwuid(files[num].s.st_uid);
+                       pwuser = getpwuid(file->s.st_uid);
                        if ( pwuser ) {
-                       strcpy(files[num].owner, pwuser->pw_name);
+                               BLI_strncpy(file->owner, pwuser->pw_name, sizeof(file->owner));
                        } else {
-                               sprintf(files[num].owner, "%d", files[num].s.st_uid);
+                               snprintf(file->owner, sizeof(file->owner), "%d", file->s.st_uid);
                        }
                }
 #endif
 
-               tm= localtime(&files[num].s.st_mtime);
+               tm= localtime(&file->s.st_mtime);
                // prevent impossible dates in windows
                if(tm==NULL) tm= localtime(&zero);
-               strftime(files[num].time, 8, "%H:%M", tm);
-               strftime(files[num].date, 16, "%d-%b-%y", tm);
+               strftime(file->time, 8, "%H:%M", tm);
+               strftime(file->date, 16, "%d-%b-%y", tm);
 
                /*
                 * Seems st_size is signed 32-bit value in *nix and Windows.  This
                 * will buy us some time until files get bigger than 4GB or until
                 * everyone starts using __USE_FILE_OFFSET64 or equivalent.
                 */
-               st_size= files[num].s.st_size;
+               st_size= file->s.st_size;
 
                if (st_size > 1024*1024*1024) {
-                       sprintf(files[num].size, "%.2f GB", ((double)st_size)/(1024*1024*1024));        
+                       sprintf(file->size, "%.2f GB", ((double)st_size)/(1024*1024*1024));     
                }
                else if (st_size > 1024*1024) {
-                       sprintf(files[num].size, "%.1f MB", ((double)st_size)/(1024*1024));
+                       sprintf(file->size, "%.1f MB", ((double)st_size)/(1024*1024));
                }
                else if (st_size > 1024) {
-                       sprintf(files[num].size, "%d KB", (int)(st_size/1024));
+                       sprintf(file->size, "%d KB", (int)(st_size/1024));
                }
                else {
-                       sprintf(files[num].size, "%d B", (int)st_size);
+                       sprintf(file->size, "%d B", (int)st_size);
                }
 
                strftime(datum, 32, "%d-%b-%y %H:%M", tm);
@@ -377,15 +375,13 @@ void BLI_adddirstrings()
                        sprintf(size, "%10d", (int) st_size);
                }
 
-               sprintf(buf,"%s %s %s %7s %s %s %10s %s", file->mode1, file->mode2, file->mode3, files[num].owner, files[num].date, files[num].time, size,
-                       files[num].relname);
+               sprintf(buf,"%s %s %s %7s %s %s %10s %s", file->mode1, file->mode2, file->mode3, file->owner, file->date, file->time, size,
+                       file->relname);
 
-               files[num].string=MEM_mallocN(strlen(buf)+1, "filestring");
-               if (files[num].string){
-                       strcpy(files[num].string,buf);
+               file->string=MEM_mallocN(strlen(buf)+1, "filestring");
+               if (file->string){
+                       strcpy(file->string,buf);
                }
-
-               file++;
        }
 }
 
index c6e3ef4767f6167f51978ab22d99e355dc4c3261..0ca21a68224b85c3fee2eba899bbcedc9806e447 100644 (file)
 #include "BKE_group.h"
 #include "BKE_image.h"
 #include "BKE_lattice.h"
-#include "BKE_library.h" // for wich_libbase
+#include "BKE_library.h" // for which_libbase
 #include "BKE_main.h" // for Main
 #include "BKE_mesh.h" // for ME_ defines (patching)
 #include "BKE_modifier.h"
@@ -429,7 +429,7 @@ static void split_libdata(ListBase *lb, Main *first)
                        mainvar= first;
                        while(mainvar) {
                                if(mainvar->curlib==id->lib) {
-                                       lbn= wich_libbase(mainvar, GS(id->name));
+                                       lbn= which_libbase(mainvar, GS(id->name));
                                        BLI_remlink(lb, id);
                                        BLI_addtail(lbn, id);
                                        break;
@@ -4684,7 +4684,7 @@ static void *restore_pointer_by_name(Main *mainp, ID *id, int user)
 {
                
        if(id) {
-               ListBase *lb= wich_libbase(mainp, GS(id->name));
+               ListBase *lb= which_libbase(mainp, GS(id->name));
                
                if(lb) {        // there's still risk of checking corrupt mem (freed Ids in oops)
                        ID *idn= lb->first;
@@ -5377,10 +5377,10 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
        
        /* do after read_struct, for dna reconstruct */
        if(bhead->code==ID_ID) {
-               lb= wich_libbase(main, GS(id->name));
+               lb= which_libbase(main, GS(id->name));
        }
        else {
-               lb= wich_libbase(main, bhead->code);
+               lb= which_libbase(main, bhead->code);
        }
        
        BLI_addtail(lb, id);
@@ -10959,8 +10959,8 @@ char *bhead_id_name(FileData *fd, BHead *bhead)
 static ID *is_yet_read(FileData *fd, Main *mainvar, BHead *bhead)
 {
        const char *idname= bhead_id_name(fd, bhead);
-       /* wich_libbase can be NULL, intentionally not using idname+2 */
-       return BLI_findstring(wich_libbase(mainvar, GS(idname)), idname, offsetof(ID, name));
+       /* which_libbase can be NULL, intentionally not using idname+2 */
+       return BLI_findstring(which_libbase(mainvar, GS(idname)), idname, offsetof(ID, name));
 }
 
 static void expand_doit(FileData *fd, Main *mainvar, void *old)
index 5e3a976446d7f1be8357ed4dd6367a6a99574728..1267a1c173729084e129e91ce10ee08a306363d6 100644 (file)
@@ -2693,7 +2693,7 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname)
 static void autocomplete_id(bContext *C, char *str, void *arg_v)
 {
        int blocktype= (intptr_t)arg_v;
-       ListBase *listb= wich_libbase(CTX_data_main(C), blocktype);
+       ListBase *listb= which_libbase(CTX_data_main(C), blocktype);
        
        if(listb==NULL) return;
        
index c3e691a086446ba7749ee7f343a034c7d53f9ac8..73ac123f9644f27e65b2239078850aee4daff8d2 100644 (file)
@@ -497,7 +497,7 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char
                flag |= UI_ID_OPEN;
        
        type= RNA_property_pointer_type(ptr, prop);
-       template->idlb= wich_libbase(CTX_data_main(C), RNA_type_to_ID_code(type));
+       template->idlb= which_libbase(CTX_data_main(C), RNA_type_to_ID_code(type));
        
        /* create UI elements for this template
         *      - template_ID makes a copy of the template data and assigns it to the relevant buttons
index 37a04471ec5ec75db64fea2cc0569e9a20666a35..624b4985f97e9aa3ed1bc92d17af28e8291a7447 100644 (file)
@@ -54,6 +54,7 @@
 
 #include "RNA_define.h"
 #include "RNA_access.h"
+#include "RNA_enum_types.h"
 
 #include "ED_curve.h"
 #include "ED_mesh.h"
@@ -529,9 +530,6 @@ void OBJECT_OT_hook_add_newobj(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
-static EnumPropertyItem hook_mod_items[]= {
-{0, NULL, 0, NULL, NULL}};
-
 static int object_hook_remove_exec(bContext *C, wmOperator *op)
 {
        int num= RNA_enum_get(op->ptr, "modifier");
@@ -566,7 +564,7 @@ static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *ptr, int *free)
        int a, totitem= 0;
        
        if(!ob)
-               return hook_mod_items;
+               return DummyRNA_NULL_items;
        
        for(a=0, md=ob->modifiers.first; md; md= md->next, a++) {
                if (md->type==eModifierType_Hook) {
@@ -602,7 +600,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
-       prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to remove.");
+       prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove.");
        RNA_def_enum_funcs(prop, hook_mod_itemf);
        ot->prop= prop;
 }
@@ -669,7 +667,7 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
-       prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to assign to.");
+       prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to.");
        RNA_def_enum_funcs(prop, hook_mod_itemf);
 }
 
@@ -725,7 +723,7 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
-       prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to assign to.");
+       prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to.");
        RNA_def_enum_funcs(prop, hook_mod_itemf);
 }
 
@@ -788,7 +786,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
-       prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to assign to.");
+       prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to.");
        RNA_def_enum_funcs(prop, hook_mod_itemf);
 }
 
@@ -837,7 +835,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
-       prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to remove.");
+       prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove.");
        RNA_def_enum_funcs(prop, hook_mod_itemf);
 }
 
index e1df3b9f18fa182d2f5b120bfb60ea07945a1698..961c3cf17ce041afdc33f968b13db7e36b13b0ee 100644 (file)
@@ -816,21 +816,9 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
 static void pin_cb(bContext *C, void *arg1, void *arg2)
 {
        SpaceButs *sbuts= CTX_wm_space_buts(C);
-       ButsContextPath *path= sbuts->path;
-       PointerRNA *ptr;
-       int a;
 
        if(sbuts->flag & SB_PIN_CONTEXT) {
-               if(path->len) {
-                       for(a=path->len-1; a>=0; a--) {
-                               ptr= &path->ptr[a];
-
-                               if(ptr->id.data) {
-                                       sbuts->pinid= ptr->id.data;
-                                       break;
-                               }
-                       }
-               }
+               sbuts->pinid= buttons_context_id_path(C);
        }
        else
                sbuts->pinid= NULL;
@@ -901,3 +889,24 @@ void buttons_context_register(ARegionType *art)
        pt->flag= PNL_NO_HEADER;
        BLI_addtail(&art->paneltypes, pt);
 }
+
+ID *buttons_context_id_path(const bContext *C)
+{
+       SpaceButs *sbuts= CTX_wm_space_buts(C);
+       ButsContextPath *path= sbuts->path;
+       PointerRNA *ptr;
+       int a;
+
+       if(path->len) {
+               for(a=path->len-1; a>=0; a--) {
+                       ptr= &path->ptr[a];
+
+                       if(ptr->id.data) {
+                               return ptr->id.data;
+                               break;
+                       }
+               }
+       }
+
+       return NULL;
+}
index f28d77159a553f9aae2141321d9b4181da51c58e..9478168f35aeeffb98c018e52e86ea782eccd534 100644 (file)
@@ -35,6 +35,7 @@ struct bContextDataResult;
 struct SpaceButs;
 struct uiLayout;
 struct wmOperatorType;
+struct ID;
 
 /* buts->scaflag */            
 #define BUTS_SENS_SEL          1
@@ -62,6 +63,7 @@ void buttons_context_compute(const struct bContext *C, struct SpaceButs *sbuts);
 int buttons_context(const struct bContext *C, const char *member, struct bContextDataResult *result);
 void buttons_context_draw(const struct bContext *C, struct uiLayout *layout);
 void buttons_context_register(struct ARegionType *art);
+struct ID *buttons_context_id_path(const struct bContext *C);
 
 /* buttons_ops.c */
 void BUTTONS_OT_file_browse(struct wmOperatorType *ot);
index dc818bb9172a780b900c00f8aee2f286f3dfce3c..9dd16586946773c9a17a47a683fa92eb0fb8ae54 100644 (file)
@@ -1172,7 +1172,7 @@ void filelist_from_main(struct FileList *filelist)
                /* make files */
                idcode= groupname_to_code(filelist->dir);
                
-               lb= wich_libbase(G.main, idcode );
+               lb= which_libbase(G.main, idcode );
                if(lb==0) return;
                
                id= lb->first;
index 26275434c8439b2b02b951e1059c5609fde651ac..e641f720054298c2fbe3455c11aa2c6d9f1d23b2 100644 (file)
@@ -625,6 +625,15 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn)
                                        ED_area_tag_redraw(sa);
                                        break;
                        }
+               case NC_OBJECT:
+                       switch(wmn->data) {
+                               case ND_TRANSFORM:
+                                       if(sima->lock && (sima->flag & SI_DRAWSHADOW)) {
+                                               ED_area_tag_refresh(sa);
+                                               ED_area_tag_redraw(sa);
+                                       }
+                                       break;
+                       }
        }
 }
 
index 0f3b54a7b4bf3b3ba83ee27cdf67562146017d0f..ce7db83d6d82e3c7c293238f3fb78c958f900428 100644 (file)
@@ -215,6 +215,7 @@ static int open_exec(bContext *C, wmOperator *op)
        PropertyPointerRNA *pprop;
        PointerRNA idptr;
        char str[FILE_MAX];
+       short internal = RNA_int_get(op->ptr, "internal");
 
        RNA_string_get(op->ptr, "path", str);
 
@@ -244,6 +245,13 @@ static int open_exec(bContext *C, wmOperator *op)
                st->text= text;
                st->top= 0;
        }
+       
+       if (internal) {
+               if(text->name)
+                       MEM_freeN(text->name);
+               
+               text->name = NULL;
+       }
 
        WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text);
 
@@ -282,6 +290,7 @@ void TEXT_OT_open(wmOperatorType *ot)
 
        /* properties */
        WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE);
+       RNA_def_boolean(ot->srna, "internal", 0, "Make internal", "Make text file internal after loading");
 }
 
 /******************* reload operator *********************/
index 44c1bdff876542584ff30c5ac303ea263fe6d303..6bdecd8c7c6fa0b468348ace72e216963a56422b 100644 (file)
@@ -318,6 +318,7 @@ typedef struct UVProjectModifierData {
        int flags;
        int num_projectors;
        float aspectx, aspecty;
+       float scalex, scaley;                                                                                           
        char uvlayer_name[32];
        int uvlayer_tmp, pad;
 } UVProjectModifierData;
index 4adb462c8d18d755e08f70421d290589e9ff9706..4abf9793e727519e43ea437b5e9e9cc2dbcd2400 100644 (file)
@@ -1317,19 +1317,33 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-       prop= RNA_def_property(srna, "horizontal_aspect_ratio", PROP_FLOAT, PROP_NONE);
+       prop= RNA_def_property(srna, "aspect_x", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "aspectx");
        RNA_def_property_range(prop, 1, FLT_MAX);
-       RNA_def_property_ui_range(prop, 1, 1000, 100, 2);
+       RNA_def_property_ui_range(prop, 1, 1000, 0.2, 2);
        RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", "");
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-       prop= RNA_def_property(srna, "vertical_aspect_ratio", PROP_FLOAT, PROP_NONE);
+       prop= RNA_def_property(srna, "aspect_y", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "aspecty");
        RNA_def_property_range(prop, 1, FLT_MAX);
-       RNA_def_property_ui_range(prop, 1, 1000, 100, 2);
+       RNA_def_property_ui_range(prop, 1, 1000, 0.2, 2);
        RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", "");
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
+       
+       prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "scalex");
+       RNA_def_property_range(prop, 0, FLT_MAX);
+       RNA_def_property_ui_range(prop, 0, 1000, 0.2, 2);
+       RNA_def_property_ui_text(prop, "Horizontal Scale", "");
+       RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+       prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "scaley");
+       RNA_def_property_range(prop, 0, FLT_MAX);
+       RNA_def_property_ui_range(prop, 0, 1000, 0.2, 2);
+       RNA_def_property_ui_text(prop, "Vertical Scale", "");
+       RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
        prop= RNA_def_property(srna, "override_image", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE);
index 4885a3122f78312de2177aa1014ceb082b323486..9bf9abce2b96ab6af568eee6c4a70b257b7e73e4 100644 (file)
@@ -2332,7 +2332,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
        RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
        RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders");
-       RNA_def_struct_name_property(srna, prop);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
        prop= RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
index 3d2530d9fe0aec85dcffef55ba14e7d2df70d6bf..8dad6f5c435d53f19866e782126edc0b10cb23a9 100644 (file)
@@ -1183,6 +1183,10 @@ static void rna_def_space_buttons(BlenderRNA *brna)
        RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef");
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
+
+       prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
+       RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
 }
 
 static void rna_def_space_image(BlenderRNA *brna)
@@ -1847,15 +1851,11 @@ static void rna_def_space_console(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Show Error", "Display error text");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL);
 
-       
-       
        prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
-       RNA_def_struct_name_property(srna, prop);
        
        prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
-       RNA_def_struct_name_property(srna, prop);
 
        prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
        RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
index 024577e9f1f2ec57dc462443f43f1ca83cb3246b..b9e9a46b1a9ee8e350f6742ffae4a4c260a1d064 100644 (file)
@@ -333,7 +333,7 @@ static int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *is)
 
                RE_RC_COUNT(is->raycounter->faces.hit);
 
-               is->isect= ok;  // wich half of the quad
+               is->isect= ok;  // which half of the quad
                is->labda= labda;
                is->u= u; is->v= v;