diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 21:13:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 21:13:32 +0400 |
commit | dca15b215d994c7bafe9398493a9db1b4df00246 (patch) | |
tree | 545d3e588adac563250356f17bf3989b5e2bd840 | |
parent | 5ef9039b7e2ea16bd4b651aab21d5aa690485569 (diff) | |
parent | 69ad40f9ea81ddf5cd0d83dc21cc7f66a8008765 (diff) |
Cycles: svn merge -r41613:41627 ^/trunk/blender
38 files changed, 156 insertions, 511 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 83d99928dca..99a44efdb0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,6 @@ enable_testing() set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE ) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE ) -set(INCLUDE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/include CACHE INTERNAL "" FORCE ) #----------------------------------------------------------------------------- # Set default config options @@ -300,10 +299,6 @@ if(WITH_CYCLES) set(WITH_BOOST ON) endif() -if(WITH_OPENIMAGEIO) - set(WITH_BOOST ON) -endif() - TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG) # don't store paths to libs for portable distrobution @@ -512,12 +507,7 @@ if(UNIX AND NOT APPLE) endif() if(WITH_BOOST) - if(CYCLES_BOOST) - set(BOOST ${CYCLES_BOOST} CACHE PATH "Boost Directory") - unset(CYCLES_BOOST CACHE) - else() - set(BOOST "/usr" CACHE PATH "Boost Directory") - endif() + set(BOOST "/usr" CACHE PATH "Boost Directory") if(NOT BOOST_CUSTOM) set(BOOST_ROOT ${BOOST}) @@ -532,12 +522,7 @@ if(UNIX AND NOT APPLE) endif() if(WITH_OPENIMAGEIO) - - # temp, update - if(CYCLES_OIIO) - set(OPENIMAGEIO ${CYCLES_OIIO}) - unset(CYCLES_OIIO CACHE) - endif() + set(OPENIMAGEIO "/usr" CACHE PATH "OpenImageIO Directory") set(OPENIMAGEIO_ROOT_DIR ${OPENIMAGEIO}) find_package(OpenImageIO REQUIRED) @@ -549,7 +534,6 @@ if(UNIX AND NOT APPLE) if(NOT OPENIMAGEIO_FOUND) set(WITH_OPENIMAGEIO OFF) endif() - endif() # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed @@ -1511,6 +1495,7 @@ if(FIRST_RUN) info_cfg_option(WITH_FFTW3) info_cfg_option(WITH_INTERNATIONAL) info_cfg_option(WITH_INPUT_NDOF) + info_cfg_option(WITH_CYCLES) info_cfg_text("Compiler Options:") info_cfg_option(WITH_BUILDINFO) @@ -1530,7 +1515,6 @@ if(FIRST_RUN) info_cfg_option(WITH_IMAGE_OPENJPEG) info_cfg_option(WITH_IMAGE_REDCODE) info_cfg_option(WITH_IMAGE_TIFF) - info_cfg_option(WITH_OPENIMAGEIO) info_cfg_text("Audio:") info_cfg_option(WITH_OPENAL) diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake index 6791028a888..4f04960d5e3 100644 --- a/build_files/cmake/config/blender_lite.cmake +++ b/build_files/cmake/config/blender_lite.cmake @@ -12,7 +12,9 @@ set(WITH_BUILTIN_GLEW OFF CACHE FORCE BOOL) set(WITH_BULLET OFF CACHE FORCE BOOL) set(WITH_CODEC_FFMPEG OFF CACHE FORCE BOOL) set(WITH_CODEC_SNDFILE OFF CACHE FORCE BOOL) +set(WITH_CYCLES OFF CACHE FORCE BOOL) set(WITH_FFTW3 OFF CACHE FORCE BOOL) +set(WITH_LIBMV OFF CACHE FORCE BOOL) set(WITH_GAMEENGINE OFF CACHE FORCE BOOL) set(WITH_IK_ITASC OFF CACHE FORCE BOOL) set(WITH_IMAGE_CINEON OFF CACHE FORCE BOOL) diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index 8cd7be567e6..097909ca058 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -19,16 +19,16 @@ import bpy def init(): - import libcycles_blender as lib + import bcycles import os.path path = os.path.dirname(__file__) user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', ''))) - lib.init(path, user_path) + bcycles.init(path, user_path) def create(engine, data, scene, region = 0, v3d = 0, rv3d = 0): - import libcycles_blender as lib + import bcycles data = data.as_pointer() scene = scene.as_pointer() @@ -39,36 +39,36 @@ def create(engine, data, scene, region = 0, v3d = 0, rv3d = 0): if rv3d: rv3d = rv3d.as_pointer() - engine.session = lib.create(engine.as_pointer(), data, scene, region, v3d, rv3d) + engine.session = bcycles.create(engine.as_pointer(), data, scene, region, v3d, rv3d) def free(engine): if "session" in dir(engine): if engine.session: - import libcycles_blender as lib - lib.free(engine.session) + import bcycles + bcycles.free(engine.session) del engine.session def render(engine): - import libcycles_blender as lib - lib.render(engine.session) + import bcycles + bcycles.render(engine.session) def update(engine, data, scene): - import libcycles_blender as lib - lib.sync(engine.session) + import bcycles + bcycles.sync(engine.session) def draw(engine, region, v3d, rv3d): - import libcycles_blender as lib + import bcycles v3d = v3d.as_pointer() rv3d = rv3d.as_pointer() # draw render image - lib.draw(engine.session, v3d, rv3d) + bcycles.draw(engine.session, v3d, rv3d) def available_devices(): - import libcycles_blender as lib - return lib.available_devices() + import bcycles + return bcycles.available_devices() def with_osl(): - import libcycles_blender as lib - return lib.with_osl() + import bcycles + return bcycles.with_osl() diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 1026d420c02..58049bb8cbe 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -194,8 +194,8 @@ static PyMethodDef methods[] = { static struct PyModuleDef module = { PyModuleDef_HEAD_INIT, - "libcycles_blender", - "Blender RNA to render exporter", + "bcycles", + "Blender cycles render integration", -1, methods, NULL, NULL, NULL, NULL diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index cf0d10c5844..435b968f243 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -62,7 +62,7 @@ class FILEBROWSER_HT_header(Header): row.prop(params, "use_filter_folder", text="") if params.filter_glob: - #if st.operator and hasattr(st.operator, "filter_glob"): + #if st.active_operator and hasattr(st.active_operator, "filter_glob"): # row.prop(params, "filter_glob", text="") row.label(params.filter_glob) else: diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 79930fdd8bf..7f099c03d09 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -592,7 +592,10 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O if(part->ren_as == PART_DRAW_OB && part->dup_ob) { node2 = dag_get_node(dag, part->dup_ob); - dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Object Visualisation"); + /* note that this relation actually runs in the wrong direction, the problem + is that dupli system all have this (due to parenting), and the render + engine instancing assumes particular ordering of objects in list */ + dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation"); if(part->dup_ob->type == OB_MBALL) dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation"); } diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 18a7ad65dae..e3bfdd54ab1 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -156,13 +156,10 @@ static void get_sequence_fname(MovieClip *clip, int framenr, char *name) autoguess offset for now. could be something smarter in the future */ offset= sequence_guess_offset(clip->name, strlen(head), numlen); - if(numlen) BLI_stringenc(name, head, tail, numlen, offset+framenr-1); - else strncpy(name, clip->name, sizeof(name)); + if (numlen) BLI_stringenc(name, head, tail, numlen, offset+framenr-1); + else BLI_strncpy(name, clip->name, sizeof(clip->name)); - if(clip->id.lib) - BLI_path_abs(name, clip->id.lib->filepath); - else - BLI_path_abs(name, G.main->name); + BLI_path_abs(name, ID_BLEND_PATH(G.main, &clip->id)); } /* supposed to work with sequences only */ @@ -174,7 +171,7 @@ static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistor BLI_split_dirfile(clip->name, clipdir, clipfile, FILE_MAX, FILE_MAX); if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) { - strcpy(dir, clip->proxy.dir); + BLI_strncpy(dir, clip->proxy.dir, sizeof(dir)); } else { BLI_snprintf(dir, FILE_MAX, "%s/BL_proxy", clipdir); } @@ -194,9 +191,9 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user, { struct ImBuf *ibuf; char name[FILE_MAX]; - int loadflag, size, undistort; + int loadflag /*, size */ /* UNUSED */, undistort; - size= rendersize_to_number(user->render_size); + /* size= rendersize_to_number(user->render_size); */ undistort= user->render_flag&MCLIP_PROXY_RENDER_UNDISTORT; @@ -222,11 +219,7 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in if(!clip->anim) { BLI_strncpy(str, clip->name, FILE_MAX); - - if(clip->id.lib) - BLI_path_abs(str, clip->id.lib->filepath); - else - BLI_path_abs(str, G.main->name); + BLI_path_abs(str, ID_BLEND_PATH(G.main, &clip->id)); /* FIXME: make several stream accessible in image editor, too */ clip->anim= openanim(str, IB_rect, 0); @@ -234,7 +227,7 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in if(clip->anim) { if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) { char dir[FILE_MAX]; - strcpy(dir, clip->proxy.dir); + BLI_strncpy(dir, clip->proxy.dir, sizeof(dir)); BLI_path_abs(dir, G.main->name); IMB_anim_set_index_dir(clip->anim, dir); } @@ -243,7 +236,7 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, MovieClipUser *user, in if(clip->anim) { int dur; - int fra= framenr-1; + int fra; dur= IMB_anim_get_duration(clip->anim, tc); fra= framenr-1; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 07e791ce8c6..14dfe015894 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1003,8 +1003,6 @@ void scene_update_tagged(Main *bmain, Scene *scene) /* flush recalc flags to dependencies */ DAG_ids_flush_tagged(bmain); - BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE); - scene->physics_settings.quick_cache_step= 0; /* update all objects: drivers, matrices, displists, etc. flags set @@ -1068,8 +1066,6 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) * so dont call within 'scene_update_tagged_recursive' */ DAG_scene_update_flags(bmain, sce, lay, TRUE); // only stuff that moves or needs display still - BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_SCENE_UPDATE_PRE); - /* All 'standard' (i.e. without any dependencies) animation is handled here, * with an 'local' to 'macro' order of evaluation. This should ensure that * settings stored nestled within a hierarchy (i.e. settings in a Texture block diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 06a985e7d72..a834628641a 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -58,7 +58,9 @@ #include "IMB_imbuf.h" #ifdef WITH_LIBMV -#include "libmv-capi.h" +# include "libmv-capi.h" +#else +struct libmv_Features; #endif typedef struct MovieDistortion { @@ -1379,6 +1381,12 @@ float BKE_tracking_solve_reconstruction(MovieTracking *tracking, int width, int return error; } +#else + (void)tracking; + (void)width; + (void)height; + + return -1.0f; #endif } @@ -1581,6 +1589,10 @@ void BKE_tracking_apply_intrinsics(MovieTracking *tracking, float co[2], float n /* result is in image coords already */ nco[0]= x; nco[1]= y; +#else + (void)camera; + (void)co; + (void)nco; #endif } @@ -1597,9 +1609,14 @@ void BKE_tracking_invert_intrinsics(MovieTracking *tracking, float co[2], float nco[0]= x * camera->focal + camera->principal[0]; nco[1]= y * camera->focal + camera->principal[1] * aspy; +#else + (void)camera; + (void)co; + (void)nco; #endif } +#ifdef WITH_LIBMV static int point_in_stroke(bGPDstroke *stroke, float x, float y) { int i, prev; @@ -1643,7 +1660,6 @@ static int point_in_layer(bGPDlayer *layer, float x, float y) static void retrieve_libmv_features(MovieTracking *tracking, struct libmv_Features *features, int framenr, int width, int height, bGPDlayer *layer, int place_outside_layer) { -#ifdef WITH_LIBMV int a; a= libmv_countFeatures(features); @@ -1668,8 +1684,8 @@ static void retrieve_libmv_features(MovieTracking *tracking, struct libmv_Featur track->search_flag|= SELECT; } } -#endif } +#endif void BKE_tracking_detect_fast(MovieTracking *tracking, ImBuf *ibuf, int framenr, int margin, int min_trackness, int min_distance, bGPDlayer *layer, @@ -1686,6 +1702,15 @@ void BKE_tracking_detect_fast(MovieTracking *tracking, ImBuf *ibuf, retrieve_libmv_features(tracking, features, framenr, ibuf->x, ibuf->y, layer, place_outside_layer); libmv_destroyFeatures(features); +#else + (void)tracking; + (void)ibuf; + (void)framenr; + (void)margin; + (void)min_trackness; + (void)min_distance; + (void)layer; + (void)place_outside_layer; #endif } @@ -2048,6 +2073,8 @@ MovieDistortion *BKE_tracking_distortion_copy(MovieDistortion *distortion) #ifdef WITH_LIBMV new_distortion->intrinsics= libmv_CameraIntrinsicsCopy(distortion->intrinsics); +#else + (void)distortion; #endif return new_distortion; @@ -2068,6 +2095,12 @@ void BKE_tracking_distortion_update(MovieDistortion *distortion, MovieTracking * camera->principal[0], camera->principal[1] * aspy, camera->k1, camera->k2, camera->k3, width, height * aspy); } +#else + (void)distortion; + (void)width; + (void)height; + (void)camera; + (void)aspy; #endif } @@ -2108,6 +2141,11 @@ ImBuf *BKE_tracking_distortion_exec(MovieDistortion *distortion, MovieTracking * #endif } +#ifndef WITH_LIBMV + (void)overscan; + (void)undistort; +#endif + return resibuf; } diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 259b25e67dd..8ad79dd819a 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -362,7 +362,7 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data) { Image *ima; - const char *absbase= (flag & BPATH_TRAVERSE_ABS) ? (id->lib ? id->lib->filepath : bmain->name) : NULL; + const char *absbase= (flag & BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL; if ((flag & BPATH_TRAVERSE_SKIP_LIBRARY) && id->lib) { return; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7ce7e0291a2..b0f597ba477 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12516,13 +12516,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) cam->sensor_y = DEFAULT_SENSOR_HEIGHT; } } + } - { - bNodeTreeType *ntreetype= ntreeGetType(NTREE_SHADER); + if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 2)) { + bNodeTreeType *ntreetype= ntreeGetType(NTREE_SHADER); - if(ntreetype && ntreetype->foreach_nodetree) - ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_mapping_260); - } + if(ntreetype && ntreetype->foreach_nodetree) + ntreetype->foreach_nodetree(main, NULL, do_version_ntree_tex_mapping_260); } /* put compatibility code here until next subversion bump */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b89b0cda451..bd02df2ddba 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1772,8 +1772,6 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op) if (gp_session_initdata(C, p)) gp_paint_initstroke(p, p->paintmode); - p= op->customdata; - if(p->status != GP_STATUS_ERROR) p->status= GP_STATUS_PAINTING; diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index b120bc72f5d..4bc0963aad4 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -132,15 +132,14 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r glEnd(); } -static void round_box_shade_col(const float col1[4], float const col2[4], const float fac) +static void round_box_shade_col(const float col1[3], float const col2[3], const float fac) { - float col[4]; + float col[3]; col[0]= (fac*col1[0] + (1.0f-fac)*col2[0]); col[1]= (fac*col1[1] + (1.0f-fac)*col2[1]); col[2]= (fac*col1[2] + (1.0f-fac)*col2[2]); - col[3]= (fac*col1[3] + (1.0f-fac)*col2[3]); - glColor4fv(col); + glColor3fv(col); } /* linear horizontal shade within button or in outline */ @@ -151,7 +150,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; const float div= maxy - miny; const float idiv= 1.0f / div; - float coltop[4], coldown[4], color[4]; + float coltop[3], coldown[3], color[4]; int a; /* mult */ @@ -165,11 +164,9 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl coltop[0]= color[0]+shadetop; if(coltop[0]>1.0f) coltop[0]= 1.0f; coltop[1]= color[1]+shadetop; if(coltop[1]>1.0f) coltop[1]= 1.0f; coltop[2]= color[2]+shadetop; if(coltop[2]>1.0f) coltop[2]= 1.0f; - coltop[3]= color[3]; coldown[0]= color[0]+shadedown; if(coldown[0]<0.0f) coldown[0]= 0.0f; coldown[1]= color[1]+shadedown; if(coldown[1]<0.0f) coldown[1]= 0.0f; coldown[2]= color[2]+shadedown; if(coldown[2]<0.0f) coldown[2]= 0.0f; - coldown[3]= color[3]; glShadeModel(GL_SMOOTH); glBegin(mode); @@ -261,7 +258,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; const float div= maxx - minx; const float idiv= 1.0f / div; - float colLeft[4], colRight[4], color[4]; + float colLeft[3], colRight[3], color[4]; int a; /* mult */ @@ -275,11 +272,9 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float colLeft[0]= color[0]+shadeLeft; if(colLeft[0]>1.0f) colLeft[0]= 1.0f; colLeft[1]= color[1]+shadeLeft; if(colLeft[1]>1.0f) colLeft[1]= 1.0f; colLeft[2]= color[2]+shadeLeft; if(colLeft[2]>1.0f) colLeft[2]= 1.0f; - colLeft[3]= color[3]; colRight[0]= color[0]+shadeRight; if(colRight[0]<0.0f) colRight[0]= 0.0f; colRight[1]= color[1]+shadeRight; if(colRight[1]<0.0f) colRight[1]= 0.0f; colRight[2]= color[2]+shadeRight; if(colRight[2]<0.0f) colRight[2]= 0.0f; - colRight[3]= color[3]; glShadeModel(GL_SMOOTH); glBegin(mode); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e3301e5408f..9fa8377b0ca 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -497,9 +497,6 @@ void ED_region_do_draw(bContext *C, ARegion *ar) uiFreeInactiveBlocks(C, &ar->uiblocks); - /* XXX test: add convention to end regions always in pixel space, for drawing of borders/gestures etc */ - ED_region_pixelspace(ar); - if(sa) region_draw_emboss(ar, &winrct); } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 39fae43a877..05fdcd50067 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -100,7 +100,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) { FileBrowseOp *fbo= op->customdata; ID *id; - char *base, *str, path[FILE_MAX]; + char *str, path[FILE_MAX]; const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath"; if (RNA_property_is_set(op->ptr, path_prop)==0 || fbo==NULL) @@ -113,10 +113,9 @@ static int file_browse_exec(bContext *C, wmOperator *op) char name[FILE_MAX]; id = fbo->ptr.id.data; - base = (id && id->lib)? id->lib->filepath: G.main->name; BLI_strncpy(path, str, FILE_MAX); - BLI_path_abs(path, base); + BLI_path_abs(path, id ? ID_BLEND_PATH(G.main, id) : G.main->name); if(BLI_is_dir(path)) { str = MEM_reallocN(str, strlen(str)+2); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 0da68953593..9eb96a9a4c5 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -594,7 +594,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra } /* pyramid */ - if((sel == TRACK_SELECTED(track) && sel && (sc->flag&SC_SHOW_PYRAMID_LEVELS) && (track->tracker==TRACKER_KLT))) { + if(sel && TRACK_SELECTED(track) && (sc->flag&SC_SHOW_PYRAMID_LEVELS) && (track->tracker==TRACKER_KLT) && (marker->flag&MARKER_DISABLED)==0) { if(track->flag&TRACK_LOCKED) { if(act) UI_ThemeColor(TH_ACT_MARKER); else if(track->pat_flag&SELECT) UI_ThemeColorShade(TH_LOCK_MARKER, 64); @@ -626,7 +626,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra glDisable(GL_LINE_STIPPLE); glPopMatrix(); } - } + } if(tiny) glDisable(GL_LINE_STIPPLE); diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 0de7fed1f1a..c5036145792 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -184,10 +184,18 @@ static int selected_boundbox(SpaceClip *sc, float min[2], float max[2]) if(marker) { float pos[3]; - pos[0]= (marker->pos[0]+track->offset[0])*width; - pos[1]= (marker->pos[1]+track->offset[1])*height; + pos[0]= marker->pos[0]+track->offset[0]; + pos[1]= marker->pos[1]+track->offset[1]; pos[2]= 0.0f; + /* undistortion happens for normalized coords */ + if(sc->user.render_flag&MCLIP_PROXY_RENDER_UNDISTORT) + /* undistortion happens for normalized coords */ + ED_clip_point_undistorted_pos(sc, pos, pos); + + pos[0]*= width; + pos[1]*= height; + mul_v3_m4v3(pos, sc->stabmat, pos); DO_MINMAX2(pos, min, max); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index aab7188c069..e5bf053aa1c 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -2873,10 +2873,11 @@ static int clean_tracks_exec(bContext *C, wmOperator *op) BKE_tracking_free_track(track); BLI_freelinkN(&clip->tracking.tracks, track); + track= NULL; } /* happens when all tracking segments are not long enough */ - if(track->markersnr==0) { + if(track && track->markersnr==0) { if(track==act_track) clip->tracking.act_track= NULL; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 3c2de3f4711..e6a219f4685 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -949,7 +949,7 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), Poin PointerRNA mappingptr = RNA_pointer_get(ptr, "mapping"); uiLayout *row; - uiItemL(layout, "Translation:", ICON_NONE); + uiItemL(layout, "Location:", ICON_NONE); row= uiLayoutRow(layout, 1); uiItemR(row, &mappingptr, "location", 0, "", ICON_NONE); @@ -961,7 +961,6 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), Poin row= uiLayoutRow(layout, 1); uiItemR(row, &mappingptr, "scale", 0, "", ICON_NONE); -#if 0 row= uiLayoutRow(layout, 1); uiItemR(row, &mappingptr, "use_min", 0, "Min", ICON_NONE); uiItemR(row, &mappingptr, "min", 0, "", ICON_NONE); @@ -969,7 +968,6 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), Poin row= uiLayoutRow(layout, 1); uiItemR(row, &mappingptr, "use_max", 0, "Max", ICON_NONE); uiItemR(row, &mappingptr, "max", 0, "", ICON_NONE); -#endif } static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) @@ -996,20 +994,6 @@ static void node_shader_buts_geometry(uiLayout *layout, bContext *C, PointerRNA } } -/*static void node_layout_prop(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname) -{ - if(C && CTX_wm_space_node(C)) { - uiItemR(layout, ptr, propname, 0, NULL, ICON_NONE); - } - else { - uiLayout *split = uiLayoutSplit(layout, 0.35f, 0); - PropertyRNA *prop = RNA_struct_find_property(ptr, propname); - - uiItemL(uiLayoutColumn(split, 0), RNA_property_ui_name(prop), ICON_NONE); - uiItemR(uiLayoutColumn(split, 0), ptr, propname, 0, "", ICON_NONE); - } -}*/ - static void node_shader_buts_attribute(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "attribute_name", 0, "Name", ICON_NONE); diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index c7556a2818e..a03d6ce280d 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -57,7 +57,6 @@ set(SRC intern/metadata.c intern/module.c intern/moviecache.c - intern/openimageio.cpp intern/png.c intern/readimage.c intern/rectop.c @@ -179,11 +178,4 @@ if(WITH_IMAGE_HDR) add_definitions(-DWITH_HDR) endif() -if(WITH_OPENIMAGEIO) - list(APPEND INC_SYS - ${OPENIMAGEIO_INCLUDES} - ) - # disabled for now add_definitions(-DWITH_OPENIMAGEIO ${OPENIMAGEIO_DEFINITIONS}) -endif() - blender_add_lib(bf_imbuf "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h index 78865eca1df..4cd10ad01d0 100644 --- a/source/blender/imbuf/intern/IMB_filetype.h +++ b/source/blender/imbuf/intern/IMB_filetype.h @@ -44,9 +44,6 @@ typedef struct ImFileType { int (*save)(struct ImBuf *ibuf, const char *name, int flags); void (*load_tile)(struct ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect); - int (*is_a_filepath)(const char *filepath); - struct ImBuf *(*load_filepath)(const char *filepath, int flags); - int flag; int filetype; } ImFileType; @@ -122,20 +119,5 @@ void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, size_t size, int imb_savetiff(struct ImBuf *ibuf, const char *name, int flags); void *libtiff_findsymbol(char *name); -/* openimageio */ -#ifdef __cplusplus -extern "C" { -#endif - -int imb_is_a_openimageio(unsigned char *buf); -int imb_is_a_filepath_openimageio(const char *filepath); -int imb_ftype_openimageio(struct ImFileType *type, struct ImBuf *ibuf); -struct ImBuf *imb_load_openimageio(const char *filepath, int flags); -int imb_save_openimageio(struct ImBuf *ibuf, const char *filepath, int flags); - -#ifdef __cplusplus -} -#endif - #endif /* IMB_FILETYPE_H */ diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c index 88b17d75eb4..c03736f4b0a 100644 --- a/source/blender/imbuf/intern/filetype.c +++ b/source/blender/imbuf/intern/filetype.c @@ -49,6 +49,9 @@ static int imb_ftype_default(ImFileType *type, ImBuf *ibuf) { return (ibuf->ftyp static int imb_ftype_cocoa(ImFileType *type, ImBuf *ibuf) { return (ibuf->ftype & TIF); } #endif static int imb_ftype_iris(ImFileType *type, ImBuf *ibuf) { (void)type; return (ibuf->ftype == IMAGIC); } +#ifdef WITH_QUICKTIME +static int imb_ftype_quicktime(ImFileType *type, ImBuf *ibuf) { return 0; } // XXX +#endif #ifdef WITH_QUICKTIME void quicktime_init(void); @@ -56,39 +59,36 @@ void quicktime_exit(void); #endif ImFileType IMB_FILE_TYPES[]= { -#ifdef WITH_OPENIMAGEIO - {NULL, NULL, imb_is_a_openimageio, imb_ftype_openimageio, NULL, imb_save_openimageio, NULL, imb_is_a_filepath_openimageio, imb_load_openimageio, 0, 0}, -#endif - {NULL, NULL, imb_is_a_jpeg, imb_ftype_default, imb_load_jpeg, imb_savejpeg, NULL, NULL, NULL, 0, JPG}, - {NULL, NULL, imb_is_a_png, imb_ftype_default, imb_loadpng, imb_savepng, NULL, NULL, NULL, 0, PNG}, - {NULL, NULL, imb_is_a_bmp, imb_ftype_default, imb_bmp_decode, imb_savebmp, NULL, NULL, NULL, 0, BMP}, - {NULL, NULL, imb_is_a_targa, imb_ftype_default, imb_loadtarga, imb_savetarga, NULL, NULL, NULL, 0, TGA}, - {NULL, NULL, imb_is_a_iris, imb_ftype_iris, imb_loadiris, imb_saveiris, NULL, NULL, NULL, 0, IMAGIC}, + {NULL, NULL, imb_is_a_jpeg, imb_ftype_default, imb_load_jpeg, imb_savejpeg, NULL, 0, JPG}, + {NULL, NULL, imb_is_a_png, imb_ftype_default, imb_loadpng, imb_savepng, NULL, 0, PNG}, + {NULL, NULL, imb_is_a_bmp, imb_ftype_default, imb_bmp_decode, imb_savebmp, NULL, 0, BMP}, + {NULL, NULL, imb_is_a_targa, imb_ftype_default, imb_loadtarga, imb_savetarga, NULL, 0, TGA}, + {NULL, NULL, imb_is_a_iris, imb_ftype_iris, imb_loadiris, imb_saveiris, NULL, 0, IMAGIC}, #ifdef WITH_CINEON - {NULL, NULL, imb_is_dpx, imb_ftype_default, imb_loaddpx, imb_save_dpx, NULL, NULL, NULL, IM_FTYPE_FLOAT, DPX}, - {NULL, NULL, imb_is_cineon, imb_ftype_default, imb_loadcineon, imb_savecineon, NULL, NULL, NULL, IM_FTYPE_FLOAT, CINEON}, + {NULL, NULL, imb_is_dpx, imb_ftype_default, imb_loaddpx, imb_save_dpx, NULL, IM_FTYPE_FLOAT, DPX}, + {NULL, NULL, imb_is_cineon, imb_ftype_default, imb_loadcineon, imb_savecineon, NULL, IM_FTYPE_FLOAT, CINEON}, #endif #ifdef WITH_TIFF - {imb_inittiff, NULL, imb_is_a_tiff, imb_ftype_default, imb_loadtiff, imb_savetiff, imb_loadtiletiff, NULL, NULL, 0, TIF}, + {imb_inittiff, NULL, imb_is_a_tiff, imb_ftype_default, imb_loadtiff, imb_savetiff, imb_loadtiletiff, 0, TIF}, #elif defined(__APPLE__) && defined(IMBUF_COCOA) - {NULL, NULL, imb_is_a_cocoa, imb_ftype_cocoa, imb_imb_cocoaLoadImage, imb_savecocoa, NULL, NULL, NULL, 0, TIF}, + {NULL, NULL, imb_is_a_cocoa, imb_ftype_cocoa, imb_imb_cocoaLoadImage, imb_savecocoa, NULL, 0, TIF}, #endif #ifdef WITH_HDR - {NULL, NULL, imb_is_a_hdr, imb_ftype_default, imb_loadhdr, imb_savehdr, NULL, NULL, NULL, IM_FTYPE_FLOAT, RADHDR}, + {NULL, NULL, imb_is_a_hdr, imb_ftype_default, imb_loadhdr, imb_savehdr, NULL, IM_FTYPE_FLOAT, RADHDR}, #endif #ifdef WITH_OPENEXR - {NULL, NULL, imb_is_a_openexr, imb_ftype_default, imb_load_openexr, imb_save_openexr, NULL, NULL, NULL, IM_FTYPE_FLOAT, OPENEXR}, + {NULL, NULL, imb_is_a_openexr, imb_ftype_default, imb_load_openexr, imb_save_openexr, NULL, IM_FTYPE_FLOAT, OPENEXR}, #endif #ifdef WITH_OPENJPEG - {NULL, NULL, imb_is_a_jp2, imb_ftype_default, imb_jp2_decode, imb_savejp2, NULL, NULL, NULL, IM_FTYPE_FLOAT, JP2}, + {NULL, NULL, imb_is_a_jp2, imb_ftype_default, imb_jp2_decode, imb_savejp2, NULL, IM_FTYPE_FLOAT, JP2}, #endif #ifdef WITH_DDS - {NULL, NULL, imb_is_a_dds, imb_ftype_default, imb_load_dds, NULL, NULL, NULL, NULL, 0, DDS}, + {NULL, NULL, imb_is_a_dds, imb_ftype_default, imb_load_dds, NULL, NULL, 0, DDS}, #endif #ifdef WITH_QUICKTIME - {quicktime_init, quicktime_exit, imb_is_a_quicktime, NULL, imb_quicktime_decode, NULL, NULL, NULL, 0, QUICKTIME}, + {quicktime_init, quicktime_exit, imb_is_a_quicktime, imb_ftype_quicktime, imb_quicktime_decode, NULL, NULL, 0, QUICKTIME}, #endif - {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0}}; + {NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0}}; void imb_filetypes_init(void) { diff --git a/source/blender/imbuf/intern/openimageio.cpp b/source/blender/imbuf/intern/openimageio.cpp deleted file mode 100644 index 2e5dd5b6613..00000000000 --- a/source/blender/imbuf/intern/openimageio.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * $Id: png.c 36777 2011-05-19 11:54:03Z blendix $ - */ - -/** \file blender/imbuf/intern/png.c - * \ingroup imbuf - */ - -#ifdef WITH_OPENIMAGEIO - -#include "MEM_sys_types.h" - -#include "imbuf.h" - -extern "C" { - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "IMB_allocimbuf.h" -#include "IMB_metadata.h" -#include "IMB_filetype.h" - -} - -#include <OpenImageIO/imageio.h> - -OIIO_NAMESPACE_USING - -int imb_is_a_openimageio(unsigned char *buf) -{ - return 0; -} - -int imb_is_a_filepath_openimageio(const char *filepath) -{ - ImageInput *in = ImageInput::create(filepath); - ImageSpec spec; - int recognized = in->open(filepath, spec); - in->close(); - - return recognized; -} - -template<typename T> static void pack_pixels(T *pixels, int width, int height, int components, T alpha) -{ - if(components == 3) { - for(int i = width*height-1; i >= 0; i--) { - pixels[i*4+3] = alpha; - pixels[i*4+2] = pixels[i*3+2]; - pixels[i*4+1] = pixels[i*3+1]; - pixels[i*4+0] = pixels[i*3+0]; - } - } - else if(components == 1) { - for(int i = width*height-1; i >= 0; i--) { - pixels[i*4+3] = alpha; - pixels[i*4+2] = pixels[i]; - pixels[i*4+1] = pixels[i]; - pixels[i*4+0] = pixels[i]; - } - } -} - -int imb_ftype_openimageio(ImFileType *type, ImBuf *ibuf) -{ - return ibuf->ftype & (PNG|TGA|JPG|BMP|RADHDR|TIF|OPENEXR|CINEON|DPX|DDS|JP2); -} - -static int format_name_to_ftype(const char *format_name) -{ - if(strcmp(format_name, "png") == 0) - return PNG; - else if(strcmp(format_name, "targa") == 0) - return TGA; /* RAWTGA */ - else if(strcmp(format_name, "jpeg") == 0) - return JPG; - else if(strcmp(format_name, "bmp") == 0) - return BMP; - else if(strcmp(format_name, "hdr") == 0) - return RADHDR; - else if(strcmp(format_name, "tiff") == 0) - return TIF; /* TIF_16BIT */ - else if(strcmp(format_name, "openexr") == 0) - return OPENEXR; /* OPENEXR_HALF, OPENEXR_COMPRESS */ - else if(strcmp(format_name, "cineon") == 0) - return CINEON; - else if(strcmp(format_name, "dpx") == 0) - return DPX; - else if(strcmp(format_name, "dds") == 0) - return DDS; - else if(strcmp(format_name, "jpeg2000") == 0) - return JP2; /* JP2_12BIT, JP2_16BIT, JP2_YCC , JP2_CINE , JP2_CINE_48FPS */ - - /* not handled: "field3d", "fits", "ico", "iff", "pnm", "ptex", "sgi", "zfile" */ - - return 0; -} - -ImBuf *imb_load_openimageio(const char *filepath, int flags) -{ - ImageInput *in = ImageInput::create(filepath); - ImageSpec spec; - bool success; - - if(!in->open(filepath, spec)) { - delete in; - return NULL; - } - - /* we only handle certain number of components */ - int width = spec.width; - int height = spec.height; - int components = spec.nchannels; - - if(!(components == 1 || components == 3 || components == 4)) { - delete in; - return NULL; - } - - ImBuf *ibuf = IMB_allocImBuf(width, height, 32, 0); - ibuf->ftype = format_name_to_ftype(in->format_name()); - - /* TODO: handle oiio:ColorSpace, oiio:Gamma, metadata, multilayer, size_t_safe */ - - /* read RGBA pixels */ - if(spec.format == TypeDesc::UINT8 || spec.format == TypeDesc::INT8) { - //if(in->get_string_attribute("oiio:ColorSpace") == "sRGB") - ibuf->profile = IB_PROFILE_SRGB; - - imb_addrectImBuf(ibuf); - - uint8_t *pixels = (uint8_t*)ibuf->rect; - int scanlinesize = width*components; - - success = in->read_image(TypeDesc::UINT8, - pixels + (height-1)*scanlinesize, - AutoStride, - -scanlinesize*sizeof(uint8_t), - AutoStride); - - pack_pixels<uint8_t>(pixels, width, height, components, 255); - } - else { - ibuf->profile = IB_PROFILE_LINEAR_RGB; /* XXX assumption */ - - imb_addrectfloatImBuf(ibuf); - - float *pixels = ibuf->rect_float; - int scanlinesize = width*components; - - success = in->read_image(TypeDesc::FLOAT, - pixels + (height-1)*scanlinesize, - AutoStride, - -scanlinesize*sizeof(float), - AutoStride); - - pack_pixels<float>(pixels, width, height, components, 1.0f); - } - - if(!success) - fprintf(stderr, "OpenImageIO: error loading image: %s\n", in->geterror().c_str()); - - in->close(); - delete in; - - return ibuf; -} - -int imb_save_openimageio(struct ImBuf *ibuf, const char *filepath, int flags) -{ - ImageOutput *out = ImageOutput::create(filepath); - - if(ibuf->rect_float) { - /* XXX profile */ - - /* save as float image XXX works? */ - ImageSpec spec(ibuf->x, ibuf->y, 4, TypeDesc::FLOAT); - int scanlinesize = ibuf->x*4; - - out->open(filepath, spec); - - /* conversion for different top/bottom convention */ - out->write_image(TypeDesc::FLOAT, - ibuf->rect_float + (ibuf->y-1)*scanlinesize, - AutoStride, - -scanlinesize*sizeof(float), - AutoStride); - } - else { - /* save as 8bit image */ - ImageSpec spec(ibuf->x, ibuf->y, 4, TypeDesc::UINT8); - int scanlinesize = ibuf->x*4; - - out->open(filepath, spec); - - /* conversion for different top/bottom convention */ - out->write_image(TypeDesc::UINT8, - (uint8_t*)ibuf->rect + (ibuf->y-1)*scanlinesize, - AutoStride, - -scanlinesize*sizeof(uint8_t), - AutoStride); - } - - out->close(); - delete out; - - return 1; -} - -#endif /* WITH_OPENIMAGEIO */ - diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index 5f7c4bfeedf..c2f73efa63f 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -50,28 +50,6 @@ #include "IMB_imbuf.h" #include "IMB_filetype.h" -static ImBuf *imb_ibImageFromFile(const char *filepath, int flags) -{ - ImBuf *ibuf; - ImFileType *type; - - for(type=IMB_FILE_TYPES; type->is_a; type++) { - if(type->load_filepath) { - ibuf= type->load_filepath(filepath, flags); - if(ibuf) { - if(flags & IB_premul) { - IMB_premultiply_alpha(ibuf); - ibuf->flags |= IB_premul; - } - - return ibuf; - } - } - } - - return NULL; -} - ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, const char *descr) { ImBuf *ibuf; @@ -148,15 +126,10 @@ ImBuf *IMB_loadiffname(const char *filepath, int flags) imb_cache_filename(filepath_tx, filepath, flags); - ibuf= imb_ibImageFromFile(filepath_tx, flags); - - if(!ibuf) { - file = open(filepath_tx, O_BINARY|O_RDONLY); - if(file < 0) return NULL; + file = open(filepath_tx, O_BINARY|O_RDONLY); + if(file < 0) return NULL; - ibuf= IMB_loadifffile(file, flags, filepath_tx); - close(file); - } + ibuf= IMB_loadifffile(file, flags, filepath_tx); if(ibuf) { BLI_strncpy(ibuf->name, filepath, sizeof(ibuf->name)); @@ -166,6 +139,8 @@ ImBuf *IMB_loadiffname(const char *filepath, int flags) if(flags & IB_fields) IMB_de_interlace(ibuf); } + close(file); + return ibuf; } @@ -209,7 +184,7 @@ static void imb_loadtilefile(ImBuf *ibuf, int file, int tx, int ty, unsigned int } for(type=IMB_FILE_TYPES; type->is_a; type++) - if(type->load_tile && type->ftype && type->ftype(type, ibuf)) + if(type->load_tile && type->ftype(type, ibuf)) type->load_tile(ibuf, mem, size, tx, ty, rect); if(munmap(mem, size)) diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 770e425e9a8..872b78743be 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -153,10 +153,6 @@ static int IMB_ispic_name(const char *name) int fp, buf[10]; if(UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name); - - /*for(type=IMB_FILE_TYPES; type->is_a; type++) - if(type->is_a_filepath && type->is_a_filepath(name)) - return type->filetype;*/ if(stat(name,&st) == -1) return FALSE; @@ -178,7 +174,7 @@ static int IMB_ispic_name(const char *name) return JPG; for(type=IMB_FILE_TYPES; type->is_a; type++) - if(type->is_a && type->is_a((uchar*)buf)) + if(type->is_a((uchar*)buf)) return type->filetype; return FALSE; diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index cdf68b0ee67..8fbed6da32b 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -48,7 +48,7 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags) ibuf->flags = flags; for(type=IMB_FILE_TYPES; type->is_a; type++) { - if(type->save && type->ftype && type->ftype(type, ibuf)) { + if(type->save && type->ftype(type, ibuf)) { if(!(type->flag & IM_FTYPE_FLOAT)) { if(ibuf->rect==NULL && ibuf->rect_float) IMB_rect_from_float(ibuf); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 2a6329285d2..3e74243f858 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -63,7 +63,6 @@ struct bScreen; struct Scene; struct wmOperator; struct wmTimer; -struct Tex; struct MovieClip; struct MovieClipScopes; diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index ef9bf6a9e02..f00b97994d5 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -95,41 +95,6 @@ static void engine_render(RenderEngine *engine, struct Scene *scene) RNA_parameter_list_free(&list); } -static void engine_preview_update(RenderEngine *engine, const struct bContext *context, struct ID *id) -{ - extern FunctionRNA rna_RenderEngine_preview_update_func; - PointerRNA ptr; - ParameterList list; - FunctionRNA *func; - - RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); - func= &rna_RenderEngine_preview_update_func; - - RNA_parameter_list_create(&list, &ptr, func); - RNA_parameter_set_lookup(&list, "context", &context); - RNA_parameter_set_lookup(&list, "id", &id); - engine->type->ext.call(NULL, &ptr, func, &list); - - RNA_parameter_list_free(&list); -} - -static void engine_preview_render(RenderEngine *engine) -{ - extern FunctionRNA rna_RenderEngine_preview_render_func; - - PointerRNA ptr; - ParameterList list; - FunctionRNA *func; - - RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); - func= &rna_RenderEngine_preview_render_func; - - RNA_parameter_list_create(&list, &ptr, func); - engine->type->ext.call(NULL, &ptr, func, &list); - - RNA_parameter_list_free(&list); -} - static void engine_view_update(RenderEngine *engine, const struct bContext *context) { extern FunctionRNA rna_RenderEngine_view_update_func; @@ -183,7 +148,7 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo RenderEngineType *et, dummyet = {NULL}; RenderEngine dummyengine= {NULL}; PointerRNA dummyptr; - int have_function[6]; + int have_function[4]; /* setup dummy engine & engine type to store static properties in */ dummyengine.type= &dummyet; @@ -220,10 +185,8 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo et->update= (have_function[0])? engine_update: NULL; et->render= (have_function[1])? engine_render: NULL; - et->preview_update= (have_function[2])? engine_preview_update: NULL; - et->preview_render= (have_function[3])? engine_preview_render: NULL; - et->view_update= (have_function[4])? engine_view_update: NULL; - et->view_draw= (have_function[5])? engine_view_draw: NULL; + et->view_update= (have_function[2])? engine_view_update: NULL; + et->view_draw= (have_function[3])? engine_view_draw: NULL; BLI_addtail(&R_engines, et); @@ -324,17 +287,6 @@ static void rna_def_render_engine(BlenderRNA *brna) RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_pointer(func, "scene", "Scene", "", ""); - /* preview render callbacks */ - func= RNA_def_function(srna, "preview_update", NULL); - RNA_def_function_ui_description(func, "Export scene data for preview render of the given datablock"); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); - RNA_def_pointer(func, "context", "Context", "", ""); - RNA_def_pointer(func, "id", "ID", "", ""); - - func= RNA_def_function(srna, "preview_render", NULL); - RNA_def_function_ui_description(func, "Execute preview render"); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); - /* viewport render callbacks */ func= RNA_def_function(srna, "view_update", NULL); RNA_def_function_ui_description(func, "Update on data changes for viewport render"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 4245d606f61..b1d4654f76b 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3761,7 +3761,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_struct_type(prop, "TransformOrientation"); RNA_def_property_ui_text(prop, "Transform Orientations", ""); - /* acctive MovieClip */ + /* active MovieClip */ prop= RNA_def_property(srna, "active_clip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clip"); RNA_def_property_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index d4e39a5a8e4..f1a6bb1b921 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -118,10 +118,10 @@ void RNA_api_environment_map(StructRNA *srna) RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken"); - parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", - "Flat array describing the X,Y position of each cube face in the " - "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " - "(use -1 to skip a face)", 0.0f, 0.0f); + RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", + "Flat array describing the X,Y position of each cube face in the " + "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] " + "(use -1 to skip a face)", 0.0f, 0.0f); } #endif diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 34307f972c5..f72fd3d465c 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -488,7 +488,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna) RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, "rna_tracking_trackerPyramid_update"); /* minmal correlation - only used for SAD tracker */ - prop= RNA_def_property(srna, "minimum_correlation", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "correlation_min", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_float_sdna(prop, NULL, "minimum_correlation"); RNA_def_property_range(prop, -1.0f, 1.0f); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 7160ac75650..366ba1daf85 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -427,9 +427,9 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "prop_list", "", 0, "", - "Identifier of a string property in each data member, specifying which " - "of its properties should have a widget displayed in its row"); + RNA_def_string(func, "prop_list", "", 0, "", + "Identifier of a string property in each data member, specifying which " + "of its properties should have a widget displayed in its row"); RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX); RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX); RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use"); diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c index 2eff74651ef..2fa885dcdd3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.c +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c @@ -67,7 +67,7 @@ static void node_shader_exec_mapping(void *UNUSED(data), bNode *node, bNodeStack } -static void node_shader_default_mapping(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(ntemp)) +static void node_shader_init_mapping(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(ntemp)) { node->storage= add_tex_mapping(); } @@ -94,7 +94,7 @@ void register_node_type_sh_mapping(ListBase *lb) node_type_compatibility(&ntype, NODE_OLD_SHADING|NODE_NEW_SHADING); node_type_socket_templates(&ntype, sh_node_mapping_in, sh_node_mapping_out); node_type_size(&ntype, 240, 160, 320); - node_type_init(&ntype, node_shader_default_mapping); + node_type_init(&ntype, node_shader_init_mapping); node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); node_type_exec(&ntype, node_shader_exec_mapping); node_type_gpu(&ntype, gpu_shader_mapping); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index de2433c8766..7dee2ce6fb4 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -187,7 +187,7 @@ static struct _inittab bpy_internal_modules[]= { {(char *)"aud", AUD_initPython}, #endif #ifdef WITH_CYCLES - {(char *)"libcycles_blender", CYCLES_initPython}, + {(char *)"bcycles", CYCLES_initPython}, #endif {(char *)"gpu", GPU_initPython}, {NULL, NULL} diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h index d8c78ef82a2..e521479bbcd 100644 --- a/source/blender/render/extern/include/RE_engine.h +++ b/source/blender/render/extern/include/RE_engine.h @@ -72,9 +72,6 @@ typedef struct RenderEngineType { void (*update)(struct RenderEngine *engine, struct Main *bmain, struct Scene *scene); void (*render)(struct RenderEngine *engine, struct Scene *scene); - void (*preview_update)(struct RenderEngine *engine, const struct bContext *context, struct ID *id); - void (*preview_render)(struct RenderEngine *engine); - void (*view_update)(struct RenderEngine *engine, const struct bContext *context); void (*view_draw)(struct RenderEngine *engine, const struct bContext *context); diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 6835a8b2cc0..b7f89e260a8 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -61,7 +61,7 @@ static RenderEngineType internal_render_type = { NULL, NULL, "BLENDER_RENDER", "Blender Render", RE_INTERNAL, - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, {NULL, NULL, NULL}}; #ifdef WITH_GAMEENGINE @@ -69,7 +69,7 @@ static RenderEngineType internal_render_type = { static RenderEngineType internal_game_type = { NULL, NULL, "BLENDER_GAME", "Blender Game", RE_INTERNAL|RE_GAME, - NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, {NULL, NULL, NULL}}; #endif @@ -265,8 +265,7 @@ int RE_engine_render(Render *re, int do_all) /* verify if we can render */ if(!type->render) return 0; - if((re->r.scemode & R_PREVIEWBUTS) && !((type->flag & RE_USE_PREVIEW) || - (type->preview_update && type->preview_render))) + if((re->r.scemode & R_PREVIEWBUTS) && !(type->flag & RE_USE_PREVIEW)) return 0; if(do_all && !(type->flag & RE_USE_POSTPROCESS)) return 0; @@ -296,16 +295,10 @@ int RE_engine_render(Render *re, int do_all) if((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0) scene_update_for_newframe(re->main, re->scene, re->lay); - if(type->preview_update && type->preview_render) { - //type->preview_update(engine, scene, id); - type->preview_render(engine); - } - else { - if(type->update) - type->update(engine, re->main, re->scene); - if(type->render) - type->render(engine, re->scene); - } + if(type->update) + type->update(engine, re->main, re->scene); + if(type->render) + type->render(engine, re->scene); free_render_result(&engine->fullresult, engine->fullresult.first); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 83e4681251f..8d7e812a386 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -733,7 +733,7 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re /* send the OnSave event */ for (li= G.main->library.first; li; li= li->id.next) { if (BLI_path_cmp(li->filepath, filepath) == 0) { - BKE_reportf(reports, RPT_ERROR, "Can't overwrite used library '%.200s'", filepath); + BKE_reportf(reports, RPT_ERROR, "Can't overwrite used library '%.240s'", filepath); return -1; } } diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 0e0830f0fa2..bb55d05cb28 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -728,7 +728,7 @@ elseif(APPLE) endif() endif() -# install more files XXX pass target dir +# install more files specified elsewhere delayed_do_install(${TARGETDIR_VER}) unset(BLENDER_TEXT_FILES) @@ -864,8 +864,6 @@ endif() bf_blenfont bf_intern_audaspace bf_intern_mikktspace - extern_recastnavigation - bf_editor_util # --- BAD LEVEL CALL HERE --- XXX, this should be removed before release! bf_intern_cycles cycles_render cycles_bvh |