Merging r42394 through r42412 form trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 4 Dec 2011 17:26:35 +0000 (17:26 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 4 Dec 2011 17:26:35 +0000 (17:26 +0000)
13 files changed:
intern/cycles/util/util_boundbox.h
intern/cycles/util/util_math.h
release/scripts/startup/bl_ui/properties_texture.py
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/object/object_bake.c
source/blender/imbuf/intern/allocimbuf.c
source/blender/imbuf/intern/thumbs.c
source/blender/makesdna/DNA_scene_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c

index 24ea3655576d69cc93ff11f89fdb2022d7f6a036..0114a9a26a5af2f41c173b66eb98c7f2e0c9c8b4 100644 (file)
 #ifndef __UTIL_BOUNDBOX_H__
 #define __UTIL_BOUNDBOX_H__
 
+#include <math.h>
 #include <float.h>
-#include <cmath>
 
+#include "util_math.h"
 #include "util_transform.h"
 #include "util_types.h"
 
+using namespace std;
+
 CCL_NAMESPACE_BEGIN
 
 class BoundBox
@@ -73,8 +76,8 @@ public:
        bool valid(void) const
        {
                return (min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z) &&
-                      !(std::isnan(min.x) || std::isnan(min.y) || std::isnan(min.z)) &&
-                      !(std::isnan(max.x) || std::isnan(max.y) || std::isnan(max.z));
+                      !(isnan(min.x) || isnan(min.y) || isnan(min.z)) &&
+                      !(isnan(max.x) || isnan(max.y) || isnan(max.z));
        }
 
        BoundBox transformed(const Transform *tfm)
index 2f9e00dbfcbab08e7159b8f8f32a1ae781d01865..7c56f0fbb124fcc10eb435766998044fe07842d7 100644 (file)
@@ -63,6 +63,7 @@ CCL_NAMESPACE_BEGIN
 #if(!defined(FREE_WINDOWS))
 #define copysignf(x, y) ((float)_copysign(x, y))
 #define hypotf(x, y) _hypotf(x, y)
+#define isnan(x) _isnan(x)
 #endif
 
 #endif
index 9f67edd76532f58c2f221d3f069e8fc256e229be..d16b2f15f524cead811b46928601f1eeb51a8bbe 100644 (file)
@@ -166,6 +166,10 @@ class TEXTURE_PT_preview(TextureButtonsPanel, Panel):
             layout.template_preview(tex, parent=idblock, slot=slot)
         else:
             layout.template_preview(tex, slot=slot)
+            
+        #Show Alpha Button for Brush Textures, see #29502
+        if context.space_data.texture_context == 'BRUSH':
+            layout.prop(tex, "use_preview_alpha")
 
 
 class TEXTURE_PT_colors(TextureButtonsPanel, Panel):
index 8ccc3eedbdb967d390f022781fa3cc53aa0cb057..60d5c19bff73807bfb31a12c283da94abb467024 100644 (file)
@@ -127,17 +127,17 @@ void BKE_tracking_clamp_track(MovieTrackingTrack *track, int event)
        }
        else if(event==CLAMP_PAT_POS) {
                float dim[2];
-               sub_v2_v2v2(dim, track->pat_max, pat_min);
+               sub_v2_v2v2(dim, track->pat_max, track->pat_min);
 
                for(a= 0; a<2; a++) {
                        /* pattern shouldn't be moved outside of search */
                        if(pat_min[a] < track->search_min[a]) {
                                track->pat_min[a]= track->search_min[a] - (pat_min[a] - track->pat_min[a]);
-                               track->pat_max[a]=  (pat_min[a] - track->pat_min[a])+dim[a];
+                               track->pat_max[a]= track->pat_min[a] + dim[a];
                        }
                        if(track->pat_max[a] > track->search_max[a]) {
                                track->pat_max[a]= track->search_max[a] - (pat_max[a] - track->pat_max[a]);
-                               track->pat_min[a]= track->pat_max[a]-dim[a] - (pat_min[a] - track->pat_min[a]);
+                               track->pat_min[a]= track->pat_max[a] - dim[a];
                        }
                }
        }
@@ -790,7 +790,7 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
                                                patx= (int)((track->pat_max[0]-track->pat_min[0])*width);
                                                paty= (int)((track->pat_max[1]-track->pat_min[1])*height);
 
-                                               if(track->tracker==TRACKER_KLT || track->tracker==TRACKER_HYBRID) {
+                                               if(ELEM(track->tracker, TRACKER_KLT, TRACKER_HYBRID)) {
                                                        float search_size_x= (track->search_max[0]-track->search_min[0])*width;
                                                        float search_size_y= (track->search_max[1]-track->search_min[1])*height;
                                                        float pattern_size_x= (track->pat_max[0]-track->pat_min[0])*width;
@@ -1206,7 +1206,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
                           marker->pos[1]<margin[1] || marker->pos[1]>1.0f-margin[1]) {
                                onbound= 1;
                        }
-                       else if(track->tracker==TRACKER_KLT || track->tracker==TRACKER_HYBRID) {
+                       else if(ELEM(track->tracker, TRACKER_KLT, TRACKER_HYBRID)) {
                                float *patch_new;
 
                                if(need_readjust) {
index 8ad6cfc7cdf2929399ad44e75de154d3d3fa6c32..140e1752648789e2292fb92325c5ba5bedd2a3ca 100644 (file)
@@ -56,6 +56,7 @@
 #include "DNA_image_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_modifier_types.h"
+#include "DNA_movieclip_types.h"
 #include "DNA_object_fluidsim.h"
 #include "DNA_object_force.h"
 #include "DNA_object_types.h"
@@ -542,6 +543,12 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
                        }
                }
                break;
+       case ID_MC:
+               {
+                       MovieClip *clip= (MovieClip *)id;
+                       rewrite_path_fixed(clip->name, visit_cb, absbase, bpath_user_data);
+               }
+               break;
        default:
                /* Nothing to do for other IDs that don't contain file paths. */
                break;
index c80b062463d2fe39759f942d49edb00a35f0ef82..c72bc17cc1cbc3118e42a8768b2c8ec87a2541f8 100644 (file)
@@ -10403,13 +10403,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        wrld->maxphystep = 5;
                }
        }
-
-       if (main->versionfile < 249) {
-               Scene *sce;
-               for (sce= main->scene.first; sce; sce= sce->id.next)
-                       sce->r.renderer= 0;
-               
-       }
        
        // correct introduce of seed for wind force
        if (main->versionfile < 249 && main->subversionfile < 1) {
index eb7e06623f7cfa726b1d6b9fbcd461d8845dfb4a..7f01d4f031da5683f6be81c5679b08990e84c75b 100644 (file)
@@ -1223,7 +1223,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
                                uiDefButS(block, ROW, B_MATPRV, IFACE_("World"),  0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
                        uiDefButS(block, ROW, B_MATPRV, IFACE_("Both"),  0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, "");
                        
-                       /* Alpha buton for texture preview */
+                       /* Alpha button for texture preview */
                        if(*pr_texture!=TEX_PR_OTHER) {
                                row = uiLayoutRow(layout, 0);
                                uiItemR(row, &texture_ptr, "use_preview_alpha", 0, NULL, ICON_NONE);
index cf55a5317a551095e4c39af5ef71a9f35bd3d437..d1d41af1e50e208daeb4d2344de4e5027e42fa67 100644 (file)
@@ -1259,9 +1259,7 @@ static int test_bake_internal(bContext *C, ReportList *reports)
 {
        Scene *scene= CTX_data_scene(C);
 
-       if(scene->r.renderer!=R_INTERN) {
-               BKE_report(reports, RPT_ERROR, "Bake only supported for Internal Renderer");
-       } else if((scene->r.bake_flag & R_BAKE_TO_ACTIVE) && CTX_data_active_object(C)==NULL) {
+       if((scene->r.bake_flag & R_BAKE_TO_ACTIVE) && CTX_data_active_object(C)==NULL) {
                BKE_report(reports, RPT_ERROR, "No active object");
        }
        else if(scene->r.bake_mode==RE_BAKE_AO && scene->world==NULL) {
index d08c86aacbc2f49778e59e668eeef561c0443557..d85251a8ccb6a03ea3220c487a1b6b36db512eb4 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * allocimbuf.c
- *
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -47,8 +44,8 @@
 
 #include "imbuf.h"
 
-#include "MEM_CacheLimiterC-Api.h"
 #include "MEM_guardedalloc.h"
+#include "MEM_CacheLimiterC-Api.h"
 
 void imb_freemipmapImBuf(ImBuf *ibuf)
 {
index 41278e8381a39e1a313f5e6f6c44aed00599fc09..19eb917469df16060cbe6dcfa908075cdb9e29bc 100644 (file)
@@ -309,7 +309,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
 
                                if (img != NULL) {
                                        stat(path, &info);
-                                       BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime);
+                                       BLI_snprintf(mtime, sizeof(mtime), "%ld", (long int)info.st_mtime);
                                        BLI_snprintf(cwidth, sizeof(cwidth), "%d", img->x);
                                        BLI_snprintf(cheight, sizeof(cheight), "%d", img->y);
                                }
@@ -327,7 +327,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
                                        IMB_free_anim(anim);
                                }
                                stat(path, &info);
-                               BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime);
+                               BLI_snprintf(mtime, sizeof(mtime), "%ld", (long int)info.st_mtime);
                        }
                        if (!img) return NULL;
 
index d8d3f05ce0167c0efafded51cf43fcba1ed402be..1b849754db84c3599d93c130ebc69fc2d46653ac 100644 (file)
@@ -389,8 +389,7 @@ typedef struct RenderData {
         */
        short raytrace_structure;
 
-       /* renderer (deprecated) */
-       short renderer  DNA_DEPRECATED;
+       short pad1;
 
        /* octree resolution */
        short ocres;
@@ -1036,10 +1035,6 @@ typedef struct Scene {
 #define R_FILTER_MITCH 6
 #define R_FILTER_FAST_GAUSS    7 /* note, this is only used for nodes at the moment */
 
-/* yafray: renderer flag (not only exclusive to yafray) */
-#define R_INTERN       0
-#define R_YAFRAY       1
-
 /* raytrace structure */
 #define R_RAYSTRUCTURE_AUTO                            0
 #define R_RAYSTRUCTURE_OCTREE                  1
index 00a53349141346cc4611a6cff0e6945328bf7dcd..d396522b8d0963326cd1299890e41872d28376a3 100644 (file)
@@ -1718,7 +1718,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
                        sd.adapt_angle = cosf(DEG2RADF((float)part->adapt_angle));
                }
 
-               if(re->r.renderer==R_INTERN && part->draw&PART_DRAW_REN_STRAND) {
+               if (part->draw & PART_DRAW_REN_STRAND) {
                        strandbuf= RE_addStrandBuffer(obr, (totpart+totchild)*(path_nbr+1));
                        strandbuf->ma= ma;
                        strandbuf->lay= ob->lay;
@@ -3872,8 +3872,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
                        }
                }
        }
-       /* yafray: shadow flag should not be cleared, only used with internal renderer */
-       if (re->r.renderer==R_INTERN) {
+
+       /* old code checked for internal render (aka not yafray) */
+       {
                /* to make sure we can check ray shadow easily in the render code */
                if(lar->mode & LA_SHAD_RAY) {
                        if( (re->r.mode & R_RAYTRACE)==0)
@@ -5109,10 +5110,9 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
 
                /* SHADOW BUFFER */
                threaded_makeshadowbufs(re);
-               
-               /* yafray: 'direct' radiosity, environment maps and raytree init not needed for yafray render */
-               /* although radio mode could be useful at some point, later */
-               if (re->r.renderer==R_INTERN) {
+
+               /* old code checked for internal render (aka not yafray) */
+               {
                        /* raytree */
                        if(!re->test_break(re->tbh)) {
                                if(re->r.mode & R_RAYTRACE) {
@@ -5137,14 +5137,12 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
                /* Occlusion */
                if((re->wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) && !re->test_break(re->tbh))
                        if(re->wrld.ao_gather_method == WO_AOGATHER_APPROX)
-                               if(re->r.renderer==R_INTERN)
-                                       if(re->r.mode & R_SHADOW)
-                                               make_occ_tree(re);
+                               if(re->r.mode & R_SHADOW)
+                                       make_occ_tree(re);
 
                /* SSS */
                if((re->r.mode & R_SSS) && !re->test_break(re->tbh))
-                       if(re->r.renderer==R_INTERN)
-                               make_sss_tree(re);
+                       make_sss_tree(re);
                
                if(!re->test_break(re->tbh))
                        if(re->r.mode & R_RAYTRACE)
index 52fb1eb48dc03dbc21cc31e7326e9ea94b8e3c1b..0bad1a13a5af47fad88b61a0ea074b10cfb39fc2 100644 (file)
@@ -2832,12 +2832,6 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, ReportList *r
                BKE_report(reports, RPT_ERROR, "All RenderLayers are disabled");
                return 0;
        }
-       
-       /* renderer */
-       if(!ELEM(scene->r.renderer, R_INTERN, R_YAFRAY)) {
-               BKE_report(reports, RPT_ERROR, "Unknown render engine set");
-               return 0;
-       }
 
        return 1;
 }