svn merge ^/trunk/blender -r42722:42742
authorCampbell Barton <ideasman42@gmail.com>
Tue, 20 Dec 2011 01:33:14 +0000 (01:33 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 20 Dec 2011 01:33:14 +0000 (01:33 +0000)
25 files changed:
CMakeLists.txt
SConstruct
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
intern/cycles/blender/blender_camera.cpp
intern/cycles/util/util_transform.h
intern/ghost/intern/GHOST_WindowCocoa.mm
release/scripts/startup/bl_ui/space_text.py
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_node/node_buttons.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/makesdna/DNA_world_types.h
source/blender/makesrna/intern/rna_world.c
source/blender/modifiers/intern/MOD_weightvgedit.c
source/blender/modifiers/intern/MOD_weightvgmix.c
source/blender/modifiers/intern/MOD_weightvgproximity.c
source/blender/nodes/shader/node_shader_util.c
source/blender/render/intern/source/render_texture.c
source/creator/CMakeLists.txt

index 114b7a747cab150f65b9a0743bd396ffe4e61919..0aec6185fbce2b3983bc5795569d0c15f8e4ebd4 100644 (file)
@@ -723,11 +723,7 @@ elseif(WIN32)
                        set(GETTEXT_LIBRARIES gnu_gettext)
                endif()
 
-               if(CMAKE_CL_64)
-                       set(PNG_LIBRARIES libpng)
-               else()
-                       set(PNG_LIBRARIES libpng_st)
-               endif()
+               set(PNG_LIBRARIES libpng)
                set(JPEG_LIBRARIES libjpeg)
                
                set(PNG "${LIBDIR}/png")
index d8db597d1c6d956081cb913c5c985816e61a3b43..1a03827840461a2e5cdbc34d4807691a91245fea 100644 (file)
@@ -726,10 +726,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
         # For MinGW and linuxcross static linking will be used
         dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
 
-    #currently win64-vc doesn't appear to have libpng.dll
-    if env['OURPLATFORM'] != 'win64-vc':
-        dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
-
     dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
     # Used when linking to libtiff was dynamic
     # keep it here until compilation on all platform would be ok
index bc2bbbba07ad981c185423d3c77662ee436c8f03..6e65e093a46630dc0d337c3224f8f99fa68279db 100644 (file)
@@ -64,7 +64,7 @@ BF_JPEG_LIB = 'liblibjpeg'
 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
 
 WITH_BF_PNG = True
-BF_PNG = LIBDIR + 'gcc/png'
+BF_PNG = LIBDIR + '/gcc/png'
 BF_PNG_INC = '${BF_PNG}/include'
 BF_PNG_LIB = 'png'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
index a2e3d11c244a09b2a1597b0eae8686faf6dc77a5..53ac9937885c5a66d913142a8bdc12c8f866a3d8 100644 (file)
@@ -72,7 +72,7 @@ BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
 WITH_BF_PNG = True
 BF_PNG = LIBDIR + '/png'
 BF_PNG_INC = '${BF_PNG}/include'
-BF_PNG_LIB = 'libpng_st'
+BF_PNG_LIB = 'libpng'
 BF_PNG_LIBPATH = '${BF_PNG}/lib'
 
 WITH_BF_TIFF = True
index 2a2c2a7c643b18f18841528ae11cadf104e73a40..442a8f62bfd44f6ed20027c183e475032fc585e0 100644 (file)
@@ -207,6 +207,7 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
 
        /* transform, note the blender camera points along the negative z-axis */
        cam->matrix = bcam->matrix * transform_scale(1.0f, 1.0f, -1.0f);
+       cam->matrix = transform_clear_scale(cam->matrix);
 
        /* set update flag */
        if(cam->modified(prevcam))
index 4bf3759dd75c71a82694c9b1a4e2b09a3ad9d8d2..07db52f6392b6b5a29ec96b34b880e61de4cc851 100644 (file)
@@ -209,6 +209,13 @@ __device_inline float3 transform_get_column(const Transform *t, int column)
        return make_float3(t->x[column], t->y[column], t->z[column]);
 }
 
+__device_inline void transform_set_column(Transform *t, int column, float3 value)
+{
+       t->x[column] = value.x;
+       t->y[column] = value.y;
+       t->z[column] = value.z;
+}
+
 Transform transform_inverse(const Transform& a);
 
 __device_inline bool transform_uniform_scale(const Transform& tfm, float& scale)
@@ -244,6 +251,17 @@ __device_inline bool transform_negative_scale(const Transform& tfm)
        return (dot(cross(c0, c1), c2) < 0.0f);
 }
 
+__device_inline Transform transform_clear_scale(const Transform& tfm)
+{
+       Transform ntfm = tfm;
+
+       transform_set_column(&ntfm, 0, normalize(transform_get_column(&ntfm, 0)));
+       transform_set_column(&ntfm, 1, normalize(transform_get_column(&ntfm, 1)));
+       transform_set_column(&ntfm, 2, normalize(transform_get_column(&ntfm, 2)));
+
+       return ntfm;
+}
+
 #endif
 
 CCL_NAMESPACE_END
index 01217dfd17a799da4b3533b6bcfbfa7b47d7cf09..fbb474cb20abacc7b845625f046a4f07f4eba54d 100644 (file)
@@ -34,6 +34,7 @@
 #endif
 
 #include <OpenGL/gl.h>
+#include <OpenGL/CGLRenderers.h>
 /***** Multithreaded opengl code : uncomment for enabling
 #include <OpenGL/OpenGL.h>
 */
@@ -485,7 +486,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        // needed for 'Draw Overlap' drawing method
        pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore; 
        
-       pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
+       // Force software OpenGL, for debugging
+       if(getenv("BLENDER_SOFTWAREGL")) {
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFARendererID;
+               pixelFormatAttrsWindow[i++] = kCGLRendererGenericID;
+       }
+       else
+               pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
+
        //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
 
        pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
@@ -521,7 +529,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
                // needed for 'Draw Overlap' drawing method
                pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore;
                
-               pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
+               // Force software OpenGL, for debugging
+               if(getenv("BLENDER_SOFTWAREGL")) {
+                       pixelFormatAttrsWindow[i++] = NSOpenGLPFARendererID;
+                       pixelFormatAttrsWindow[i++] = kCGLRendererGenericID;
+               }
+               else
+                       pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated;
+
                //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,;   // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway
                
                pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize;
index c3b2e30cb1250a0221ee4b454bf930668cd6b0f6..7249e9522fff6023c27341edffcba18e27123a9e 100644 (file)
@@ -174,9 +174,7 @@ class TEXT_MT_text(Menu):
         st = context.space_data
         text = st.text
 
-        layout.operator_context = 'EXEC_AREA'
         layout.operator("text.new")
-        layout.operator_context = 'INVOKE_AREA'
         layout.operator("text.open")
 
         if text:
index 378e587279171de76f6b4f98e2062ad3c4692798..6234308048b8531dbb67bb8dce7099cddb85a186 100644 (file)
@@ -305,8 +305,6 @@ void                        ntreeSwitchID(struct bNodeTree *ntree, struct ID *sce_from, struct ID *sc
 void                   ntreeMakeLocal(struct bNodeTree *ntree);
 int                            ntreeHasType(struct bNodeTree *ntree, int type);
 
-void                   ntreeSocketUseFlags(struct bNodeTree *ntree);
-
 void                   ntreeUpdateTree(struct bNodeTree *ntree);
 /* XXX Currently each tree update call does call to ntreeVerifyNodes too.
  * Some day this should be replaced by a decent depsgraph automatism!
index 52fa52a589999f13637e9a3c2ea37efcd1f4f0d1..7f321abf48e5fd10d97c0f2b7c44ced7ffc8180c 100644 (file)
@@ -67,7 +67,7 @@ void free_plugin_tex(struct PluginTex *pit);
 
 void init_colorband(struct ColorBand *coba, int rangetype);
 struct ColorBand *add_colorband(int rangetype);
-int do_colorband(struct ColorBand *coba, float in, float out[4]);
+int do_colorband(const struct ColorBand *coba, float in, float out[4]);
 void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
 int vergcband(const void *a1, const void *a2);
 struct CBData *colorband_element_add(struct ColorBand *coba, float position);
index 98465dafecbc01e18acc29e159eaa658a0a80727..e47c197cfa0d9d452c63c2fd35b2a080dfd3f311 100644 (file)
@@ -883,7 +883,7 @@ enum {
        CALC_WP_AUTO_NORMALIZE= (1<<1)
 };
 
-void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const float input)
+static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const float input)
 {
        float colf[4];
 
@@ -910,10 +910,10 @@ static void calc_weightpaint_vert_color(
 
        if ((selected > 1) && (draw_flag & CALC_WP_MULTIPAINT)) {
                int was_a_nonzero= FALSE;
-               int i;
+               unsigned int i;
 
                MDeformWeight *dw= dv->dw;
-               for (i = dv->totweight; i > 0; i--, dw++) {
+               for (i = dv->totweight; i != 0; i--, dw++) {
                        /* in multipaint, get the average if auto normalize is inactive
                         * get the sum if it is active */
                        if (dw->def_nr < defbase_tot) {
@@ -958,70 +958,81 @@ void vDM_ColorBand_store(ColorBand *coba)
        stored_cb= coba;
 }
 
-static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
+/* return an array of vertex weight colors */
+static unsigned char *calc_weightpaint_vert_array(Object *ob, int const draw_flag, ColorBand *coba)
 {
        Mesh *me = ob->data;
-       MFace *mf = dm->getTessFaceArray(dm);
-       MLoop *mloop = dm->getLoopArray(dm), *ml;
-       MPoly *mp = dm->getPolyArray(dm);
-       ColorBand *coba= stored_cb;     /* warning, not a local var */
-       unsigned char *wtcol;
-       unsigned char(*wlcol)[4] = NULL;
-       BLI_array_declare(wlcol);
-       int i, j, totface=dm->getNumTessFaces(dm), totloop;
-       int *origIndex = dm->getVertDataArray(dm, CD_ORIGINDEX);
-
-       int defbase_tot = BLI_countlist(&ob->defbase);
-       const int defbase_act = ob->actdef-1;
-       char *dg_flags = MEM_mallocN(defbase_tot * sizeof(char), __func__);
-       int selected = get_selected_defgroups(ob, dg_flags, defbase_tot);
-
-       wtcol = MEM_callocN (sizeof (unsigned char) * totface*4*4, "weightmap");
+       unsigned char *wtcol_v = MEM_callocN (sizeof(unsigned char) * me->totvert * 4, "weightmap_v");
 
        if (me->dvert) {
-               MDeformVert *dvert= me->dvert;
-               /*first add colors to the tesselation faces*/
-               memset(wtcol, 0x55, sizeof (unsigned char) * totface*4*4);
-               for (i=0; i<totface; i++, mf++) {
-                       /*origindex being NULL means we're operating on original mesh data*/
-                       unsigned int fidx= mf->v4 ? 3:2;
-                       do {
-                               calc_weightpaint_vert_color(&wtcol[(i*4 + fidx)*4],
-                                                           &dvert[*(&mf->v1 + fidx)], coba,
-                                                           defbase_tot, defbase_act,
-                                                           dg_flags, selected, draw_flag);
-                       } while (fidx--);
+               unsigned char *wc = wtcol_v;
+               MDeformVert *dv= me->dvert;
+               unsigned int i;
+
+               /* varisbles for multipaint */
+               const int defbase_tot = BLI_countlist(&ob->defbase);
+               const int defbase_act = ob->actdef-1;
+               char *dg_flags = MEM_mallocN(defbase_tot * sizeof(char), __func__);
+               const int selected = get_selected_defgroups(ob, dg_flags, defbase_tot);
+               /* const int unselected = defbase_tot - selected; */ /* UNUSED */
+
+               for (i = me->totvert; i != 0; i--, wc += 4, dv++) {
+                       calc_weightpaint_vert_color(wc, dv, coba, defbase_tot, defbase_act, dg_flags, selected, draw_flag);
                }
+
+               MEM_freeN(dg_flags);
        }
        else {
-               /* no weights, fill in zero */
                int col_i;
                weightpaint_color((unsigned char *)&col_i, coba, 0.0f);
-               fill_vn_i((int *)wtcol, totface*4, col_i);
+               fill_vn_i((int *)wtcol_v, me->totvert, col_i);
+       }
+
+       return wtcol_v;
+}
+
+static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
+{
+       ColorBand *coba= stored_cb;     /* warning, not a local var */
+       unsigned char *wtcol_v = calc_weightpaint_vert_array(ob, draw_flag, coba);
+       unsigned char *wtcol_f;
+       unsigned char(*wtcol_l)[4] = NULL;
+       BLI_array_declare(wtcol_l);
+       MFace *mf = dm->getTessFaceArray(dm);
+       MLoop *mloop = dm->getLoopArray(dm), *ml;
+       MPoly *mp = dm->getPolyArray(dm);
+       int i, j, totface=dm->getNumTessFaces(dm), totloop;
+       int *origIndex = dm->getVertDataArray(dm, CD_ORIGINDEX);
+
+       wtcol_f = MEM_mallocN(sizeof (unsigned char) * totface*4*4, "weightmap_f");
+
+       /*first add colors to the tesselation faces*/
+       for (i=0; i<totface; i++, mf++) {
+               /*origindex being NULL means we're operating on original mesh data*/
+               unsigned int fidx= mf->v4 ? 3:2;
+               do {
+               copy_v4_v4_char((char *)&wtcol_f[(4 * i + fidx) * 4],
+                                               (char *)&wtcol_v[4 * (*(&mf->v1 + fidx))]);
+               } while (fidx--);
        }
-       
-       CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_ASSIGN, wtcol, totface);
+
+       CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_ASSIGN, wtcol_f, totface);
 
        /*now add to loops, so the data can be passed through the modifier stack*/
        totloop = 0;
        for (i=0; i<dm->numPolyData; i++, mp++) {
-               MDeformVert *dvert= me->dvert;
-
                ml = mloop + mp->loopstart;
 
                for (j=0; j<mp->totloop; j++, ml++, totloop++) {
-                       BLI_array_growone(wlcol);
-
-                       calc_weightpaint_vert_color((unsigned char *)&wlcol[totloop],
-                                                   &dvert[origIndex ? origIndex[ml->v] : ml->v], coba,
-                                                   defbase_tot, defbase_act,
-                                                                               dg_flags, selected, draw_flag);
+                       BLI_array_growone(wtcol_l);
+                       copy_v4_v4_char((char *)&wtcol_l[totloop],
+                                       (char *)&wtcol_v[4 * (origIndex ? origIndex[ml->v] : ml->v)]);
                }
        }
 
-       MEM_freeN(dg_flags);
+       MEM_freeN(wtcol_v);
 
-       CustomData_add_layer(&dm->loopData, CD_WEIGHT_MLOOPCOL, CD_ASSIGN, wlcol, totloop);
+       CustomData_add_layer(&dm->loopData, CD_WEIGHT_MLOOPCOL, CD_ASSIGN, wtcol_l, totloop);
 }
 
 
index cc49e8465b9e6c796efe5d7e5c8a868c993d63c1..ce1dd429794851dae564b88fae9227a59b737a98 100644 (file)
@@ -1325,32 +1325,6 @@ void nodeSetActive(bNodeTree *ntree, bNode *node)
                node->flag |= NODE_ACTIVE_TEXTURE;
 }
 
-/* use flags are not persistent yet, groups might need different tagging, so we do it each time
-   when we need to get this info */
-void ntreeSocketUseFlags(bNodeTree *ntree)
-{
-       bNode *node;
-       bNodeSocket *sock;
-       bNodeLink *link;
-       
-       /* clear flags */
-       for(node= ntree->nodes.first; node; node= node->next) {
-               for(sock= node->inputs.first; sock; sock= sock->next)
-                       sock->flag &= ~SOCK_IN_USE;
-               for(sock= node->outputs.first; sock; sock= sock->next)
-                       sock->flag &= ~SOCK_IN_USE;
-       }
-       
-       /* tag all thats in use */
-       for(link= ntree->links.first; link; link= link->next) {
-       
-               if(link->fromsock) // FIXME, see below
-                       link->fromsock->flag |= SOCK_IN_USE;
-               if(link->tosock) // FIXME This can be NULL, when dragging a new link in the UI, should probably copy the node tree for preview render - campbell
-                       link->tosock->flag |= SOCK_IN_USE;
-       }
-}
-
 /* ************** dependency stuff *********** */
 
 /* node is guaranteed to be not checked before */
@@ -1425,16 +1399,27 @@ static void ntree_update_link_pointers(bNodeTree *ntree)
        
        /* first clear data */
        for(node= ntree->nodes.first; node; node= node->next) {
-               for(sock= node->inputs.first; sock; sock= sock->next)
+               for(sock= node->inputs.first; sock; sock= sock->next) {
                        sock->link= NULL;
+                       sock->flag &= ~SOCK_IN_USE;
+               }
+               for(sock= node->outputs.first; sock; sock= sock->next) {
+                       sock->flag &= ~SOCK_IN_USE;
+               }
+       }
+       for(sock= ntree->inputs.first; sock; sock= sock->next) {
+               sock->flag &= ~SOCK_IN_USE;
        }
-       /* clear socket links */
-       for(sock= ntree->outputs.first; sock; sock= sock->next)
+       for(sock= ntree->outputs.first; sock; sock= sock->next) {
                sock->link= NULL;
+               sock->flag &= ~SOCK_IN_USE;
+       }
 
        for(link= ntree->links.first; link; link= link->next) {
-               if (link->tosock)
-                       link->tosock->link= link;
+               link->tosock->link= link;
+               
+               link->fromsock->flag |= SOCK_IN_USE;
+               link->tosock->flag |= SOCK_IN_USE;
        }
 }
 
index 93404dc25fb6d188b02af5db5439471348a84390..7051376a1f41ef0c78f53a3416f8eacc39d94cbf 100644 (file)
@@ -349,9 +349,9 @@ ColorBand *add_colorband(int rangetype)
 
 /* ------------------------------------------------------------------------- */
 
-int do_colorband(ColorBand *coba, float in, float out[4])
+int do_colorband(const ColorBand *coba, float in, float out[4])
 {
-       CBData *cbd1, *cbd2, *cbd0, *cbd3;
+       const CBData *cbd1, *cbd2, *cbd0, *cbd3;
        float fac, mfac, t[4];
        int a;
        
index 14decca5202759de100720b8105489bcbca3ed21..99c3ec0c134e132903bdbaa0348e871a81dd77ab 100644 (file)
@@ -7520,6 +7520,30 @@ void do_versions_image_settings_2_60(Scene *sce)
 
 }
 
+/* socket use flags were only temporary before */
+static void do_versions_nodetree_socket_use_flags_2_62(bNodeTree *ntree)
+{
+       bNode *node;
+       bNodeSocket *sock;
+       bNodeLink *link;
+       
+       for (node=ntree->nodes.first; node; node=node->next) {
+               for (sock=node->inputs.first; sock; sock=sock->next)
+                       sock->flag &= ~SOCK_IN_USE;
+               for (sock=node->outputs.first; sock; sock=sock->next)
+                       sock->flag &= ~SOCK_IN_USE;
+       }
+       for (sock=ntree->inputs.first; sock; sock=sock->next)
+               sock->flag &= ~SOCK_IN_USE;
+       for (sock=ntree->outputs.first; sock; sock=sock->next)
+               sock->flag &= ~SOCK_IN_USE;
+       
+       for (link=ntree->links.first; link; link=link->next) {
+               link->fromsock->flag |= SOCK_IN_USE;
+               link->tosock->flag |= SOCK_IN_USE;
+       }
+}
+
 static void do_versions(FileData *fd, Library *lib, Main *main)
 {
        /* WATCH IT!!!: pointers from libdata have not been converted */
@@ -12749,7 +12773,38 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        /* put compatibility code here until next subversion bump */
        {
-               /* nothing! */
+               {
+                       /* update use flags for node sockets (was only temporary before) */
+                       Scene *sce;
+                       Material *mat;
+                       Tex *tex;
+                       Lamp *lamp;
+                       World *world;
+                       bNodeTree *ntree;
+
+                       for (sce=main->scene.first; sce; sce=sce->id.next)
+                               if (sce->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(sce->nodetree);
+
+                       for (mat=main->mat.first; mat; mat=mat->id.next)
+                               if (mat->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(mat->nodetree);
+
+                       for (tex=main->tex.first; tex; tex=tex->id.next)
+                               if (tex->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(tex->nodetree);
+
+                       for (lamp=main->lamp.first; lamp; lamp=lamp->id.next)
+                               if (lamp->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(lamp->nodetree);
+
+                       for (world=main->world.first; world; world=world->id.next)
+                               if (world->nodetree)
+                                       do_versions_nodetree_socket_use_flags_2_62(world->nodetree);
+
+                       for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+                               do_versions_nodetree_socket_use_flags_2_62(ntree);
+               }
        }
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
index 15e5719be37250f784244b30f078640b8ec8edcd..1b5f241738402b40972b1bb0798cbe1c29a798c3 100644 (file)
@@ -115,6 +115,9 @@ static void active_node_panel(const bContext *C, Panel *pa)
        uiItemS(layout);
        uiItemR(layout, &ptr, "name", 0, NULL, ICON_NODE);
        uiItemS(layout);
+       
+       uiItemO(layout, NULL, 0, "NODE_OT_hide_socket_toggle");
+       uiItemS(layout);
 
        /* draw this node's settings */
        if (node->typeinfo && node->typeinfo->uifuncbut)
index 08e073494bb264a1d238b5360b44d5efbe392c64..7b692f55965c26db50cf7795ef55bc5b1fcefeb9 100644 (file)
@@ -351,10 +351,10 @@ static void node_update_hidden(bNode *node)
 
        /* calculate minimal radius */
        for(nsock= node->inputs.first; nsock; nsock= nsock->next)
-               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
+               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE))
                        totin++;
        for(nsock= node->outputs.first; nsock; nsock= nsock->next)
-               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
+               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE))
                        totout++;
        
        tot= MAX2(totin, totout);
@@ -371,7 +371,7 @@ static void node_update_hidden(bNode *node)
        rad=drad= (float)M_PI/(1.0f + (float)totout);
        
        for(nsock= node->outputs.first; nsock; nsock= nsock->next) {
-               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE)) {
                        nsock->locx= node->totr.xmax - hiddenrad + (float)sin(rad)*hiddenrad;
                        nsock->locy= node->totr.ymin + hiddenrad + (float)cos(rad)*hiddenrad;
                        rad+= drad;
@@ -382,7 +382,7 @@ static void node_update_hidden(bNode *node)
        rad=drad= - (float)M_PI/(1.0f + (float)totin);
        
        for(nsock= node->inputs.first; nsock; nsock= nsock->next) {
-               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
+               if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (nsock->flag & SOCK_IN_USE)) {
                        nsock->locx= node->totr.xmin + hiddenrad + (float)sin(rad)*hiddenrad;
                        nsock->locy= node->totr.ymin + hiddenrad + (float)cos(rad)*hiddenrad;
                        rad+= drad;
@@ -854,12 +854,12 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
        
        /* sockets */
        for(sock= node->inputs.first; sock; sock= sock->next) {
-               if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
+               if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (sock->flag & SOCK_IN_USE))
                        node_socket_circle_draw(snode->nodetree, sock, socket_size);
        }
        
        for(sock= node->outputs.first; sock; sock= sock->next) {
-               if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)))
+               if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL)) && (sock->flag & SOCK_IN_USE))
                        node_socket_circle_draw(snode->nodetree, sock, socket_size);
        }
        
index 16ee32d10a2b38f51cbb899a0866a85c8d490edc..566659e0391559b4119f28abd02e01a883c72162 100644 (file)
@@ -195,7 +195,6 @@ void TEXT_OT_new(wmOperatorType *ot)
        ot->description= "Create a new text data block";
        
        /* api callbacks */
-       ot->invoke= WM_operator_confirm;
        ot->exec= text_new_exec;
        ot->poll= text_new_poll;
        
index 1e8a45741202d0f93a9bddc6ac96260354e6fc97..149393b6723ee5507718198c64b9f430b4531ce3 100644 (file)
@@ -181,6 +181,7 @@ typedef struct World {
 #define TEXCO_ANGMAP   64
 #define TEXCO_H_SPHEREMAP      256
 #define TEXCO_H_TUBEMAP        1024
+#define TEXCO_EQUIRECTMAP 2048
 
 /* mapto */
 #define WOMAP_BLEND            1
index 840498249ea6cdbe51115888ec5ef2cb360c6226..087716adbe34c6a617f028e878e28cf9b21e2e04 100644 (file)
@@ -143,6 +143,7 @@ static void rna_def_world_mtex(BlenderRNA *brna)
                {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates (interior mist)"},
                {TEXCO_ANGMAP, "ANGMAP", 0, "AngMap", "Use 360 degree angular coordinates, e.g. for spherical light probes"},
                {TEXCO_H_SPHEREMAP, "SPHERE", 0, "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"},
+               {TEXCO_EQUIRECTMAP, "EQUIRECT", 0, "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"},
                {TEXCO_H_TUBEMAP, "TUBE", 0, "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"},
                {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
                {0, NULL, 0, NULL, NULL}};
index a4c0f0ffa70a5c1af4bfa71cbc85d114fdfbc030..95862f5f0022743ca4ad6d505402153f5f553d67 100644 (file)
@@ -177,10 +177,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                                   int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
 {
        WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
-       DerivedMesh *dm = derivedData, *ret = NULL;
-#if 0
-       Mesh *ob_m = NULL;
-#endif
+       DerivedMesh *dm = derivedData;
        MDeformVert *dvert = NULL;
        MDeformWeight **dw = NULL;
        float *org_w; /* Array original weights. */
@@ -188,7 +185,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        int numVerts;
        int defgrp_idx;
        int i;
-       char rel_ret = 0; /* Boolean, whether we have to release ret dm or not, when not using it! */
        /* Flags. */
        int do_add = (wmd->edit_flags & MOD_WVG_EDIT_ADD2VG) != 0;
        int do_rem = (wmd->edit_flags & MOD_WVG_EDIT_REMFVG) != 0;
@@ -207,49 +203,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        if (defgrp_idx < 0)
                return dm;
 
-       /* XXX All this to avoid copying dm when not needed... However, it nearly doubles compute
-        *     time! See scene 5 of the WeighVG test file...
-        */
-#if 0
-       /* Get actual dverts (ie vertex group data). */
-       dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
-       /* If no dverts, return unmodified data... */
-       if (dvert == NULL)
-               return dm;
-
-       /* Get org mesh, only to test whether affected cdata layer has already been copied
-        * somewhere up in the modifiers stack.
-        */
-       ob_m = get_mesh(ob);
-       if (ob_m == NULL)
-               return dm;
-
-       /* Create a copy of our dmesh, only if our affected cdata layer is the same as org mesh. */
-       if (dvert == CustomData_get_layer(&ob_m->vdata, CD_MDEFORMVERT)) {
-               /* XXX Seems to create problems with weightpaint mode???
-                *     I'm missing something here, I guess...
-                */
-//             DM_set_only_copy(dm, CD_MASK_MDEFORMVERT); /* Only copy defgroup layer. */
-               ret = CDDM_copy(dm);
-               dvert = ret->getVertDataArray(ret, CD_MDEFORMVERT);
-               if (dvert == NULL) {
-                       ret->release(ret);
-                       return dm;
-               }
-               rel_ret = 1;
-       }
-       else
-               ret = dm;
-#else
-       ret = CDDM_copy(dm, 0);
-       rel_ret = 1;
-       dvert = ret->getVertDataArray(ret, CD_MDEFORMVERT);
-       if (dvert == NULL) {
-               if (rel_ret)
-                       ret->release(ret);
-               return dm;
-       }
-#endif
+       dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts);
 
        /* Get org weights, assuming 0.0 for vertices not in given vgroup. */
        org_w = MEM_mallocN(sizeof(float) * numVerts, "WeightVGEdit Modifier, org_w");
@@ -271,7 +225,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        }
 
        /* Do masking. */
-       weightvg_do_mask(numVerts, NULL, org_w, new_w, ob, ret, wmd->mask_constant,
+       weightvg_do_mask(numVerts, NULL, org_w, new_w, ob, dm, wmd->mask_constant,
                         wmd->mask_defgrp_name, wmd->mask_texture, wmd->mask_tex_use_channel,
                         wmd->mask_tex_mapping, wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);
 
@@ -285,7 +239,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        MEM_freeN(dw);
 
        /* Return the vgroup-modified mesh. */
-       return ret;
+       return dm;
 }
 
 static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
index 43f503a7624a4042828d5453e748fce6f9b48464..34e73adb4b43efcdf5f1a8c9e9337dcc9a65054d 100644 (file)
@@ -219,10 +219,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                                   int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
 {
        WeightVGMixModifierData *wmd = (WeightVGMixModifierData*) md;
-       DerivedMesh *dm = derivedData, *ret = NULL;
-#if 0
-       Mesh *ob_m = NULL;
-#endif
+       DerivedMesh *dm = derivedData;
        MDeformVert *dvert = NULL;
        MDeformWeight **dw1, **tdw1, **dw2, **tdw2;
        int numVerts;
@@ -232,7 +229,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        int *tidx, *indices = NULL;
        int numIdx = 0;
        int i;
-       char rel_ret = 0; /* Boolean, whether we have to release ret dm or not, when not using it! */
 
        /* Get number of verts. */
        numVerts = dm->getNumVerts(dm);
@@ -254,49 +250,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                        return dm;
        }
 
-       /* XXX All this to avoid copying dm when not needed... However, it nearly doubles compute
-        *     time! See scene 5 of the WeighVG test file...
-        */
-#if 0
-       /* Get actual dverts (ie vertex group data). */
-       dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
-       /* If no dverts, return unmodified data... */
-       if (dvert == NULL)
-               return dm;
-
-       /* Get org mesh, only to test whether affected cdata layer has already been copied
-        * somewhere up in the modifiers stack.
-        */
-       ob_m = get_mesh(ob);
-       if (ob_m == NULL)
-               return dm;
-
-       /* Create a copy of our dmesh, only if our affected cdata layer is the same as org mesh. */
-       if (dvert == CustomData_get_layer(&ob_m->vdata, CD_MDEFORMVERT)) {
-               /* XXX Seems to create problems with weightpaint mode???
-                *     I'm missing something here, I guess...
-                */
-//             DM_set_only_copy(dm, CD_MASK_MDEFORMVERT); /* Only copy defgroup layer. */
-               ret = CDDM_copy(dm);
-               dvert = ret->getVertDataArray(ret, CD_MDEFORMVERT);
-               if (dvert == NULL) {
-                       ret->release(ret);
-                       return dm;
-               }
-               rel_ret = 1;
-       }
-       else
-               ret = dm;
-#else
-       ret = CDDM_copy(dm, 0);
-       rel_ret = 1;
-       dvert = ret->getVertDataArray(ret, CD_MDEFORMVERT);
-       if (dvert == NULL) {
-               if (rel_ret)
-                       ret->release(ret);
-               return dm;
-       }
-#endif
+       dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts);
 
        /* Find out which vertices to work on. */
        tidx = MEM_mallocN(sizeof(int) * numVerts, "WeightVGMix Modifier, tidx");
@@ -364,8 +318,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                MEM_freeN(tdw1);
                MEM_freeN(tdw2);
                MEM_freeN(tidx);
-               if (rel_ret)
-                       ret->release(ret);
                return dm;
        }
        if (numIdx != -1) {
@@ -400,7 +352,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        }
 
        /* Do masking. */
-       weightvg_do_mask(numIdx, indices, org_w, new_w, ob, ret, wmd->mask_constant,
+       weightvg_do_mask(numIdx, indices, org_w, new_w, ob, dm, wmd->mask_constant,
                         wmd->mask_defgrp_name, wmd->mask_texture, wmd->mask_tex_use_channel,
                         wmd->mask_tex_mapping, wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);
 
@@ -419,7 +371,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                MEM_freeN(indices);
 
        /* Return the vgroup-modified mesh. */
-       return ret;
+       return dm;
 }
 
 static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
index db561eb59a6e6f1e8e3d1319b2ab2eb9ab3ffbee..2a8b639f2cf88ad38279e5d6c9a06edf48166158 100644 (file)
  *  \ingroup modifiers
  */
 
+#define DO_PROFILE 0
+
 #include "BLI_editVert.h"
 #include "BLI_math.h"
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
+#if DO_PROFILE
+       #include "PIL_time.h"
+#endif
+
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_modifier_types.h"
@@ -334,10 +340,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                                   int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
 {
        WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*) md;
-       DerivedMesh *dm = derivedData, *ret = NULL;
-#if 0
-       Mesh *ob_m = NULL;
-#endif
+       DerivedMesh *dm = derivedData;
        MDeformVert *dvert = NULL;
        MDeformWeight **dw, **tdw;
        int numVerts;
@@ -350,7 +353,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        int *tidx, *indices = NULL;
        int numIdx = 0;
        int i;
-       char rel_ret = 0; /* Boolean, whether we have to release ret dm or not, when not using it! */
+
+#if DO_PROFILE
+       TIMEIT_START(perf)
+#endif
 
        /* Get number of verts. */
        numVerts = dm->getNumVerts(dm);
@@ -371,49 +377,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        if (defgrp_idx < 0)
                return dm;
 
-       /* XXX All this to avoid copying dm when not needed... However, it nearly doubles compute
-        *     time! See scene 5 of the WeighVG test file...
-        */
-#if 0
-       /* Get actual dverts (ie vertex group data). */
-       dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
-       /* If no dverts, return unmodified data... */
-       if (dvert == NULL)
-               return dm;
-
-       /* Get org mesh, only to test whether affected cdata layer has already been copied
-        * somewhere up in the modifiers stack.
-        */
-       ob_m = get_mesh(ob);
-       if (ob_m == NULL)
-               return dm;
-
-       /* Create a copy of our dmesh, only if our affected cdata layer is the same as org mesh. */
-       if (dvert == CustomData_get_layer(&ob_m->vdata, CD_MDEFORMVERT)) {
-               /* XXX Seems to create problems with weightpaint mode???
-                *     I'm missing something here, I guess...
-                */
-//             DM_set_only_copy(dm, CD_MASK_MDEFORMVERT); /* Only copy defgroup layer. */
-               ret = CDDM_copy(dm);
-               dvert = ret->getVertDataArray(ret, CD_MDEFORMVERT);
-               if (dvert == NULL) {
-                       ret->release(ret);
-                       return dm;
-               }
-               rel_ret = 1;
-       }
-       else
-               ret = dm;
-#else
-       ret = CDDM_copy(dm, 0);
-       rel_ret = 1;
-       dvert = ret->getVertDataArray(ret, CD_MDEFORMVERT);
-       if (dvert == NULL) {
-               if (rel_ret)
-                       ret->release(ret);
-               return dm;
-       }
-#endif
+       dvert = CustomData_duplicate_referenced_layer(&dm->vertData, CD_MDEFORMVERT, numVerts);
 
        /* Find out which vertices to work on (all vertices in vgroup), and get their relevant weight.
         */
@@ -433,8 +397,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                MEM_freeN(tidx);
                MEM_freeN(tw);
                MEM_freeN(tdw);
-               if (rel_ret)
-                       ret->release(ret);
                return dm;
        }
        indices = MEM_mallocN(sizeof(int) * numIdx, "WeightVGProximity Modifier, indices");
@@ -455,7 +417,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                 */
                float (*tv_cos)[3] = MEM_mallocN(sizeof(float[3]) * numVerts, "WeightVGProximity Modifier, tv_cos");
                v_cos = MEM_mallocN(sizeof(float[3]) * numIdx, "WeightVGProximity Modifier, v_cos");
-               ret->getVertCos(ret, tv_cos);
+               dm->getVertCos(dm, tv_cos);
                for (i = 0; i < numIdx; i++)
                        copy_v3_v3(v_cos[i], tv_cos[indices[i]]);
                MEM_freeN(tv_cos);
@@ -524,7 +486,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        do_map(new_w, numIdx, wmd->min_dist, wmd->max_dist, wmd->falloff_type);
 
        /* Do masking. */
-       weightvg_do_mask(numIdx, indices, org_w, new_w, ob, ret, wmd->mask_constant,
+       weightvg_do_mask(numIdx, indices, org_w, new_w, ob, dm, wmd->mask_constant,
                         wmd->mask_defgrp_name, wmd->mask_texture, wmd->mask_tex_use_channel,
                         wmd->mask_tex_mapping, wmd->mask_tex_map_obj, wmd->mask_tex_uvlayer_name);
 
@@ -538,8 +500,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        MEM_freeN(indices);
        MEM_freeN(v_cos);
 
+#if DO_PROFILE
+       TIMEIT_END(perf)
+#endif
+
        /* Return the vgroup-modified mesh. */
-       return ret;
+       return dm;
 }
 
 static DerivedMesh *applyModifierEM(ModifierData *md, Object *ob,
index 87585c35e6a4b2b09562aad5bb05a2dbcc2f3bb1..8b8afc3d846138124ef2f3673066e04929b29a3b 100644 (file)
@@ -134,8 +134,6 @@ void ntreeShaderGetTexcoMode(bNodeTree *ntree, int r_mode, short *texco, int *mo
        bNodeSocket *sock;
        int a;
        
-       ntreeSocketUseFlags(ntree);
-
        for(node= ntree->nodes.first; node; node= node->next) {
                if(node->type==SH_NODE_TEXTURE) {
                        if((r_mode & R_OSA) && node->id) {
index 7c6efc9a138a34cc369ad8d8c6ea0123cbe3e1fe..849e0ef428a0f3684dafd41be796a679dff13d07 100644 (file)
@@ -3083,6 +3083,12 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h
                                        continue;
                                }
                                break;
+                       case TEXCO_EQUIRECTMAP:
+                               tempvec[0]= atan2f(lo[0], lo[2]) / (float)M_PI;
+                               tempvec[1]= 1.0f - 2.0f*saacos(lo[1]) / (float)M_PI;
+                               tempvec[2]= 0.0f;
+                               co= tempvec;
+                               break;
                        case TEXCO_OBJECT:
                                if(mtex->object) {
                                        copy_v3_v3(tempvec, lo);
index c190c27abb346a3095f1d7b3d05caea85baefae0..9ef86b3cac583325073878d7c065ff8a59de5793 100644 (file)
@@ -491,7 +491,6 @@ elseif(WIN32)
        else()
                install(
                        FILES
-                               ${LIBDIR}/png/lib/libpng.dll
                                ${LIBDIR}/zlib/lib/zlib.dll
                        DESTINATION ${TARGETDIR}
                )