Merged changes in the trunk up to revision 54110.
[blender.git] / source / blender / render / intern / source / convertblender.c
index 74aab678ea860dd3cca5cf8f000feda88b3eb1e1..9e9dff63c040ec1635fad5e891265efa09dafa38 100644 (file)
@@ -153,6 +153,7 @@ static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float h
        har->hasize= hasize;
        
        har->zd= 0.0;
+       har->pool = re->pool;
        
        return har;
 }
@@ -4853,7 +4854,7 @@ static int allow_render_dupli_instance(Render *UNUSED(re), DupliObject *dob, Obj
 
        if (totmaterial) {
                for (a= 0; a<*totmaterial; a++) {
-                       ma= give_current_material(obd, a);
+                       ma= give_current_material(obd, a + 1);
                        if (ma && (ma->material_type == MA_TYPE_HALO))
                                return 0;
                }
@@ -5165,8 +5166,8 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
                 * following calls don't depend on 'RE_SetCamera' */
                RE_SetCamera(re, camera);
 
-               normalize_m4(camera->obmat);
-               invert_m4_m4(mat, camera->obmat);
+               normalize_m4_m4(mat, camera->obmat);
+               invert_m4(mat);
                RE_SetView(re, mat);
                camera->recalc= OB_RECALC_OB; /* force correct matrix for scaled cameras */
        }
@@ -5315,8 +5316,8 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la
        
        /* if no camera, viewmat should have been set! */
        if (camera) {
-               normalize_m4(camera->obmat);
-               invert_m4_m4(mat, camera->obmat);
+               normalize_m4_m4(mat, camera->obmat);
+               invert_m4(mat);
                RE_SetView(re, mat);
        }
        
@@ -5855,8 +5856,8 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
        
        /* if no camera, set unit */
        if (camera) {
-               normalize_m4(camera->obmat);
-               invert_m4_m4(mat, camera->obmat);
+               normalize_m4_m4(mat, camera->obmat);
+               invert_m4(mat);
                RE_SetView(re, mat);
        }
        else {