Merging r57605 through r57628 from trunk into soc-2013-depsgraph_mt
This commit is contained in:
@@ -264,7 +264,7 @@ option(WITH_CYCLES "Enable cycles Render Engine" ON)
|
||||
option(WITH_CYCLES_TEST "Build cycles test application" OFF)
|
||||
option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF)
|
||||
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 CACHE STRING "CUDA architectures to build binaries for")
|
||||
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 CACHE STRING "CUDA architectures to build binaries for")
|
||||
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
|
||||
unset(PLATFORM_DEFAULT)
|
||||
|
||||
|
||||
@@ -1550,7 +1550,7 @@ compile_OSL() {
|
||||
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
cd $_src
|
||||
git checkout blender-fixes
|
||||
#git checkout blender-fixes
|
||||
cd $CWD
|
||||
fi
|
||||
|
||||
@@ -2278,8 +2278,18 @@ install_RPM() {
|
||||
fi
|
||||
|
||||
_suse_rel="`grep VERSION /etc/SuSE-release | gawk '{print $3}'`"
|
||||
sudo zypper ar -f http://packman.inode.at/suse/openSUSE_$_suse_rel/ packman
|
||||
|
||||
INFO ""
|
||||
INFO "About to add 'packman' repository from http://packman.inode.at/suse/openSUSE_$_suse_rel/"
|
||||
INFO "This is only needed if you do not already have a packman repository enabled..."
|
||||
read -p "Do you want to add this repo (Y/n)?"
|
||||
if [ "$(echo ${REPLY:=Y} | tr [:upper:] [:lower:])" == "y" ]; then
|
||||
INFO " Installing packman..."
|
||||
sudo zypper ar --refresh --name 'Packman Repository' http://ftp.gwdg.de/pub/linux/packman/suse/openSUSE_$_suse_rel/ ftp.gwdg.de-suse
|
||||
INFO " Done."
|
||||
else
|
||||
INFO " Skipping packman installation."
|
||||
fi
|
||||
sudo zypper --non-interactive --gpg-auto-import-keys update --auto-agree-with-licenses
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
|
||||
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
|
||||
BF_NUMJOBS = 1
|
||||
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
@@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = True
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
@@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = True
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
@@ -155,9 +155,9 @@ else:
|
||||
|
||||
scons_options.append('BF_CONFIG=' + os.path.join(config_dir, config))
|
||||
|
||||
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
|
||||
|
||||
if builder.find('win') != -1:
|
||||
if not os.path.exists(install_dir):
|
||||
os.makedirs(install_dir)
|
||||
if builder.endswith('vc2012'):
|
||||
dlls = ('msvcp110.dll', 'msvcr110.dll', 'vcomp110.dll')
|
||||
else:
|
||||
@@ -169,4 +169,6 @@ else:
|
||||
for dll in dlls:
|
||||
shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll))
|
||||
|
||||
retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
|
||||
|
||||
sys.exit(retcode)
|
||||
|
||||
@@ -315,7 +315,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
#Freestyle
|
||||
WITH_BF_FREESTYLE = True
|
||||
|
||||
@@ -210,7 +210,7 @@ WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
WITH_BF_CYCLES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
|
||||
@@ -215,7 +215,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
|
||||
@@ -146,7 +146,7 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
WITH_BF_CYCLES = True
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
BF_CYCLES_CUDA_NVCC = "" # Path to the NVIDIA CUDA compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
WITH_BF_OIIO = True
|
||||
BF_OIIO = LIBDIR + '/openimageio'
|
||||
|
||||
@@ -212,7 +212,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
#CUDA
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = False
|
||||
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
|
||||
@@ -304,7 +304,7 @@ public:
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* CUDA 4.x */
|
||||
/* CUDA 5.x */
|
||||
if(major == 1) {
|
||||
/* sm_1x */
|
||||
arch_flags = "--maxrregcount=24 --opencc-options -OPT:Olimit=0 --use_fast_math";
|
||||
|
||||
@@ -130,6 +130,12 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
||||
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT})
|
||||
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
|
||||
|
||||
# warn for other versions
|
||||
if(CUDA_VERSION MATCHES "50")
|
||||
else()
|
||||
message(WARNING "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, build may succeed but only CUDA 5.0 is officially supported")
|
||||
endif()
|
||||
|
||||
# build for each arch
|
||||
set(cuda_sources kernel.cu ${SRC_HEADERS} ${SRC_SVM_HEADERS} ${SRC_CLOSURE_HEADERS} ${SRC_UTIL_HEADERS})
|
||||
set(cuda_cubins)
|
||||
@@ -139,12 +145,6 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
||||
|
||||
set(cuda_version_flags "-D__KERNEL_CUDA_VERSION__=${CUDA_VERSION}")
|
||||
|
||||
# warn for other versions
|
||||
if(CUDA_VERSION MATCHES "50")
|
||||
else()
|
||||
message(STATUS "CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, build may succeed but only CUDA 5.0 is officially supported")
|
||||
endif()
|
||||
|
||||
# build flags depending on CUDA version and arch
|
||||
if(CUDA_VERSION LESS 50)
|
||||
# CUDA 4.x
|
||||
@@ -176,13 +176,17 @@ if(WITH_CYCLES_CUDA_BINARIES)
|
||||
set(cuda_math_flags "--use_fast_math")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${cuda_cubin}
|
||||
COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" ${cuda_arch_flags} ${cuda_version_flags} ${cuda_math_flags} -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC
|
||||
DEPENDS ${cuda_sources})
|
||||
if(CUDA_VERSION LESS 50 AND ${arch} MATCHES "sm_35")
|
||||
message(WARNING "Can't build kernel for CUDA sm_35 architecture, skipping")
|
||||
else()
|
||||
add_custom_command(
|
||||
OUTPUT ${cuda_cubin}
|
||||
COMMAND ${CUDA_NVCC_EXECUTABLE} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" ${cuda_arch_flags} ${cuda_version_flags} ${cuda_math_flags} -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC
|
||||
DEPENDS ${cuda_sources})
|
||||
|
||||
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
|
||||
list(APPEND cuda_cubins ${cuda_cubin})
|
||||
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_cubin}" ${CYCLES_INSTALL_PATH}/lib)
|
||||
list(APPEND cuda_cubins ${cuda_cubin})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins})
|
||||
|
||||
@@ -88,6 +88,10 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']:
|
||||
|
||||
# build flags depending on CUDA version and arch
|
||||
if cuda_version < 50:
|
||||
if arch == "sm_35":
|
||||
print("Can't build kernel for CUDA sm_35 architecture, skipping")
|
||||
continue
|
||||
|
||||
# CUDA 4.x
|
||||
if arch.startswith("sm_1"):
|
||||
# sm_1x
|
||||
|
||||
@@ -517,7 +517,7 @@ __device_inline const __m128 shuffle_swap(const __m128& a, const shuffle_swap_t&
|
||||
|
||||
#else
|
||||
|
||||
/* somewhat slower version for SSE3 */
|
||||
/* somewhat slower version for SSE2 */
|
||||
typedef int shuffle_swap_t;
|
||||
|
||||
__device_inline const shuffle_swap_t shuffle_swap_identity(void)
|
||||
|
||||
@@ -1800,9 +1800,7 @@ class VIEW3D_MT_edit_mesh(Menu):
|
||||
layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("mesh.symmetrize")
|
||||
layout.operator("mesh.symmetry_snap")
|
||||
layout.separator()
|
||||
|
||||
layout.operator("mesh.duplicate_move")
|
||||
layout.menu("VIEW3D_MT_edit_mesh_extrude")
|
||||
layout.menu("VIEW3D_MT_edit_mesh_delete")
|
||||
@@ -1816,6 +1814,12 @@ class VIEW3D_MT_edit_mesh(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("mesh.symmetrize")
|
||||
layout.operator("mesh.symmetry_snap")
|
||||
layout.operator_menu_enum("mesh.sort_elements", "type", text="Sort Elements...")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.prop(toolsettings, "use_mesh_automerge")
|
||||
layout.prop_menu_enum(toolsettings, "proportional_edit")
|
||||
layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
|
||||
@@ -1871,6 +1875,7 @@ class VIEW3D_MT_edit_mesh_specials(Menu):
|
||||
layout.operator("mesh.shortest_path_select")
|
||||
layout.operator("mesh.sort_elements")
|
||||
layout.operator("mesh.symmetrize")
|
||||
layout.operator("mesh.symmetry_snap")
|
||||
|
||||
|
||||
class VIEW3D_MT_edit_mesh_select_mode(Menu):
|
||||
@@ -1939,7 +1944,6 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
|
||||
layout.operator("mesh.bevel").vertex_only = True
|
||||
layout.operator("mesh.vertices_smooth")
|
||||
layout.operator("mesh.remove_doubles")
|
||||
layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
|
||||
|
||||
layout.operator("mesh.blend_from_shape")
|
||||
|
||||
@@ -1996,7 +2000,6 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
|
||||
layout.operator("mesh.bevel").vertex_only = False
|
||||
layout.operator("mesh.edge_split")
|
||||
layout.operator("mesh.bridge_edge_loops")
|
||||
layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'}
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -2026,7 +2029,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
|
||||
layout.operator("mesh.bevel").vertex_only = False
|
||||
layout.operator("mesh.solidify")
|
||||
layout.operator("mesh.wireframe")
|
||||
layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'}
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
@@ -232,7 +232,6 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
|
||||
mesh = ob.data
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.active = tool_settings.proportional_edit == 'DISABLED'
|
||||
col.prop(mesh, "use_mirror_x")
|
||||
|
||||
row = col.row()
|
||||
|
||||
@@ -1823,16 +1823,19 @@ DerivedMesh *CDDM_from_curve(Object *ob)
|
||||
|
||||
DerivedMesh *CDDM_from_curve_displist(Object *ob, ListBase *dispbase)
|
||||
{
|
||||
Curve *cu = (Curve *) ob->data;
|
||||
DerivedMesh *dm;
|
||||
CDDerivedMesh *cddm;
|
||||
MVert *allvert;
|
||||
MEdge *alledge;
|
||||
MLoop *allloop;
|
||||
MPoly *allpoly;
|
||||
MLoopUV *alluv = NULL;
|
||||
int totvert, totedge, totloop, totpoly;
|
||||
bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0;
|
||||
|
||||
if (BKE_mesh_nurbs_displist_to_mdata(ob, dispbase, &allvert, &totvert, &alledge,
|
||||
&totedge, &allloop, &allpoly, NULL,
|
||||
&totedge, &allloop, &allpoly, (use_orco_uv) ? &alluv : NULL,
|
||||
&totloop, &totpoly) != 0)
|
||||
{
|
||||
/* Error initializing mdata. This often happens when curve is empty */
|
||||
@@ -1850,6 +1853,12 @@ DerivedMesh *CDDM_from_curve_displist(Object *ob, ListBase *dispbase)
|
||||
memcpy(cddm->mloop, allloop, totloop * sizeof(MLoop));
|
||||
memcpy(cddm->mpoly, allpoly, totpoly * sizeof(MPoly));
|
||||
|
||||
if (alluv) {
|
||||
const char *uvname = "Orco";
|
||||
CustomData_add_layer_named(&cddm->dm.polyData, CD_MTEXPOLY, CD_DEFAULT, NULL, totpoly, uvname);
|
||||
CustomData_add_layer_named(&cddm->dm.loopData, CD_MLOOPUV, CD_ASSIGN, alluv, totloop, uvname);
|
||||
}
|
||||
|
||||
MEM_freeN(allvert);
|
||||
MEM_freeN(alledge);
|
||||
MEM_freeN(allloop);
|
||||
|
||||
@@ -1636,7 +1636,10 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use
|
||||
|
||||
void BKE_mesh_from_nurbs(Object *ob)
|
||||
{
|
||||
BKE_mesh_from_nurbs_displist(ob, &ob->disp, false);
|
||||
Curve *cu = (Curve *) ob->data;
|
||||
bool use_orco_uv = (cu->flag & CU_UV_ORCO) != 0;
|
||||
|
||||
BKE_mesh_from_nurbs_displist(ob, &ob->disp, use_orco_uv);
|
||||
}
|
||||
|
||||
typedef struct EdgeLink {
|
||||
|
||||
@@ -189,6 +189,8 @@ Paint *BKE_paint_get_active_from_context(const bContext *C)
|
||||
return &ts->uvsculpt->paint;
|
||||
else
|
||||
return &ts->imapaint.paint;
|
||||
default:
|
||||
return &ts->imapaint.paint;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -238,6 +240,8 @@ PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
|
||||
return PAINT_SCULPT_UV;
|
||||
else
|
||||
return PAINT_TEXTURE_2D;
|
||||
default:
|
||||
return PAINT_TEXTURE_2D;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -4171,6 +4171,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
|
||||
|
||||
BKE_sequence_calc_disp(scene, seq);
|
||||
|
||||
if (seq_load->name[0] == '\0')
|
||||
BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name));
|
||||
|
||||
if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
|
||||
int start_frame_back = seq_load->start_frame;
|
||||
@@ -4182,9 +4184,6 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
|
||||
seq_load->channel--;
|
||||
}
|
||||
|
||||
if (seq_load->name[0] == '\0')
|
||||
BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name));
|
||||
|
||||
/* can be NULL */
|
||||
seq_load_apply(scene, seq, seq_load);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef struct GHash {
|
||||
|
||||
typedef struct GHashIterator {
|
||||
GHash *gh;
|
||||
int curBucket;
|
||||
unsigned int curBucket;
|
||||
struct Entry *curEntry;
|
||||
} GHashIterator;
|
||||
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic error "-Wsign-conversion"
|
||||
# pragma GCC diagnostic error "-Wsign-compare"
|
||||
# pragma GCC diagnostic error "-Wconversion"
|
||||
#endif
|
||||
|
||||
const unsigned int hashsizes[] = {
|
||||
@@ -152,7 +154,7 @@ bool BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFr
|
||||
|
||||
void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if (keyfreefp || valfreefp) {
|
||||
for (i = 0; i < gh->nbuckets; i++) {
|
||||
@@ -220,7 +222,7 @@ bool BLI_ghash_haskey(GHash *gh, const void *key)
|
||||
|
||||
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if (keyfreefp || valfreefp) {
|
||||
for (i = 0; i < gh->nbuckets; i++) {
|
||||
@@ -252,7 +254,7 @@ GHashIterator *BLI_ghashIterator_new(GHash *gh)
|
||||
GHashIterator *ghi = MEM_mallocN(sizeof(*ghi), "ghash iterator");
|
||||
ghi->gh = gh;
|
||||
ghi->curEntry = NULL;
|
||||
ghi->curBucket = -1;
|
||||
ghi->curBucket = (unsigned int)-1;
|
||||
while (!ghi->curEntry) {
|
||||
ghi->curBucket++;
|
||||
if (ghi->curBucket == ghi->gh->nbuckets)
|
||||
@@ -265,7 +267,7 @@ void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
|
||||
{
|
||||
ghi->gh = gh;
|
||||
ghi->curEntry = NULL;
|
||||
ghi->curBucket = -1;
|
||||
ghi->curBucket = (unsigned int)-1;
|
||||
while (!ghi->curEntry) {
|
||||
ghi->curBucket++;
|
||||
if (ghi->curBucket == ghi->gh->nbuckets)
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic error "-Wsign-conversion"
|
||||
# pragma GCC diagnostic error "-Wsign-compare"
|
||||
# pragma GCC diagnostic error "-Wconversion"
|
||||
#endif
|
||||
|
||||
/***/
|
||||
@@ -208,7 +210,7 @@ void *BLI_heap_popmin(Heap *heap)
|
||||
{
|
||||
void *ptr = heap->tree[0]->ptr;
|
||||
|
||||
BLI_assert(heap->size == 0);
|
||||
BLI_assert(heap->size != 0);
|
||||
|
||||
heap->tree[0]->ptr = heap->freenodes;
|
||||
heap->freenodes = heap->tree[0];
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic error "-Wsign-conversion"
|
||||
# pragma GCC diagnostic error "-Wsign-compare"
|
||||
# pragma GCC diagnostic error "-Wconversion"
|
||||
#endif
|
||||
|
||||
/* note: copied from BLO_blend_defs.h, don't use here because we're in BLI */
|
||||
@@ -102,8 +104,8 @@ BLI_mempool *BLI_mempool_create(int esize, int totelem, int pchunk, int flag)
|
||||
}
|
||||
|
||||
/* set the elem size */
|
||||
if (esize < MEMPOOL_ELEM_SIZE_MIN) {
|
||||
esize = MEMPOOL_ELEM_SIZE_MIN;
|
||||
if (esize < (int)MEMPOOL_ELEM_SIZE_MIN) {
|
||||
esize = (int)MEMPOOL_ELEM_SIZE_MIN;
|
||||
}
|
||||
|
||||
if (flag & BLI_MEMPOOL_ALLOW_ITER) {
|
||||
|
||||
@@ -562,10 +562,14 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
|
||||
RNA_string_get(&itemptr, "name", file_only);
|
||||
BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only);
|
||||
|
||||
/* Set seq_load.name, else all video/audio files get the same name! ugly! */
|
||||
BLI_strncpy(seq_load.name, file_only, sizeof(seq_load.name));
|
||||
|
||||
seq = seq_load_func(C, ed->seqbasep, &seq_load);
|
||||
if (seq) {
|
||||
if (overlap == FALSE) {
|
||||
if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
|
||||
if (BKE_sequence_test_overlap(ed->seqbasep, seq))
|
||||
BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1736,12 +1736,15 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
|
||||
}
|
||||
|
||||
/* convert flag to enum */
|
||||
switch (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
switch (t->flag & T_PROP_EDIT_ALL) {
|
||||
case T_PROP_EDIT:
|
||||
proportional = PROP_EDIT_ON;
|
||||
break;
|
||||
case (T_PROP_EDIT | T_PROP_CONNECTED):
|
||||
proportional = PROP_EDIT_CONNECTED;
|
||||
break;
|
||||
case T_PROP_EDIT:
|
||||
proportional = PROP_EDIT_ON;
|
||||
case (T_PROP_EDIT | T_PROP_PROJECTED):
|
||||
proportional = PROP_EDIT_PROJECTED;
|
||||
break;
|
||||
default:
|
||||
proportional = PROP_EDIT_OFF;
|
||||
@@ -2945,7 +2948,7 @@ static void headerResize(TransInfo *t, float vec[3], char *str)
|
||||
}
|
||||
}
|
||||
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & T_PROP_EDIT_ALL) {
|
||||
ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size);
|
||||
}
|
||||
}
|
||||
@@ -3143,7 +3146,7 @@ int Resize(TransInfo *t, const int mval[2])
|
||||
/* vertices in the radius of the brush end */
|
||||
/* outside the clipping area */
|
||||
/* XXX HACK - dg */
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & T_PROP_EDIT_ALL) {
|
||||
clipUVData(t);
|
||||
}
|
||||
}
|
||||
@@ -3663,7 +3666,7 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2]))
|
||||
RAD2DEGF(final), t->con.text, t->proptext);
|
||||
}
|
||||
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & T_PROP_EDIT_ALL) {
|
||||
ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size);
|
||||
}
|
||||
|
||||
@@ -3764,7 +3767,7 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
|
||||
RAD2DEGF(phi[0]), RAD2DEGF(phi[1]), t->proptext);
|
||||
}
|
||||
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & T_PROP_EDIT_ALL) {
|
||||
ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size);
|
||||
}
|
||||
|
||||
@@ -3912,7 +3915,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str)
|
||||
}
|
||||
}
|
||||
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & T_PROP_EDIT_ALL) {
|
||||
ofs += BLI_snprintf(str + ofs, MAX_INFO_LEN - ofs, IFACE_(" Proportional size: %.2f"), t->prop_size);
|
||||
}
|
||||
}
|
||||
@@ -4019,7 +4022,7 @@ int Translation(TransInfo *t, const int UNUSED(mval[2]))
|
||||
/* vertices in the radius of the brush end */
|
||||
/* outside the clipping area */
|
||||
/* XXX HACK - dg */
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & T_PROP_EDIT_ALL) {
|
||||
clipUVData(t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,6 +394,8 @@ typedef struct TransInfo {
|
||||
|
||||
#define T_PROP_EDIT (1 << 11)
|
||||
#define T_PROP_CONNECTED (1 << 12)
|
||||
#define T_PROP_PROJECTED (1 << 25)
|
||||
#define T_PROP_EDIT_ALL (T_PROP_EDIT | T_PROP_CONNECTED | T_PROP_PROJECTED)
|
||||
|
||||
#define T_V3D_ALIGN (1 << 14)
|
||||
/* for 2d views like uv or ipo */
|
||||
|
||||
@@ -201,6 +201,17 @@ static void set_prop_dist(TransInfo *t, const bool with_dist)
|
||||
TransData *tob;
|
||||
int a;
|
||||
|
||||
float _proj_vec[3];
|
||||
const float *proj_vec = NULL;
|
||||
|
||||
if (t->flag & T_PROP_PROJECTED) {
|
||||
if (t->spacetype == SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
|
||||
RegionView3D *rv3d = t->ar->regiondata;
|
||||
normalize_v3_v3(_proj_vec, rv3d->viewinv[2]);
|
||||
proj_vec = _proj_vec;
|
||||
}
|
||||
}
|
||||
|
||||
for (a = 0, tob = t->data; a < t->total; a++, tob++) {
|
||||
|
||||
tob->rdist = 0.0f; // init, it was mallocced
|
||||
@@ -216,6 +227,13 @@ static void set_prop_dist(TransInfo *t, const bool with_dist)
|
||||
if (td->flag & TD_SELECTED) {
|
||||
sub_v3_v3v3(vec, tob->center, td->center);
|
||||
mul_m3_v3(tob->mtx, vec);
|
||||
|
||||
if (proj_vec) {
|
||||
float vec_p[3];
|
||||
project_v3_v3v3(vec_p, vec, proj_vec);
|
||||
sub_v3_v3(vec, vec_p);
|
||||
}
|
||||
|
||||
dist = len_squared_v3(vec);
|
||||
if ((tob->rdist == -1.0f) || (dist < (tob->rdist * tob->rdist))) {
|
||||
tob->rdist = sqrtf(dist);
|
||||
@@ -989,7 +1007,7 @@ static void createTransPose(TransInfo *t, Object *ob)
|
||||
t->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */
|
||||
|
||||
/* disable PET, its not usable in pose mode yet [#32444] */
|
||||
t->flag &= ~(T_PROP_EDIT | T_PROP_CONNECTED);
|
||||
t->flag &= ~T_PROP_EDIT_ALL;
|
||||
|
||||
/* init trans data */
|
||||
td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransPoseBone");
|
||||
@@ -2013,14 +2031,14 @@ static void createTransEditVerts(TransInfo *t)
|
||||
float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL;
|
||||
float *dists = NULL;
|
||||
int count = 0, countsel = 0, a, totleft;
|
||||
int propmode = (t->flag & T_PROP_EDIT) ? (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) : 0;
|
||||
int propmode = (t->flag & T_PROP_EDIT) ? (t->flag & T_PROP_EDIT_ALL) : 0;
|
||||
int mirror = 0;
|
||||
char *selstate = NULL;
|
||||
short selectmode = ts->selectmode;
|
||||
int cd_vert_bweight_offset = -1;
|
||||
|
||||
if (t->flag & T_MIRROR) {
|
||||
EDBM_verts_mirror_cache_begin(em, 0, false, true);
|
||||
EDBM_verts_mirror_cache_begin(em, 0, false, (t->flag & T_PROP_EDIT) == 0);
|
||||
mirror = 1;
|
||||
}
|
||||
|
||||
@@ -5827,7 +5845,7 @@ static void createTransNodeData(bContext *UNUSED(C), TransInfo *t)
|
||||
}
|
||||
|
||||
/* nodes dont support PET and probably never will */
|
||||
t->flag &= ~(T_PROP_EDIT | T_PROP_CONNECTED);
|
||||
t->flag &= ~T_PROP_EDIT_ALL;
|
||||
|
||||
/* set transform flags on nodes */
|
||||
for (node = snode->edittree->nodes.first; node; node = node->next) {
|
||||
|
||||
@@ -1023,6 +1023,20 @@ void resetTransRestrictions(TransInfo *t)
|
||||
t->flag &= ~T_ALL_RESTRICTIONS;
|
||||
}
|
||||
|
||||
static int initTransInfo_edit_pet_to_flag(const int proportional)
|
||||
{
|
||||
switch (proportional) {
|
||||
case PROP_EDIT_ON:
|
||||
return T_PROP_EDIT;
|
||||
case PROP_EDIT_CONNECTED:
|
||||
return T_PROP_EDIT | T_PROP_CONNECTED;
|
||||
case PROP_EDIT_PROJECTED:
|
||||
return T_PROP_EDIT | T_PROP_PROJECTED;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* the *op can be NULL */
|
||||
int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
@@ -1245,24 +1259,14 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even
|
||||
/* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */
|
||||
if (op && (prop = RNA_struct_find_property(op->ptr, "proportional"))) {
|
||||
if (RNA_property_is_set(op->ptr, prop)) {
|
||||
switch (RNA_property_enum_get(op->ptr, prop)) {
|
||||
case PROP_EDIT_CONNECTED:
|
||||
t->flag |= T_PROP_CONNECTED;
|
||||
case PROP_EDIT_ON:
|
||||
t->flag |= T_PROP_EDIT;
|
||||
break;
|
||||
}
|
||||
t->flag |= initTransInfo_edit_pet_to_flag(RNA_property_enum_get(op->ptr, prop));
|
||||
}
|
||||
else {
|
||||
/* use settings from scene only if modal */
|
||||
if (t->flag & T_MODAL) {
|
||||
if ((t->options & CTX_NO_PET) == 0) {
|
||||
if (t->obedit && ts->proportional != PROP_EDIT_OFF) {
|
||||
t->flag |= T_PROP_EDIT;
|
||||
|
||||
if (ts->proportional == PROP_EDIT_CONNECTED) {
|
||||
t->flag |= T_PROP_CONNECTED;
|
||||
}
|
||||
if (t->obedit) {
|
||||
t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional);
|
||||
}
|
||||
else if (t->options & CTX_MASK) {
|
||||
if (ts->proportional_mask) {
|
||||
@@ -1310,9 +1314,11 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even
|
||||
}
|
||||
|
||||
// Mirror is not supported with PET, turn it off.
|
||||
#if 0
|
||||
if (t->flag & T_PROP_EDIT) {
|
||||
t->flag &= ~T_MIRROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
setTransformViewMatrices(t);
|
||||
initNumInput(&t->num);
|
||||
|
||||
@@ -1501,7 +1501,8 @@ typedef struct Scene {
|
||||
/* toolsettings->proportional */
|
||||
#define PROP_EDIT_OFF 0
|
||||
#define PROP_EDIT_ON 1
|
||||
#define PROP_EDIT_CONNECTED 2
|
||||
#define PROP_EDIT_CONNECTED 2
|
||||
#define PROP_EDIT_PROJECTED 3
|
||||
|
||||
/* toolsettings->weightuser */
|
||||
enum {
|
||||
|
||||
@@ -120,6 +120,8 @@ EnumPropertyItem proportional_falloff_curve_only_items[] = {
|
||||
EnumPropertyItem proportional_editing_items[] = {
|
||||
{PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"},
|
||||
{PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"},
|
||||
{PROP_EDIT_PROJECTED, "PROJECTED", ICON_PROP_ON, "Projected (2D)",
|
||||
"Proportional Editing using screen space locations"},
|
||||
{PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected",
|
||||
"Proportional Editing using connected geometry only"},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
|
||||
@@ -1416,6 +1416,10 @@ void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, int y)
|
||||
xs = (float)x + R.samples->centLut[b & 15] + 0.5f;
|
||||
ys = (float)y + R.samples->centLut[b >> 4] + 0.5f;
|
||||
}
|
||||
else if (R.i.curblur) {
|
||||
xs= (float)x + R.mblur_jit[R.i.curblur-1][0] + 0.5f;
|
||||
ys= (float)y + R.mblur_jit[R.i.curblur-1][1] + 0.5f;
|
||||
}
|
||||
else {
|
||||
xs = (float)x + 0.5f;
|
||||
ys = (float)y + 0.5f;
|
||||
|
||||
@@ -3824,6 +3824,10 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int
|
||||
xs= (float)x + R.samples->centLut[b & 15] + 0.5f;
|
||||
ys= (float)y + R.samples->centLut[b>>4] + 0.5f;
|
||||
}
|
||||
else if (R.i.curblur) {
|
||||
xs= (float)x + R.mblur_jit[R.i.curblur-1][0] + 0.5f;
|
||||
ys= (float)y + R.mblur_jit[R.i.curblur-1][1] + 0.5f;
|
||||
}
|
||||
else {
|
||||
xs= (float)x + 0.5f;
|
||||
ys= (float)y + 0.5f;
|
||||
|
||||
@@ -1261,7 +1261,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
||||
{
|
||||
KX_Scene* scene = scenes->at(scene_idx);
|
||||
if (IS_TAGGED(scene->GetBlenderScene())) {
|
||||
RemoveScene(scene); // XXX - not tested yet
|
||||
m_ketsjiEngine->RemoveScene(scene->GetName());
|
||||
scene_idx--;
|
||||
numScenes--;
|
||||
}
|
||||
|
||||
@@ -363,6 +363,8 @@ void GPC_RenderTools::RenderText3D( int fontid,
|
||||
double* mat,
|
||||
float aspect)
|
||||
{
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* needed for texture fonts otherwise they render as wireframe */
|
||||
|
||||
if (GLEW_ARB_multitexture) {
|
||||
for (int i=0; i<MAXTEX; i++) {
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||
|
||||
Reference in New Issue
Block a user