forked from bartvdbraak/blender
Merged changes in the trunk up to revision 46787.
Conflicts resolved: source/blender/blenkernel/intern/idcode.c source/blender/blenloader/intern/readfile.c source/blender/editors/include/ED_anim_api.h source/blender/editors/include/UI_resources.h source/blender/makesrna/intern/rna_main.c
This commit is contained in:
commit
a5152b7ca0
@ -291,8 +291,9 @@ if(APPLE)
|
||||
message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
|
||||
endif()
|
||||
else() # unix makefile generator does not fill XCODE_VERSION var, so we get it with a command
|
||||
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILDNR )
|
||||
STRING(SUBSTRING ${XCODE_VERS_BUILDNR} 6 3 XCODE_VERSION) # truncate away build-nr
|
||||
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILD_NR)
|
||||
string(SUBSTRING "${XCODE_VERS_BUILD_NR}" 6 3 XCODE_VERSION) # truncate away build-nr
|
||||
unset(XCODE_VERS_BUILD_NR)
|
||||
endif()
|
||||
|
||||
message(STATUS "Detected Xcode-version: " ${XCODE_VERSION})
|
||||
@ -370,10 +371,6 @@ if(MINGW)
|
||||
"because it is currently unsupported, remove this "
|
||||
"line if youre a developer who wants to add support.")
|
||||
endif()
|
||||
|
||||
if((WITH_MINGW64) AND (WITH_OPENCOLLADA))
|
||||
message(FATAL_ERROR "MINGW64 still doesn't support: WITH_OPENCOLLADA/WITH_CODEC_FFMPEG")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
|
||||
@ -841,6 +838,17 @@ elseif(WIN32)
|
||||
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
|
||||
set(GETTEXT_LIBRARIES gnu_gettext)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_CLOTH_ELTOPO)
|
||||
set(LAPACK ${LIBDIR}/lapack)
|
||||
# set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
|
||||
set_lib_path(LAPACK_LIBPATH ${LAPACK}/lib)
|
||||
set(LAPACK_LIBRARIES
|
||||
${LIBDIR}/lapack/lib/libf2c.lib
|
||||
${LIBDIR}/lapack/lib/clapack_nowrap.lib
|
||||
${LIBDIR}/lapack/lib/BLAS_nowrap.lib
|
||||
)
|
||||
endif()
|
||||
|
||||
set(PNG_LIBRARIES libpng)
|
||||
set(JPEG_LIBRARIES libjpeg)
|
||||
@ -1015,8 +1023,10 @@ elseif(WIN32)
|
||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
|
||||
|
||||
if(WITH_MINGW64)
|
||||
#Yes, the point for MinGW64 is moar optimization by default :)
|
||||
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -msse -msse2 -ftree-vectorize")
|
||||
#We need to take care though not to have these on debug builds because they may play funky with gdb
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -mmmx -ftree-vectorize")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
|
||||
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -lpthread")
|
||||
|
||||
@ -1081,7 +1091,11 @@ elseif(WIN32)
|
||||
${LIBDIR}/opencollada/include/GeneratedSaxParser/include
|
||||
)
|
||||
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
|
||||
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
|
||||
if(WITH_MINGW64)
|
||||
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa xml)
|
||||
else()
|
||||
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
|
||||
endif()
|
||||
set(PCRE_LIBRARIES pcre)
|
||||
endif()
|
||||
|
||||
|
@ -216,7 +216,7 @@ test_deprecated:
|
||||
|
||||
test_style:
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 python3.2 $(BLENDER_DIR)/source/tools/check_style_c.py $(BLENDER_DIR)/source/blender $(BLENDER_DIR)/source/creator
|
||||
PYTHONIOENCODING=utf_8 python3.2 $(BLENDER_DIR)/source/tools/check_style_c.py $(BLENDER_DIR)/source/blender $(BLENDER_DIR)/source/creator --no-length-check
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Project Files
|
||||
|
@ -214,7 +214,8 @@ macro(setup_liblinks
|
||||
${OPENGL_glu_LIBRARY}
|
||||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${FREETYPE_LIBRARY})
|
||||
${FREETYPE_LIBRARY}
|
||||
${LAPACK_LIBRARIES})
|
||||
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
||||
|
@ -1,5 +1,5 @@
|
||||
set(PROJECT_DESCRIPTION "Blender is a very fast and versatile 3D modeller/renderer.")
|
||||
set(PROJECT_COPYRIGHT "Copyright (C) 2001-2011 Blender Foundation")
|
||||
set(PROJECT_COPYRIGHT "Copyright (C) 2001-2012 Blender Foundation")
|
||||
set(PROJECT_CONTACT "foundation@blender.org")
|
||||
set(PROJECT_VENDOR "Blender Foundation")
|
||||
set(ORG_WEBSITE "www.blender.org")
|
||||
@ -31,7 +31,7 @@ set(BUILD_REV ${MY_WC_REVISION})
|
||||
|
||||
|
||||
# Force Package Name
|
||||
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${BLENDER_VERSION}-r${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
|
||||
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-1.r${BUILD_REV}-${CMAKE_SYSTEM_PROCESSOR})
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# RPM packages
|
||||
|
@ -1,5 +1,11 @@
|
||||
# -*- rpm-spec -*-
|
||||
%global __python %{__python3}
|
||||
%global blender_api @CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@
|
||||
|
||||
%define _rpmdir @CPACK_RPM_DIRECTORY@
|
||||
%define _rpmfilename @CPACK_RPM_FILE_NAME@
|
||||
%define _unpackaged_files_terminate_build 0
|
||||
%define _topdir @CPACK_RPM_DIRECTORY@
|
||||
|
||||
BuildRoot: @CPACK_RPM_DIRECTORY@/@CPACK_PACKAGE_FILE_NAME@@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH@
|
||||
Summary: @CPACK_RPM_PACKAGE_SUMMARY@
|
||||
@ -9,12 +15,17 @@ Release: @CPACK_RPM_PACKAGE_RELEASE@%{?dist}
|
||||
License: @CPACK_RPM_PACKAGE_LICENSE@
|
||||
Group: @CPACK_RPM_PACKAGE_GROUP@
|
||||
Vendor: @CPACK_RPM_PACKAGE_VENDOR@
|
||||
Epoch: 1
|
||||
Epoch: 1
|
||||
|
||||
%define _rpmdir @CPACK_RPM_DIRECTORY@
|
||||
%define _rpmfilename @CPACK_RPM_FILE_NAME@
|
||||
%define _unpackaged_files_terminate_build 0
|
||||
%define _topdir @CPACK_RPM_DIRECTORY@
|
||||
Requires(post): desktop-file-utils
|
||||
Requires(post): shared-mime-info
|
||||
Requires(postun): desktop-file-utils
|
||||
Requires(postun): shared-mime-info
|
||||
|
||||
Provides: blender(ABI) = %{blender_api}
|
||||
Provides: blender-fonts = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
Obsoletes: blender-fonts <= 2.49a-9
|
||||
|
||||
%description
|
||||
Blender is an integrated 3d suite for modelling, animation, rendering,
|
||||
@ -40,6 +51,10 @@ then
|
||||
fi
|
||||
mv "@CPACK_TOPLEVEL_DIRECTORY@/tmpBBroot" ${RPM_BUILD_ROOT}
|
||||
|
||||
rm -f ${RPM_BUILD_ROOT}%{_bindir}/blender-thumbnailer.py
|
||||
|
||||
%find_lang %{name}
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
@ -57,14 +72,15 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then
|
||||
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
|
||||
fi || :
|
||||
|
||||
%files
|
||||
%files -f blender.lang
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/%{name}
|
||||
%{_datadir}/%{name}/@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@
|
||||
%{_datadir}/%{name}/%{blender_api}/datafiles/fonts
|
||||
%{_datadir}/%{name}/%{blender_api}/scripts
|
||||
%{_datadir}/icons/hicolor/*/apps/%{name}.*
|
||||
%{_datadir}/applications/%{name}.desktop
|
||||
%{_datadir}/doc/blender
|
||||
%{_mandir}/man1/blender.*
|
||||
%{_datadir}/doc/%{name}
|
||||
%{_mandir}/man1/%{name}.*
|
||||
|
||||
%changelog
|
||||
@CPACK_RPM_SPEC_CHANGELOG@
|
||||
|
@ -165,7 +165,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_13', 'sm_20', 'sm_21']
|
||||
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21'] # don't build sm_13 until the compile can fit in 32bit process again :)
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
|
@ -167,9 +167,10 @@ BF_BOOST_LIBPATH = BF_BOOST + '/lib'
|
||||
|
||||
#Ray trace optimization
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2', '-ftree-vectorize']
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
#Produces errors while rendering with subsurf/multires,
|
||||
WITH_BF_OPENMP = False
|
||||
|
||||
##
|
||||
CC = 'gcc'
|
||||
@ -178,10 +179,10 @@ CXX = 'g++'
|
||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
CXXFLAGS = [ '-fpermissive' ]
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-D_SSIZE_T_']
|
||||
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-ftree-vectorize', '-mmmx', '-msse', '-msse2']
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-ftree-vectorize']
|
||||
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
|
||||
|
||||
|
@ -177,6 +177,7 @@ def validate_arguments(args, bc):
|
||||
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
|
||||
'C_WARN', 'CC_WARN', 'CXX_WARN',
|
||||
'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'MACOSX_SDK_CHECK', 'XCODE_CUR_VER',
|
||||
'BF_CYCLES_CUDA_BINARIES_ARCH',
|
||||
]
|
||||
|
||||
|
||||
|
42
extern/bullet2/patches/make_id.patch
vendored
Normal file
42
extern/bullet2/patches/make_id.patch
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
Index: src/LinearMath/btSerializer.h
|
||||
===================================================================
|
||||
--- src/LinearMath/btSerializer.h (revision 46625)
|
||||
+++ src/LinearMath/btSerializer.h (working copy)
|
||||
@@ -106,23 +106,23 @@
|
||||
|
||||
#define BT_HEADER_LENGTH 12
|
||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
|
||||
-# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||
+# define BT_MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||
#else
|
||||
-# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||
+# define BT_MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||
#endif
|
||||
|
||||
-#define BT_SOFTBODY_CODE MAKE_ID('S','B','D','Y')
|
||||
-#define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J')
|
||||
-#define BT_RIGIDBODY_CODE MAKE_ID('R','B','D','Y')
|
||||
-#define BT_CONSTRAINT_CODE MAKE_ID('C','O','N','S')
|
||||
-#define BT_BOXSHAPE_CODE MAKE_ID('B','O','X','S')
|
||||
-#define BT_QUANTIZED_BVH_CODE MAKE_ID('Q','B','V','H')
|
||||
-#define BT_TRIANLGE_INFO_MAP MAKE_ID('T','M','A','P')
|
||||
-#define BT_SHAPE_CODE MAKE_ID('S','H','A','P')
|
||||
-#define BT_ARRAY_CODE MAKE_ID('A','R','A','Y')
|
||||
-#define BT_SBMATERIAL_CODE MAKE_ID('S','B','M','T')
|
||||
-#define BT_SBNODE_CODE MAKE_ID('S','B','N','D')
|
||||
-#define BT_DNA_CODE MAKE_ID('D','N','A','1')
|
||||
+#define BT_SOFTBODY_CODE BT_MAKE_ID('S','B','D','Y')
|
||||
+#define BT_COLLISIONOBJECT_CODE BT_MAKE_ID('C','O','B','J')
|
||||
+#define BT_RIGIDBODY_CODE BT_MAKE_ID('R','B','D','Y')
|
||||
+#define BT_CONSTRAINT_CODE BT_MAKE_ID('C','O','N','S')
|
||||
+#define BT_BOXSHAPE_CODE BT_MAKE_ID('B','O','X','S')
|
||||
+#define BT_QUANTIZED_BVH_CODE BT_MAKE_ID('Q','B','V','H')
|
||||
+#define BT_TRIANLGE_INFO_MAP BT_MAKE_ID('T','M','A','P')
|
||||
+#define BT_SHAPE_CODE BT_MAKE_ID('S','H','A','P')
|
||||
+#define BT_ARRAY_CODE BT_MAKE_ID('A','R','A','Y')
|
||||
+#define BT_SBMATERIAL_CODE BT_MAKE_ID('S','B','M','T')
|
||||
+#define BT_SBNODE_CODE BT_MAKE_ID('S','B','N','D')
|
||||
+#define BT_DNA_CODE BT_MAKE_ID('D','N','A','1')
|
||||
|
||||
|
||||
struct btPointerUid
|
4
extern/bullet2/readme.txt
vendored
4
extern/bullet2/readme.txt
vendored
@ -15,3 +15,7 @@ Once that is done all build systems can be updated to use/build extern/bullet2 f
|
||||
Questions? mail blender at erwincoumans.com, or check the bf-blender mailing list.
|
||||
Thanks,
|
||||
Erwin
|
||||
|
||||
Apply patches/make_id.patch to prevent duplicated define of MAKE_ID macro in blender
|
||||
side and bullet side.
|
||||
Sergey
|
||||
|
28
extern/bullet2/src/LinearMath/btSerializer.h
vendored
28
extern/bullet2/src/LinearMath/btSerializer.h
vendored
@ -106,23 +106,23 @@ public:
|
||||
|
||||
#define BT_HEADER_LENGTH 12
|
||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
|
||||
# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||
# define BT_MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
|
||||
#else
|
||||
# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||
# define BT_MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
|
||||
#endif
|
||||
|
||||
#define BT_SOFTBODY_CODE MAKE_ID('S','B','D','Y')
|
||||
#define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J')
|
||||
#define BT_RIGIDBODY_CODE MAKE_ID('R','B','D','Y')
|
||||
#define BT_CONSTRAINT_CODE MAKE_ID('C','O','N','S')
|
||||
#define BT_BOXSHAPE_CODE MAKE_ID('B','O','X','S')
|
||||
#define BT_QUANTIZED_BVH_CODE MAKE_ID('Q','B','V','H')
|
||||
#define BT_TRIANLGE_INFO_MAP MAKE_ID('T','M','A','P')
|
||||
#define BT_SHAPE_CODE MAKE_ID('S','H','A','P')
|
||||
#define BT_ARRAY_CODE MAKE_ID('A','R','A','Y')
|
||||
#define BT_SBMATERIAL_CODE MAKE_ID('S','B','M','T')
|
||||
#define BT_SBNODE_CODE MAKE_ID('S','B','N','D')
|
||||
#define BT_DNA_CODE MAKE_ID('D','N','A','1')
|
||||
#define BT_SOFTBODY_CODE BT_MAKE_ID('S','B','D','Y')
|
||||
#define BT_COLLISIONOBJECT_CODE BT_MAKE_ID('C','O','B','J')
|
||||
#define BT_RIGIDBODY_CODE BT_MAKE_ID('R','B','D','Y')
|
||||
#define BT_CONSTRAINT_CODE BT_MAKE_ID('C','O','N','S')
|
||||
#define BT_BOXSHAPE_CODE BT_MAKE_ID('B','O','X','S')
|
||||
#define BT_QUANTIZED_BVH_CODE BT_MAKE_ID('Q','B','V','H')
|
||||
#define BT_TRIANLGE_INFO_MAP BT_MAKE_ID('T','M','A','P')
|
||||
#define BT_SHAPE_CODE BT_MAKE_ID('S','H','A','P')
|
||||
#define BT_ARRAY_CODE BT_MAKE_ID('A','R','A','Y')
|
||||
#define BT_SBMATERIAL_CODE BT_MAKE_ID('S','B','M','T')
|
||||
#define BT_SBNODE_CODE BT_MAKE_ID('S','B','N','D')
|
||||
#define BT_DNA_CODE BT_MAKE_ID('D','N','A','1')
|
||||
|
||||
|
||||
struct btPointerUid
|
||||
|
@ -193,6 +193,12 @@ if(WITH_CODEC_FFMPEG)
|
||||
ffmpeg/AUD_FFMPEGReader.h
|
||||
ffmpeg/AUD_FFMPEGWriter.h
|
||||
)
|
||||
|
||||
remove_strict_flags_file(
|
||||
ffmpeg/AUD_FFMPEGFactory.cpp
|
||||
ffmpeg/AUD_FFMPEGReader.cpp
|
||||
ffmpeg/AUD_FFMPEGWriter.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
|
@ -220,6 +220,7 @@ void BlenderSession::render()
|
||||
buffer_params.passes = passes;
|
||||
scene->film->passes = passes;
|
||||
scene->film->tag_update(scene);
|
||||
scene->integrator->tag_update(scene);
|
||||
|
||||
/* update scene */
|
||||
sync->sync_data(b_v3d, b_engine.camera_override(), b_iter->name().c_str());
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
int num;
|
||||
bool display_device;
|
||||
bool advanced_shading;
|
||||
bool pack_images;
|
||||
vector<DeviceInfo> multi_devices;
|
||||
|
||||
DeviceInfo()
|
||||
@ -62,6 +63,7 @@ public:
|
||||
num = 0;
|
||||
display_device = false;
|
||||
advanced_shading = true;
|
||||
pack_images = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -260,6 +260,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
|
||||
info.id = "CPU";
|
||||
info.num = 0;
|
||||
info.advanced_shading = true;
|
||||
info.pack_images = false;
|
||||
|
||||
devices.insert(devices.begin(), info);
|
||||
}
|
||||
|
@ -877,6 +877,7 @@ void device_cuda_info(vector<DeviceInfo>& devices)
|
||||
int major, minor;
|
||||
cuDeviceComputeCapability(&major, &minor, num);
|
||||
info.advanced_shading = (major >= 2);
|
||||
info.pack_images = false;
|
||||
|
||||
/* if device has a kernel timeout, assume it is used for display */
|
||||
if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1) {
|
||||
|
@ -304,6 +304,7 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
|
||||
int num_added = 0, num_display = 0;
|
||||
|
||||
info.advanced_shading = with_advanced_shading;
|
||||
info.pack_images = false;
|
||||
|
||||
foreach(DeviceInfo& subinfo, devices) {
|
||||
if(subinfo.type == type) {
|
||||
@ -326,6 +327,7 @@ static bool device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool
|
||||
info.multi_devices.push_back(subinfo);
|
||||
if(subinfo.display_device)
|
||||
info.display_device = true;
|
||||
info.pack_images = info.pack_images || subinfo.pack_images;
|
||||
num_added++;
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ public:
|
||||
{
|
||||
char version[256];
|
||||
|
||||
int major, minor, req_major = 1, req_minor = 1;
|
||||
int major, minor, req_major = 1, req_minor = 0;
|
||||
|
||||
clGetPlatformInfo(cpPlatform, CL_PLATFORM_VERSION, sizeof(version), &version, NULL);
|
||||
|
||||
@ -300,15 +300,15 @@ public:
|
||||
|
||||
/* Multi Closure for nVidia cards */
|
||||
if(platform_name == "NVIDIA CUDA")
|
||||
build_options += "-D__KERNEL_SHADING__ -D__MULTI_CLOSURE__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
|
||||
build_options += "-D__KERNEL_SHADING__ -D__KERNEL_OPENCL_NVIDIA__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
|
||||
|
||||
/* No Float3 for Apple */
|
||||
else if(platform_name == "Apple")
|
||||
build_options += "-D__CL_NO_FLOAT3__ ";
|
||||
build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_APPLE__ ";
|
||||
|
||||
/* Basic shading for AMD cards (non Apple) */
|
||||
else if(platform_name == "AMD Accelerated Parallel Processing")
|
||||
build_options += "-D__KERNEL_SHADING__ -D__CL_NO_FLOAT3__ ";
|
||||
build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_AMD__ ";
|
||||
|
||||
return build_options;
|
||||
}
|
||||
@ -743,6 +743,7 @@ void device_opencl_info(vector<DeviceInfo>& devices)
|
||||
/* we don't know if it's used for display, but assume it is */
|
||||
info.display_device = true;
|
||||
info.advanced_shading = false;
|
||||
info.pack_images = true;
|
||||
|
||||
devices.push_back(info);
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ typedef texture<float> texture_float;
|
||||
typedef texture<uint> texture_uint;
|
||||
typedef texture<int> texture_int;
|
||||
typedef texture<uint4> texture_uint4;
|
||||
typedef texture<uchar4> texture_uchar4;
|
||||
typedef texture_image<float4> texture_image_float4;
|
||||
typedef texture_image<uchar4> texture_image_uchar4;
|
||||
|
||||
|
@ -50,6 +50,7 @@ typedef texture<float, 1> texture_float;
|
||||
typedef texture<uint, 1> texture_uint;
|
||||
typedef texture<int, 1> texture_int;
|
||||
typedef texture<uint4, 1> texture_uint4;
|
||||
typedef texture<uchar4, 1> texture_uchar4;
|
||||
typedef texture<float4, 2> texture_image_float4;
|
||||
typedef texture<uchar4, 2, cudaReadModeNormalizedFloat> texture_image_uchar4;
|
||||
|
||||
|
@ -59,6 +59,7 @@ __device float3 area_light_sample(float3 axisu, float3 axisv, float randu, float
|
||||
return axisu*randu + axisv*randv;
|
||||
}
|
||||
|
||||
#ifdef __BACKGROUND_MIS__
|
||||
__device float3 background_light_sample(KernelGlobals *kg, float randu, float randv, float *pdf)
|
||||
{
|
||||
/* for the following, the CDF values are actually a pair of floats, with the
|
||||
@ -165,6 +166,7 @@ __device float background_light_pdf(KernelGlobals *kg, float3 direction)
|
||||
|
||||
return pdf * kernel_data.integrator.pdf_lights;
|
||||
}
|
||||
#endif
|
||||
|
||||
__device void regular_light_sample(KernelGlobals *kg, int point,
|
||||
float randu, float randv, float3 P, LightSample *ls, float *pdf)
|
||||
|
@ -7,7 +7,6 @@
|
||||
#define KERNEL_IMAGE_TEX(type, ttype, name)
|
||||
#endif
|
||||
|
||||
|
||||
/* bvh */
|
||||
KERNEL_TEX(float4, texture_float4, __bvh_nodes)
|
||||
KERNEL_TEX(float4, texture_float4, __tri_woop)
|
||||
@ -151,6 +150,10 @@ KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_097)
|
||||
KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_098)
|
||||
KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float_099)
|
||||
|
||||
/* packed image (opencl) */
|
||||
KERNEL_TEX(uchar4, texture_uchar4, __tex_image_packed)
|
||||
KERNEL_TEX(uint4, texture_uint4, __tex_image_packed_info)
|
||||
|
||||
#undef KERNEL_TEX
|
||||
#undef KERNEL_IMAGE_TEX
|
||||
|
||||
|
@ -49,8 +49,30 @@ CCL_NAMESPACE_BEGIN
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL_OPENCL__
|
||||
//#define __KERNEL_SHADING__
|
||||
//#define __KERNEL_ADV_SHADING__
|
||||
|
||||
#ifdef __KERNEL_OPENCL_NVIDIA__
|
||||
#define __KERNEL_SHADING__
|
||||
#define __MULTI_CLOSURE__
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL_OPENCL_APPLE__
|
||||
//#define __SVM__
|
||||
//#define __EMISSION__
|
||||
//#define __IMAGE_TEXTURES__
|
||||
//#define __HOLDOUT__
|
||||
//#define __PROCEDURAL_TEXTURES__
|
||||
//#define __EXTRA_NODES__
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL_OPENCL_AMD__
|
||||
#define __SVM__
|
||||
#define __EMISSION__
|
||||
#define __IMAGE_TEXTURES__
|
||||
#define __HOLDOUT__
|
||||
#define __PROCEDURAL_TEXTURES__
|
||||
#define __EXTRA_NODES__
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* kernel features */
|
||||
@ -69,7 +91,9 @@ CCL_NAMESPACE_BEGIN
|
||||
#ifdef __KERNEL_SHADING__
|
||||
#define __SVM__
|
||||
#define __EMISSION__
|
||||
#define __TEXTURES__
|
||||
#define __PROCEDURAL_TEXTURES__
|
||||
#define __IMAGE_TEXTURES__
|
||||
#define __EXTRA_NODES__
|
||||
#define __HOLDOUT__
|
||||
#endif
|
||||
|
||||
@ -85,7 +109,6 @@ CCL_NAMESPACE_BEGIN
|
||||
//#define __MULTI_LIGHT__
|
||||
//#define __OSL__
|
||||
//#define __SOBOL_FULL_SCREEN__
|
||||
//#define __MODIFY_TP__
|
||||
//#define __QBVH__
|
||||
|
||||
/* Shader Evaluation */
|
||||
|
@ -26,7 +26,7 @@ shader node_camera(
|
||||
ViewVector = (vector)transform("world", "camera", P);
|
||||
|
||||
ViewZDepth = fabs(ViewVector[2]);
|
||||
ViewDistance = lenght(ViewVector);
|
||||
ViewDistance = length(ViewVector);
|
||||
|
||||
ViewVector = normalize(ViewVector);
|
||||
}
|
||||
|
@ -216,13 +216,15 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_JUMP:
|
||||
offset = node.y;
|
||||
break;
|
||||
#ifdef __TEXTURES__
|
||||
#ifdef __IMAGE_TEXTURES__
|
||||
case NODE_TEX_IMAGE:
|
||||
svm_node_tex_image(kg, sd, stack, node);
|
||||
break;
|
||||
case NODE_TEX_ENVIRONMENT:
|
||||
svm_node_tex_environment(kg, sd, stack, node);
|
||||
break;
|
||||
#endif
|
||||
#ifdef __PROCEDURAL_TEXTURES__
|
||||
case NODE_TEX_SKY:
|
||||
svm_node_tex_sky(kg, sd, stack, node.y, node.z);
|
||||
break;
|
||||
@ -254,6 +256,7 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_GEOMETRY:
|
||||
svm_node_geometry(sd, stack, node.y, node.z);
|
||||
break;
|
||||
#ifdef __EXTRA_NODES__
|
||||
case NODE_GEOMETRY_BUMP_DX:
|
||||
svm_node_geometry_bump_dx(sd, stack, node.y, node.z);
|
||||
break;
|
||||
@ -263,6 +266,7 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_LIGHT_PATH:
|
||||
svm_node_light_path(sd, stack, node.y, node.z, path_flag);
|
||||
break;
|
||||
#endif
|
||||
case NODE_CONVERT:
|
||||
svm_node_convert(sd, stack, node.y, node.z, node.w);
|
||||
break;
|
||||
@ -272,6 +276,7 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_VALUE_V:
|
||||
svm_node_value_v(kg, sd, stack, node.y, &offset);
|
||||
break;
|
||||
#ifdef __EXTRA_NODES__
|
||||
case NODE_INVERT:
|
||||
svm_node_invert(sd, stack, node.y, node.z, node.w);
|
||||
break;
|
||||
@ -293,21 +298,25 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_HSV:
|
||||
svm_node_hsv(kg, sd, stack, node.y, node.z, node.w, &offset);
|
||||
break;
|
||||
#endif
|
||||
case NODE_ATTR:
|
||||
svm_node_attr(kg, sd, stack, node);
|
||||
break;
|
||||
#ifdef __EXTRA_NODES__
|
||||
case NODE_ATTR_BUMP_DX:
|
||||
svm_node_attr_bump_dx(kg, sd, stack, node);
|
||||
break;
|
||||
case NODE_ATTR_BUMP_DY:
|
||||
svm_node_attr_bump_dy(kg, sd, stack, node);
|
||||
break;
|
||||
#endif
|
||||
case NODE_FRESNEL:
|
||||
svm_node_fresnel(sd, stack, node.y, node.z, node.w);
|
||||
break;
|
||||
case NODE_LAYER_WEIGHT:
|
||||
svm_node_layer_weight(sd, stack, node);
|
||||
break;
|
||||
#ifdef __EXTRA_NODES__
|
||||
case NODE_SET_DISPLACEMENT:
|
||||
svm_node_set_displacement(sd, stack, node.y);
|
||||
break;
|
||||
@ -323,6 +332,7 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_NORMAL:
|
||||
svm_node_normal(kg, sd, stack, node.y, node.z, node.w, &offset);
|
||||
break;
|
||||
#endif
|
||||
case NODE_MAPPING:
|
||||
svm_node_mapping(kg, sd, stack, node.y, node.z, &offset);
|
||||
break;
|
||||
@ -332,15 +342,18 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_TEX_COORD:
|
||||
svm_node_tex_coord(kg, sd, stack, node.y, node.z);
|
||||
break;
|
||||
#ifdef __EXTRA_NODES__
|
||||
case NODE_TEX_COORD_BUMP_DX:
|
||||
svm_node_tex_coord_bump_dx(kg, sd, stack, node.y, node.z);
|
||||
break;
|
||||
case NODE_TEX_COORD_BUMP_DY:
|
||||
svm_node_tex_coord_bump_dy(kg, sd, stack, node.y, node.z);
|
||||
break;
|
||||
#endif
|
||||
case NODE_EMISSION_SET_WEIGHT_TOTAL:
|
||||
svm_node_emission_set_weight_total(kg, sd, node.y, node.z, node.w);
|
||||
break;
|
||||
#ifdef __EXTRA_NODES__
|
||||
case NODE_RGB_RAMP:
|
||||
svm_node_rgb_ramp(kg, sd, stack, node, &offset);
|
||||
break;
|
||||
@ -350,6 +363,7 @@ __device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ShaderT
|
||||
case NODE_LIGHT_FALLOFF:
|
||||
svm_node_light_falloff(sd, stack, node);
|
||||
break;
|
||||
#endif
|
||||
case NODE_END:
|
||||
default:
|
||||
#ifndef __MULTI_CLOSURE__
|
||||
|
@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
__device void svm_node_attr_init(KernelGlobals *kg, ShaderData *sd,
|
||||
uint4 node, NodeAttributeType *type,
|
||||
NodeAttributeType *mesh_type, AttributeElement *elem, uint *offset, uint *out_offset)
|
||||
NodeAttributeType *mesh_type, AttributeElement *elem, int *offset, uint *out_offset)
|
||||
{
|
||||
if(sd->object != ~0) {
|
||||
/* find attribute by unique id */
|
||||
@ -35,7 +35,7 @@ __device void svm_node_attr_init(KernelGlobals *kg, ShaderData *sd,
|
||||
|
||||
/* return result */
|
||||
*elem = (AttributeElement)attr_map.y;
|
||||
*offset = attr_map.z;
|
||||
*offset = as_int(attr_map.z);
|
||||
*mesh_type = (NodeAttributeType)attr_map.w;
|
||||
}
|
||||
else {
|
||||
@ -53,7 +53,8 @@ __device void svm_node_attr(KernelGlobals *kg, ShaderData *sd, float *stack, uin
|
||||
{
|
||||
NodeAttributeType type, mesh_type;
|
||||
AttributeElement elem;
|
||||
uint offset, out_offset;
|
||||
uint out_offset;
|
||||
int offset;
|
||||
|
||||
svm_node_attr_init(kg, sd, node, &type, &mesh_type, &elem, &offset, &out_offset);
|
||||
|
||||
@ -84,7 +85,8 @@ __device void svm_node_attr_bump_dx(KernelGlobals *kg, ShaderData *sd, float *st
|
||||
{
|
||||
NodeAttributeType type, mesh_type;
|
||||
AttributeElement elem;
|
||||
uint offset, out_offset;
|
||||
uint out_offset;
|
||||
int offset;
|
||||
|
||||
svm_node_attr_init(kg, sd, node, &type, &mesh_type, &elem, &offset, &out_offset);
|
||||
|
||||
@ -119,7 +121,8 @@ __device void svm_node_attr_bump_dy(KernelGlobals *kg, ShaderData *sd, float *st
|
||||
{
|
||||
NodeAttributeType type, mesh_type;
|
||||
AttributeElement elem;
|
||||
uint offset, out_offset;
|
||||
uint out_offset;
|
||||
int offset;
|
||||
|
||||
svm_node_attr_init(kg, sd, node, &type, &mesh_type, &elem, &offset, &out_offset);
|
||||
|
||||
|
@ -18,6 +18,75 @@
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
#ifdef __KERNEL_OPENCL__
|
||||
|
||||
/* For OpenCL all images are packed in a single array, and we do manual lookup
|
||||
* and interpolation. */
|
||||
|
||||
__device_inline float4 svm_image_texture_read(KernelGlobals *kg, int offset)
|
||||
{
|
||||
uchar4 r = kernel_tex_fetch(__tex_image_packed, offset);
|
||||
float f = 1.0f/255.0f;
|
||||
return make_float4(r.x*f, r.y*f, r.z*f, r.w*f);
|
||||
}
|
||||
|
||||
__device_inline int svm_image_texture_wrap_periodic(int x, int width)
|
||||
{
|
||||
x %= width;
|
||||
if(x < 0)
|
||||
x += width;
|
||||
return x;
|
||||
}
|
||||
|
||||
__device_inline int svm_image_texture_wrap_clamp(int x, int width)
|
||||
{
|
||||
return clamp(x, 0, width-1);
|
||||
}
|
||||
|
||||
__device_inline float svm_image_texture_frac(float x, int *ix)
|
||||
{
|
||||
int i = (int)x - ((x < 0.0f)? 1: 0);
|
||||
*ix = i;
|
||||
return x - (float)i;
|
||||
}
|
||||
|
||||
__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y)
|
||||
{
|
||||
uint4 info = kernel_tex_fetch(__tex_image_packed_info, id);
|
||||
uint width = info.x;
|
||||
uint height = info.y;
|
||||
uint offset = info.z;
|
||||
uint periodic = info.w;
|
||||
|
||||
int ix, iy, nix, niy;
|
||||
float tx = svm_image_texture_frac(x*width, &ix);
|
||||
float ty = svm_image_texture_frac(y*height, &iy);
|
||||
|
||||
if(periodic) {
|
||||
ix = svm_image_texture_wrap_periodic(ix, width);
|
||||
iy = svm_image_texture_wrap_periodic(iy, height);
|
||||
|
||||
nix = svm_image_texture_wrap_periodic(ix+1, width);
|
||||
niy = svm_image_texture_wrap_periodic(iy+1, height);
|
||||
}
|
||||
else {
|
||||
ix = svm_image_texture_wrap_clamp(ix, width);
|
||||
iy = svm_image_texture_wrap_clamp(iy, height);
|
||||
|
||||
nix = svm_image_texture_wrap_clamp(ix+1, width);
|
||||
niy = svm_image_texture_wrap_clamp(iy+1, height);
|
||||
}
|
||||
|
||||
float4 r = (1.0f - ty)*(1.0f - tx)*svm_image_texture_read(kg, offset + ix + iy*width);
|
||||
r += (1.0f - ty)*tx*svm_image_texture_read(kg, offset + nix + iy*width);
|
||||
r += ty*(1.0f - tx)*svm_image_texture_read(kg, offset + ix + niy*width);
|
||||
r += ty*tx*svm_image_texture_read(kg, offset + nix + niy*width);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y)
|
||||
{
|
||||
float4 r;
|
||||
@ -31,9 +100,6 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y)
|
||||
also note that cuda has 128 textures limit, we use 100 now, since
|
||||
we still need some for other storage */
|
||||
|
||||
#ifdef __KERNEL_OPENCL__
|
||||
r = make_float4(0.0f, 0.0f, 0.0f, 0.0f); /* todo */
|
||||
#else
|
||||
switch(id) {
|
||||
case 0: r = kernel_tex_image_interp(__tex_image_000, x, y); break;
|
||||
case 1: r = kernel_tex_image_interp(__tex_image_001, x, y); break;
|
||||
@ -139,11 +205,12 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y)
|
||||
kernel_assert(0);
|
||||
return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
__device void svm_node_tex_image(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node)
|
||||
{
|
||||
uint id = node.y;
|
||||
|
@ -87,7 +87,7 @@ __device void svm_node_tex_coord(KernelGlobals *kg, ShaderData *sd, float *stack
|
||||
}
|
||||
case NODE_TEXCO_REFLECTION: {
|
||||
if(sd->object != ~0)
|
||||
data = sd->I - 2.0f*dot(sd->N, sd->I)*sd->N;
|
||||
data = 2.0f*dot(sd->N, sd->I)*sd->N - sd->I;
|
||||
else
|
||||
data = sd->I;
|
||||
break;
|
||||
@ -136,7 +136,7 @@ __device void svm_node_tex_coord_bump_dx(KernelGlobals *kg, ShaderData *sd, floa
|
||||
}
|
||||
case NODE_TEXCO_REFLECTION: {
|
||||
if(sd->object != ~0)
|
||||
data = sd->I - 2.0f*dot(sd->N, sd->I)*sd->N;
|
||||
data = 2.0f*dot(sd->N, sd->I)*sd->N - sd->I;
|
||||
else
|
||||
data = sd->I;
|
||||
break;
|
||||
@ -188,7 +188,7 @@ __device void svm_node_tex_coord_bump_dy(KernelGlobals *kg, ShaderData *sd, floa
|
||||
}
|
||||
case NODE_TEXCO_REFLECTION: {
|
||||
if(sd->object != ~0)
|
||||
data = sd->I - 2.0f*dot(sd->N, sd->I)*sd->N;
|
||||
data = 2.0f*dot(sd->N, sd->I)*sd->N - sd->I;
|
||||
else
|
||||
data = sd->I;
|
||||
break;
|
||||
|
@ -298,7 +298,6 @@ bool Film::modified(const Film& film)
|
||||
|
||||
void Film::tag_update(Scene *scene)
|
||||
{
|
||||
scene->integrator->tag_update(scene);
|
||||
need_update = true;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ CCL_NAMESPACE_BEGIN
|
||||
ImageManager::ImageManager()
|
||||
{
|
||||
need_update = true;
|
||||
pack_images = false;
|
||||
osl_texture_system = NULL;
|
||||
}
|
||||
|
||||
@ -45,6 +46,11 @@ ImageManager::~ImageManager()
|
||||
assert(!float_images[slot]);
|
||||
}
|
||||
|
||||
void ImageManager::set_pack_images(bool pack_images_)
|
||||
{
|
||||
pack_images = pack_images_;
|
||||
}
|
||||
|
||||
void ImageManager::set_osl_texture_system(void *texture_system)
|
||||
{
|
||||
osl_texture_system = texture_system;
|
||||
@ -84,7 +90,7 @@ int ImageManager::add_image(const string& filename, bool& is_float)
|
||||
size_t slot;
|
||||
|
||||
/* load image info and find out if we need a float texture */
|
||||
is_float = is_float_image(filename);
|
||||
is_float = (pack_images)? false: is_float_image(filename);
|
||||
|
||||
if(is_float) {
|
||||
/* find existing image */
|
||||
@ -361,7 +367,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
|
||||
if(slot >= 10) name = string_printf("__tex_image_float_0%d", slot);
|
||||
else name = string_printf("__tex_image_float_00%d", slot);
|
||||
|
||||
device->tex_alloc(name.c_str(), tex_img, true, true);
|
||||
if(!pack_images)
|
||||
device->tex_alloc(name.c_str(), tex_img, true, true);
|
||||
}
|
||||
else {
|
||||
string filename = path_filename(images[slot]->filename);
|
||||
@ -387,7 +394,8 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
|
||||
if(slot >= 10) name = string_printf("__tex_image_0%d", slot);
|
||||
else name = string_printf("__tex_image_00%d", slot);
|
||||
|
||||
device->tex_alloc(name.c_str(), tex_img, true, true);
|
||||
if(!pack_images)
|
||||
device->tex_alloc(name.c_str(), tex_img, true, true);
|
||||
}
|
||||
|
||||
img->need_load = false;
|
||||
@ -466,9 +474,49 @@ void ImageManager::device_update(Device *device, DeviceScene *dscene, Progress&
|
||||
|
||||
pool.wait_work();
|
||||
|
||||
if(pack_images)
|
||||
device_pack_images(device, dscene, progress);
|
||||
|
||||
need_update = false;
|
||||
}
|
||||
|
||||
void ImageManager::device_pack_images(Device *device, DeviceScene *dscene, Progress& progess)
|
||||
{
|
||||
/* for OpenCL, we pack all image textures inside a single big texture, and
|
||||
will do our own interpolation in the kernel */
|
||||
size_t size = 0;
|
||||
|
||||
for(size_t slot = 0; slot < images.size(); slot++) {
|
||||
if(!images[slot])
|
||||
continue;
|
||||
|
||||
device_vector<uchar4>& tex_img = dscene->tex_image[slot];
|
||||
size += tex_img.size();
|
||||
}
|
||||
|
||||
uint4 *info = dscene->tex_image_packed_info.resize(images.size());
|
||||
uchar4 *pixels = dscene->tex_image_packed.resize(size);
|
||||
|
||||
size_t offset = 0;
|
||||
|
||||
for(size_t slot = 0; slot < images.size(); slot++) {
|
||||
if(!images[slot])
|
||||
continue;
|
||||
|
||||
device_vector<uchar4>& tex_img = dscene->tex_image[slot];
|
||||
|
||||
info[slot] = make_uint4(tex_img.data_width, tex_img.data_height, offset, 1);
|
||||
|
||||
memcpy(pixels+offset, (void*)tex_img.data_pointer, tex_img.memory_size());
|
||||
offset += tex_img.size();
|
||||
}
|
||||
|
||||
if(dscene->tex_image_packed.size())
|
||||
device->tex_alloc("__tex_image_packed", dscene->tex_image_packed);
|
||||
if(dscene->tex_image_packed_info.size())
|
||||
device->tex_alloc("__tex_image_packed_info", dscene->tex_image_packed_info);
|
||||
}
|
||||
|
||||
void ImageManager::device_free(Device *device, DeviceScene *dscene)
|
||||
{
|
||||
for(size_t slot = 0; slot < images.size(); slot++)
|
||||
@ -476,6 +524,12 @@ void ImageManager::device_free(Device *device, DeviceScene *dscene)
|
||||
for(size_t slot = 0; slot < float_images.size(); slot++)
|
||||
device_free_image(device, dscene, slot + TEX_IMAGE_FLOAT_START);
|
||||
|
||||
device->tex_free(dscene->tex_image_packed);
|
||||
dscene->tex_image_packed.clear();
|
||||
|
||||
device->tex_free(dscene->tex_image_packed_info);
|
||||
dscene->tex_image_packed_info.clear();
|
||||
|
||||
images.clear();
|
||||
float_images.clear();
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
void device_free(Device *device, DeviceScene *dscene);
|
||||
|
||||
void set_osl_texture_system(void *texture_system);
|
||||
void set_pack_images(bool pack_images_);
|
||||
|
||||
bool need_update;
|
||||
|
||||
@ -61,12 +62,15 @@ private:
|
||||
vector<Image*> images;
|
||||
vector<Image*> float_images;
|
||||
void *osl_texture_system;
|
||||
bool pack_images;
|
||||
|
||||
bool file_load_image(Image *img, device_vector<uchar4>& tex_img);
|
||||
bool file_load_float_image(Image *img, device_vector<float4>& tex_img);
|
||||
|
||||
void device_load_image(Device *device, DeviceScene *dscene, int slot, Progress *progess);
|
||||
void device_free_image(Device *device, DeviceScene *dscene, int slot);
|
||||
|
||||
void device_pack_images(Device *device, DeviceScene *dscene, Progress& progess);
|
||||
};
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@ -421,7 +421,7 @@ void MeshManager::update_svm_attributes(Device *device, DeviceScene *dscene, Sce
|
||||
|
||||
attr_map[index].x = id;
|
||||
attr_map[index].y = req.element;
|
||||
attr_map[index].z = req.offset;
|
||||
attr_map[index].z = as_uint(req.offset);
|
||||
|
||||
if(req.type == TypeDesc::TypeFloat)
|
||||
attr_map[index].w = NODE_ATTR_FLOAT;
|
||||
|
@ -111,6 +111,8 @@ void Scene::device_update(Device *device_, Progress& progress)
|
||||
* - Displacement shader must have all shader data available.
|
||||
* - Light manager needs final mesh data to compute emission CDF.
|
||||
*/
|
||||
|
||||
image_manager->set_pack_images(device->info.pack_images);
|
||||
|
||||
progress.set_status("Updating Background");
|
||||
background->device_update(device, &dscene, this);
|
||||
|
@ -97,6 +97,10 @@ public:
|
||||
device_vector<uchar4> tex_image[TEX_NUM_IMAGES];
|
||||
device_vector<float4> tex_float_image[TEX_NUM_FLOAT_IMAGES];
|
||||
|
||||
/* opencl images */
|
||||
device_vector<uchar4> tex_image_packed;
|
||||
device_vector<uint4> tex_image_packed_info;
|
||||
|
||||
KernelData data;
|
||||
};
|
||||
|
||||
|
@ -965,6 +965,20 @@ __device_inline void print_int4(const char *label, const int4& a)
|
||||
|
||||
#ifndef __KERNEL_OPENCL__
|
||||
|
||||
__device_inline unsigned int as_int(uint i)
|
||||
{
|
||||
union { unsigned int ui; int i; } u;
|
||||
u.ui = i;
|
||||
return u.i;
|
||||
}
|
||||
|
||||
__device_inline unsigned int as_uint(int i)
|
||||
{
|
||||
union { unsigned int ui; int i; } u;
|
||||
u.i = i;
|
||||
return u.ui;
|
||||
}
|
||||
|
||||
__device_inline unsigned int as_uint(float f)
|
||||
{
|
||||
union { unsigned int i; float f; } u;
|
||||
|
@ -86,6 +86,7 @@ set(SRC
|
||||
intern/solver_interface.h
|
||||
intern/solver_relax.h
|
||||
intern/utilities.h
|
||||
intern/globals.h
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
|
10
intern/elbeem/intern/globals.h
Normal file
10
intern/elbeem/intern/globals.h
Normal file
@ -0,0 +1,10 @@
|
||||
/** \file elbeem/intern/globals.h
|
||||
* \ingroup elbeem
|
||||
*/
|
||||
|
||||
// required globals
|
||||
|
||||
extern bool glob_mpactive;
|
||||
|
||||
extern int glob_mpnum;
|
||||
extern int glob_mpindex;
|
@ -18,6 +18,7 @@
|
||||
#include "ntl_blenderdumper.h"
|
||||
#include "ntl_world.h"
|
||||
#include "solver_interface.h"
|
||||
#include "globals.h"
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
@ -46,10 +47,6 @@ ntlBlenderDumper::~ntlBlenderDumper()
|
||||
debMsgStd("ntlBlenderDumper",DM_NOTIFY, "ntlBlenderDumper done", 10);
|
||||
}
|
||||
|
||||
// required globals
|
||||
extern bool glob_mpactive;
|
||||
extern int glob_mpnum, glob_mpindex;
|
||||
|
||||
/******************************************************************************
|
||||
* Only dump time dep. objects to file
|
||||
*****************************************************************************/
|
||||
|
@ -125,7 +125,7 @@ void ntlGeometryObject::initialize(ntlRenderGlobals *glob)
|
||||
}
|
||||
|
||||
if(!gotit) {
|
||||
errFatal("ntlGeometryObject::initialize","Obj '"<<mName<<"', Unkown 'geoinittype' value: '"<< ginitStr <<"' ", SIMWORLD_INITERROR);
|
||||
errFatal("ntlGeometryObject::initialize","Obj '"<<mName<<"', Unknown 'geoinittype' value: '"<< ginitStr <<"' ", SIMWORLD_INITERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,11 @@
|
||||
// under windos there seem to be strange
|
||||
// errors when including the STL header too
|
||||
// late...
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define _USE_MATH_DEFINES 1
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@ -63,14 +68,11 @@ using std::string;
|
||||
#ifndef snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#ifndef bool
|
||||
#define bool int
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 1300
|
||||
#include <float.h>
|
||||
#endif
|
||||
#ifndef false
|
||||
#define false 0
|
||||
#endif
|
||||
#ifndef true
|
||||
#define true 1
|
||||
#endif
|
||||
|
||||
#else // WIN32
|
||||
@ -102,6 +104,9 @@ using std::string;
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926536
|
||||
#endif
|
||||
|
||||
#ifndef M_E
|
||||
#define M_E 2.7182818284
|
||||
#endif
|
||||
|
||||
|
@ -496,9 +496,6 @@ void ntlWorld::singleStepSims(double targetTime) {
|
||||
|
||||
|
||||
|
||||
extern bool glob_mpactive;
|
||||
extern int glob_mpindex;
|
||||
|
||||
/******************************************************************************
|
||||
* Render the current scene
|
||||
* uses the global variables from the parser
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "ntl_matrices.h"
|
||||
#include "ntl_ray.h"
|
||||
#include "ntl_matrices.h"
|
||||
#include "globals.h"
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
@ -155,9 +156,6 @@ void ParticleTracer::cleanup() {
|
||||
}
|
||||
}
|
||||
|
||||
extern bool glob_mpactive;
|
||||
extern int glob_mpindex,glob_mpnum;
|
||||
|
||||
/******************************************************************************
|
||||
*! dump particles if desired
|
||||
*****************************************************************************/
|
||||
|
@ -928,9 +928,6 @@ void LbmFsgrSolver::interpolateCellFromCoarse(int lev, int i, int j,int k, int d
|
||||
|
||||
|
||||
|
||||
// required globals
|
||||
extern bool glob_mpactive;
|
||||
extern int glob_mpnum, glob_mpindex;
|
||||
#define MPTADAP_INTERV 4
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -15,6 +15,8 @@
|
||||
#include "solver_relax.h"
|
||||
// for geo init FGI_ defines
|
||||
#include "elbeem.h"
|
||||
#include "globals.h"
|
||||
|
||||
|
||||
// helper for 2d init
|
||||
#define SWAPYZ(vec) { \
|
||||
@ -296,9 +298,6 @@
|
||||
#endif // LBMDIM==2
|
||||
|
||||
|
||||
// required globals
|
||||
extern bool glob_mpactive;
|
||||
extern int glob_mpnum, glob_mpindex;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -14,6 +14,8 @@
|
||||
#include "solver_relax.h"
|
||||
#include "particletracer.h"
|
||||
#include "loop_tools.h"
|
||||
#include "globals.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -24,8 +26,6 @@ double globdfcnt;
|
||||
double globdfavg[19];
|
||||
double globdfmax[19];
|
||||
double globdfmin[19];
|
||||
extern int glob_mpindex,glob_mpnum;
|
||||
extern bool globOutstrForce;
|
||||
|
||||
// simulation object interface
|
||||
void LbmFsgrSolver::step() {
|
||||
|
@ -390,7 +390,7 @@
|
||||
#define DEFAULT_STREAM \
|
||||
m[dC] = RAC(ccel,dC); \
|
||||
\
|
||||
if(((!nbored) & CFBnd)) { \
|
||||
if(0 /* ((!nbored) & CFBnd) */) { \
|
||||
\
|
||||
m[dN ] = CSRC_N ; m[dS ] = CSRC_S ; \
|
||||
m[dE ] = CSRC_E ; m[dW ] = CSRC_W ; \
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "ntl_world.h"
|
||||
#include "simulation_object.h"
|
||||
|
||||
#include "globals.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <zlib.h>
|
||||
#ifndef sqrtf
|
||||
@ -31,10 +33,6 @@
|
||||
// try to enhance surface?
|
||||
#define SURFACE_ENH 2
|
||||
|
||||
extern bool glob_mpactive;
|
||||
extern bool glob_mpnum;
|
||||
extern bool glob_mpindex;
|
||||
|
||||
//! for raytracing
|
||||
void LbmFsgrSolver::prepareVisualization( void ) {
|
||||
int lev = mMaxRefine;
|
||||
|
@ -43,30 +43,29 @@
|
||||
|
||||
GHOST_DisplayManagerX11::
|
||||
GHOST_DisplayManagerX11(
|
||||
GHOST_SystemX11 *system
|
||||
) :
|
||||
GHOST_SystemX11 *system
|
||||
) :
|
||||
GHOST_DisplayManager(),
|
||||
m_system(system)
|
||||
{
|
||||
//nothing to do.
|
||||
}
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
GHOST_DisplayManagerX11::
|
||||
getNumDisplays(
|
||||
GHOST_TUns8& numDisplays
|
||||
) const{
|
||||
getNumDisplays(GHOST_TUns8& numDisplays) const
|
||||
{
|
||||
numDisplays = m_system->getNumDisplays();
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
GHOST_DisplayManagerX11::
|
||||
getNumDisplaySettings(
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32& numSettings
|
||||
) const{
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32& numSettings) const
|
||||
{
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
int majorVersion, minorVersion;
|
||||
XF86VidModeModeInfo **vidmodes;
|
||||
@ -96,13 +95,13 @@ getNumDisplaySettings(
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
GHOST_DisplayManagerX11::
|
||||
getDisplaySetting(
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32 index,
|
||||
GHOST_DisplaySetting& setting
|
||||
) const {
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32 index,
|
||||
GHOST_DisplaySetting& setting) const
|
||||
{
|
||||
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
int majorVersion, minorVersion;
|
||||
@ -128,13 +127,13 @@ getDisplaySetting(
|
||||
|
||||
setting.xPixels = vidmodes[index]->hdisplay;
|
||||
setting.yPixels = vidmodes[index]->vdisplay;
|
||||
setting.bpp = DefaultDepth(dpy,DefaultScreen(dpy));
|
||||
setting.bpp = DefaultDepth(dpy, DefaultScreen(dpy));
|
||||
|
||||
#else
|
||||
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
|
||||
GHOST_ASSERT(index < 1, "Requested setting outside of valid range.\n");
|
||||
|
||||
Display * x_display = m_system->getXDisplay();
|
||||
Display *x_display = m_system->getXDisplay();
|
||||
|
||||
if (x_display == NULL) {
|
||||
return GHOST_kFailure;
|
||||
@ -142,7 +141,7 @@ getDisplaySetting(
|
||||
|
||||
setting.xPixels = DisplayWidth(x_display, DefaultScreen(x_display));
|
||||
setting.yPixels = DisplayHeight(x_display, DefaultScreen(x_display));
|
||||
setting.bpp = DefaultDepth(x_display,DefaultScreen(x_display));
|
||||
setting.bpp = DefaultDepth(x_display, DefaultScreen(x_display));
|
||||
#endif
|
||||
|
||||
// Don't think it's possible to get this value from X!
|
||||
@ -152,25 +151,25 @@ getDisplaySetting(
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
GHOST_DisplayManagerX11::
|
||||
getCurrentDisplaySetting(
|
||||
GHOST_TUns8 display,
|
||||
GHOST_DisplaySetting& setting
|
||||
) const {
|
||||
GHOST_TUns8 display,
|
||||
GHOST_DisplaySetting& setting) const
|
||||
{
|
||||
/* According to the xf86vidmodegetallmodelines man page,
|
||||
* "The first element of the array corresponds to the current video mode."
|
||||
*/
|
||||
return getDisplaySetting(display,GHOST_TInt32(0),setting);
|
||||
return getDisplaySetting(display, GHOST_TInt32(0), setting);
|
||||
}
|
||||
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
GHOST_DisplayManagerX11::
|
||||
setCurrentDisplaySetting(
|
||||
GHOST_TUns8 display,
|
||||
const GHOST_DisplaySetting& setting
|
||||
){
|
||||
GHOST_TUns8 display,
|
||||
const GHOST_DisplaySetting& setting)
|
||||
{
|
||||
#ifdef WITH_X11_XF86VMODE
|
||||
//
|
||||
// Mode switching code ported from Quake 2:
|
||||
@ -196,7 +195,7 @@ setCurrentDisplaySetting(
|
||||
}
|
||||
# ifdef _DEBUG
|
||||
printf("Using XFree86-VidModeExtension Version %d.%d\n",
|
||||
majorVersion, minorVersion);
|
||||
majorVersion, minorVersion);
|
||||
# endif
|
||||
|
||||
/* The X11 man page says vidmodes needs to be freed, but doing so causes a
|
||||
@ -208,7 +207,7 @@ setCurrentDisplaySetting(
|
||||
|
||||
for (int i = 0; i < num_vidmodes; i++) {
|
||||
if (setting.xPixels > vidmodes[i]->hdisplay ||
|
||||
setting.yPixels > vidmodes[i]->vdisplay)
|
||||
setting.yPixels > vidmodes[i]->vdisplay)
|
||||
continue;
|
||||
|
||||
x = setting.xPixels - vidmodes[i]->hdisplay;
|
||||
@ -226,7 +225,7 @@ setCurrentDisplaySetting(
|
||||
actualWidth = vidmodes[best_fit]->hdisplay;
|
||||
actualHeight = vidmodes[best_fit]->vdisplay;
|
||||
printf("Switching to video mode %dx%d\n",
|
||||
actualWidth, actualHeight);
|
||||
actualWidth, actualHeight);
|
||||
# endif
|
||||
|
||||
// change to the mode
|
||||
@ -234,7 +233,8 @@ setCurrentDisplaySetting(
|
||||
|
||||
// Move the viewport to top left
|
||||
XF86VidModeSetViewPort(dpy, scrnum, 0, 0);
|
||||
} else
|
||||
}
|
||||
else
|
||||
return GHOST_kFailure;
|
||||
|
||||
XFlush(dpy);
|
||||
|
@ -50,18 +50,18 @@ public:
|
||||
* Constructor.
|
||||
*/
|
||||
GHOST_DisplayManagerX11(
|
||||
GHOST_SystemX11 *system
|
||||
);
|
||||
GHOST_SystemX11 *system
|
||||
);
|
||||
|
||||
/**
|
||||
* Returns the number of display devices on this system.
|
||||
* @param numDisplays The number of displays on this system.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getNumDisplays(
|
||||
GHOST_TUns8& numDisplays
|
||||
) const;
|
||||
GHOST_TUns8& numDisplays
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Returns the number of display settings for this display device.
|
||||
@ -69,11 +69,11 @@ public:
|
||||
* @param setting The number of settings of the display device with this index.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getNumDisplaySettings(
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32& numSettings
|
||||
) const;
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32& numSettings
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Returns the current setting for this display device.
|
||||
@ -82,12 +82,12 @@ public:
|
||||
* @param setting The setting of the display device with this index.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getDisplaySetting(
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32 index,
|
||||
GHOST_DisplaySetting& setting
|
||||
) const;
|
||||
GHOST_TUns8 display,
|
||||
GHOST_TInt32 index,
|
||||
GHOST_DisplaySetting& setting
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Returns the current setting for this display device.
|
||||
@ -95,11 +95,11 @@ public:
|
||||
* @param setting The current setting of the display device with this index.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getCurrentDisplaySetting(
|
||||
GHOST_TUns8 display,
|
||||
GHOST_DisplaySetting& setting
|
||||
) const;
|
||||
GHOST_TUns8 display,
|
||||
GHOST_DisplaySetting& setting
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Changes the current setting for this display device.
|
||||
@ -107,15 +107,15 @@ public:
|
||||
* @param setting The current setting of the display device with this index.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setCurrentDisplaySetting(
|
||||
GHOST_TUns8 display,
|
||||
const GHOST_DisplaySetting& setting
|
||||
);
|
||||
GHOST_TUns8 display,
|
||||
const GHOST_DisplaySetting& setting
|
||||
);
|
||||
|
||||
private :
|
||||
private:
|
||||
|
||||
GHOST_SystemX11 * m_system;
|
||||
GHOST_SystemX11 *m_system;
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,8 +37,8 @@
|
||||
|
||||
bool GHOST_DropTargetX11::m_xdndInitialized = false;
|
||||
DndClass GHOST_DropTargetX11::m_dndClass;
|
||||
Atom * GHOST_DropTargetX11::m_dndTypes = NULL;
|
||||
Atom * GHOST_DropTargetX11::m_dndActions = NULL;
|
||||
Atom *GHOST_DropTargetX11::m_dndTypes = NULL;
|
||||
Atom *GHOST_DropTargetX11::m_dndActions = NULL;
|
||||
const char *GHOST_DropTargetX11::m_dndMimeTypes[] = {"url/url", "text/uri-list", "text/plain", "application/octet-stream"};
|
||||
int GHOST_DropTargetX11::m_refCounter = 0;
|
||||
|
||||
@ -55,13 +55,13 @@ int GHOST_DropTargetX11::m_refCounter = 0;
|
||||
void GHOST_DropTargetX11::Initialize(void)
|
||||
{
|
||||
Display *display = m_system->getXDisplay();
|
||||
int dndTypesCount = sizeof(m_dndMimeTypes) / sizeof(char*);
|
||||
int dndTypesCount = sizeof(m_dndMimeTypes) / sizeof(char *);
|
||||
int counter;
|
||||
|
||||
xdnd_init(&m_dndClass, display);
|
||||
|
||||
m_dndTypes = new Atom[dndTypesCount + 1];
|
||||
XInternAtoms(display, (char**)m_dndMimeTypes, dndTypesCount, 0, m_dndTypes);
|
||||
XInternAtoms(display, (char **)m_dndMimeTypes, dndTypesCount, 0, m_dndTypes);
|
||||
m_dndTypes[dndTypesCount] = 0;
|
||||
|
||||
m_dndActions = new Atom[8];
|
||||
@ -86,10 +86,10 @@ void GHOST_DropTargetX11::Uninitialize(void)
|
||||
xdnd_shut(&m_dndClass);
|
||||
}
|
||||
|
||||
GHOST_DropTargetX11::GHOST_DropTargetX11(GHOST_WindowX11 * window, GHOST_SystemX11 * system)
|
||||
:
|
||||
m_window(window),
|
||||
m_system(system)
|
||||
GHOST_DropTargetX11::GHOST_DropTargetX11(GHOST_WindowX11 *window, GHOST_SystemX11 *system)
|
||||
:
|
||||
m_window(window),
|
||||
m_system(system)
|
||||
{
|
||||
if (!m_xdndInitialized) {
|
||||
Initialize();
|
||||
@ -177,7 +177,7 @@ void GHOST_DropTargetX11::UrlDecode(char *decodedOut, int bufferSize, const char
|
||||
assert(strlen(decodedOut) < bufferSize);
|
||||
|
||||
// Concatenate this character onto the output
|
||||
strncat(decodedOut, (char*)&asciiCharacter, 1);
|
||||
strncat(decodedOut, (char *)&asciiCharacter, 1);
|
||||
|
||||
// Skip the next character
|
||||
i++;
|
||||
@ -188,7 +188,7 @@ void GHOST_DropTargetX11::UrlDecode(char *decodedOut, int bufferSize, const char
|
||||
|
||||
char *GHOST_DropTargetX11::FileUrlDecode(char *fileUrl)
|
||||
{
|
||||
if(!strncpy(fileUrl, "file://", 7) == 0) {
|
||||
if (!strncpy(fileUrl, "file://", 7) == 0) {
|
||||
/* assume one character of encoded URL can be expanded to 4 chars max */
|
||||
int decodedSize = 4 * strlen(fileUrl) + 1;
|
||||
char *decodedPath = (char *)malloc(decodedSize);
|
||||
@ -217,9 +217,9 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
|
||||
else curLength++;
|
||||
}
|
||||
|
||||
strArray = (GHOST_TStringArray*)malloc(sizeof(GHOST_TStringArray));
|
||||
strArray = (GHOST_TStringArray *)malloc(sizeof(GHOST_TStringArray));
|
||||
strArray->count = 0;
|
||||
strArray->strings = (GHOST_TUns8**)malloc(totPaths*sizeof(GHOST_TUns8*));
|
||||
strArray->strings = (GHOST_TUns8 **)malloc(totPaths * sizeof(GHOST_TUns8 *));
|
||||
|
||||
curLength = 0;
|
||||
for (int i = 0; i <= dropBufferSize; i++) {
|
||||
@ -228,12 +228,12 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
|
||||
char *curPath = (char *)malloc(curLength + 1);
|
||||
char *decodedPath;
|
||||
|
||||
strncpy(curPath, (char*)dropBuffer + i - curLength, curLength);
|
||||
strncpy(curPath, (char *)dropBuffer + i - curLength, curLength);
|
||||
curPath[curLength] = 0;
|
||||
|
||||
decodedPath = FileUrlDecode(curPath);
|
||||
if(decodedPath) {
|
||||
strArray->strings[strArray->count] = (GHOST_TUns8*)decodedPath;
|
||||
if (decodedPath) {
|
||||
strArray->strings[strArray->count] = (GHOST_TUns8 *)decodedPath;
|
||||
strArray->count++;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
* @param window The window to register as drop target.
|
||||
* @param system The associated system.
|
||||
*/
|
||||
GHOST_DropTargetX11(GHOST_WindowX11 * window, GHOST_SystemX11 * system);
|
||||
GHOST_DropTargetX11(GHOST_WindowX11 *window, GHOST_SystemX11 *system);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
@ -55,8 +55,8 @@ public:
|
||||
~GHOST_DropTargetX11();
|
||||
|
||||
/**
|
||||
* Handler of ClientMessage X11 event
|
||||
*/
|
||||
* Handler of ClientMessage X11 event
|
||||
*/
|
||||
bool GHOST_HandleClientMessage(XEvent *event);
|
||||
|
||||
/**
|
||||
@ -73,42 +73,42 @@ private:
|
||||
/* Internal helper functions */
|
||||
|
||||
/**
|
||||
* Initiailize XDND and all related X atoms
|
||||
*/
|
||||
* Initiailize XDND and all related X atoms
|
||||
*/
|
||||
void Initialize(void);
|
||||
|
||||
/**
|
||||
* Uninitiailize XDND and all related X atoms
|
||||
*/
|
||||
* Uninitiailize XDND and all related X atoms
|
||||
*/
|
||||
void Uninitialize(void);
|
||||
|
||||
/**
|
||||
* Get data to be passed to event from text/uri-list mime type
|
||||
* @param dropBuffer - buffer returned from source application
|
||||
* @param dropBufferSize - size of dropped buffer
|
||||
* @return pointer to newly created GHOST data
|
||||
*/
|
||||
void * getURIListGhostData(unsigned char *dropBuffer, int dropBufferSize);
|
||||
* Get data to be passed to event from text/uri-list mime type
|
||||
* @param dropBuffer - buffer returned from source application
|
||||
* @param dropBufferSize - size of dropped buffer
|
||||
* @return pointer to newly created GHOST data
|
||||
*/
|
||||
void *getURIListGhostData(unsigned char *dropBuffer, int dropBufferSize);
|
||||
|
||||
/**
|
||||
* Decode URL (i.e. converts "file:///a%20b/test" to "file:///a b/test")
|
||||
* @param decodedOut - buffer for decoded URL
|
||||
* @param bufferSize - size of output buffer
|
||||
* @param encodedIn - input encoded buffer to be decoded
|
||||
*/
|
||||
* Decode URL (i.e. converts "file:///a%20b/test" to "file:///a b/test")
|
||||
* @param decodedOut - buffer for decoded URL
|
||||
* @param bufferSize - size of output buffer
|
||||
* @param encodedIn - input encoded buffer to be decoded
|
||||
*/
|
||||
void UrlDecode(char *decodedOut, int bufferSize, const char *encodedIn);
|
||||
|
||||
/**
|
||||
* Fully decode file URL (i.e. converts "file:///a%20b/test" to "/a b/test")
|
||||
* @param fileUrl - file path URL to be fully decoded
|
||||
* @return decoded file path (resutl shold be free-d)
|
||||
*/
|
||||
* Fully decode file URL (i.e. converts "file:///a%20b/test" to "/a b/test")
|
||||
* @param fileUrl - file path URL to be fully decoded
|
||||
* @return decoded file path (resutl shold be free-d)
|
||||
*/
|
||||
char *FileUrlDecode(char *fileUrl);
|
||||
|
||||
/* The associated GHOST_WindowWin32. */
|
||||
GHOST_WindowX11 * m_window;
|
||||
GHOST_WindowX11 *m_window;
|
||||
/* The System. */
|
||||
GHOST_SystemX11 * m_system;
|
||||
GHOST_SystemX11 *m_system;
|
||||
|
||||
/* Data type of the dragged object */
|
||||
GHOST_TDragnDropTypes m_draggedObjectType;
|
||||
@ -120,10 +120,10 @@ private:
|
||||
static DndClass m_dndClass;
|
||||
|
||||
/* list of supported types to eb draggeg into */
|
||||
static Atom * m_dndTypes;
|
||||
static Atom *m_dndTypes;
|
||||
|
||||
/* list of supported dran'n'drop actions */
|
||||
static Atom * m_dndActions;
|
||||
static Atom *m_dndActions;
|
||||
|
||||
/* List of supported MIME types to be dragged into */
|
||||
static const char *m_dndMimeTypes[];
|
||||
|
@ -30,9 +30,9 @@
|
||||
|
||||
|
||||
GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
|
||||
:
|
||||
GHOST_NDOFManager(sys),
|
||||
m_available(false)
|
||||
:
|
||||
GHOST_NDOFManager(sys),
|
||||
m_available(false)
|
||||
{
|
||||
setDeadZone(0.1f); /* how to calibrate on Linux? throw away slight motion! */
|
||||
|
||||
@ -44,7 +44,7 @@ GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
|
||||
#define MAX_LINE_LENGTH 100
|
||||
|
||||
/* look for USB devices with Logitech's vendor ID */
|
||||
FILE* command_output = popen("lsusb -d 046d:","r");
|
||||
FILE *command_output = popen("lsusb -d 046d:", "r");
|
||||
if (command_output) {
|
||||
char line[MAX_LINE_LENGTH] = {0};
|
||||
while (fgets(line, MAX_LINE_LENGTH, command_output)) {
|
||||
|
@ -47,9 +47,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef PREFIX
|
||||
static const char *static_path= PREFIX "/share";
|
||||
static const char *static_path = PREFIX "/share";
|
||||
#else
|
||||
static const char *static_path= NULL;
|
||||
static const char *static_path = NULL;
|
||||
#endif
|
||||
|
||||
GHOST_SystemPathsX11::GHOST_SystemPathsX11()
|
||||
@ -60,18 +60,18 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11()
|
||||
{
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const
|
||||
const GHOST_TUns8 *GHOST_SystemPathsX11::getSystemDir() const
|
||||
{
|
||||
/* no prefix assumes a portable build which only uses bundled scripts */
|
||||
return (const GHOST_TUns8 *)static_path;
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
|
||||
const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir() const
|
||||
{
|
||||
#ifndef WITH_XDG_USER_DIRS
|
||||
return (const GHOST_TUns8 *)getenv("HOME");
|
||||
#else /* WITH_XDG_USER_DIRS */
|
||||
const char *home= getenv("XDG_CONFIG_HOME");
|
||||
const char *home = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
if (home) {
|
||||
return (const GHOST_TUns8 *)home;
|
||||
@ -79,10 +79,10 @@ const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
|
||||
else {
|
||||
static char user_path[PATH_MAX];
|
||||
|
||||
home= getenv("HOME");
|
||||
home = getenv("HOME");
|
||||
|
||||
if (home == NULL) {
|
||||
home= getpwuid(getuid())->pw_dir;
|
||||
home = getpwuid(getuid())->pw_dir;
|
||||
}
|
||||
|
||||
snprintf(user_path, sizeof(user_path), "%s/.config", home);
|
||||
@ -91,12 +91,12 @@ const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
|
||||
#endif /* WITH_XDG_USER_DIRS */
|
||||
}
|
||||
|
||||
const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
|
||||
const GHOST_TUns8 *GHOST_SystemPathsX11::getBinaryDir() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void GHOST_SystemPathsX11::addToSystemRecentFiles(const char* filename) const
|
||||
void GHOST_SystemPathsX11::addToSystemRecentFiles(const char *filename) const
|
||||
{
|
||||
/* XXXXX TODO: Implementation for X11 if possible */
|
||||
|
||||
|
@ -55,25 +55,25 @@ public:
|
||||
* "unpack and run" path, then look for properly installed path, not including versioning.
|
||||
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
|
||||
*/
|
||||
const GHOST_TUns8* getSystemDir() const;
|
||||
const GHOST_TUns8 *getSystemDir() const;
|
||||
|
||||
/**
|
||||
* Determine the base dir in which user configuration is stored, not including versioning.
|
||||
* If needed, it will create the base directory.
|
||||
* @return Unsigned char string pointing to user dir (eg ~/.blender/).
|
||||
*/
|
||||
const GHOST_TUns8* getUserDir() const;
|
||||
const GHOST_TUns8 *getUserDir() const;
|
||||
|
||||
/**
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
const GHOST_TUns8* getBinaryDir() const;
|
||||
* Determine the directory of the current binary
|
||||
* @return Unsigned char string pointing to the binary dir
|
||||
*/
|
||||
const GHOST_TUns8 *getBinaryDir() const;
|
||||
|
||||
/**
|
||||
* Add the file to the operating system most recently used files
|
||||
*/
|
||||
void addToSystemRecentFiles(const char* filename) const;
|
||||
void addToSystemRecentFiles(const char *filename) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -63,7 +63,7 @@ public:
|
||||
*/
|
||||
|
||||
GHOST_SystemX11(
|
||||
);
|
||||
);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
@ -71,9 +71,9 @@ public:
|
||||
virtual ~GHOST_SystemX11();
|
||||
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
init(
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
@ -85,28 +85,28 @@ public:
|
||||
* Returns the number of milliseconds since the start of the system process.
|
||||
* @return The number of milliseconds.
|
||||
*/
|
||||
GHOST_TUns64
|
||||
GHOST_TUns64
|
||||
getMilliSeconds(
|
||||
) const;
|
||||
) const;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of displays on this system.
|
||||
* @return The number of displays.
|
||||
*/
|
||||
GHOST_TUns8
|
||||
GHOST_TUns8
|
||||
getNumDisplays(
|
||||
) const;
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Returns the dimensions of the main display on this system.
|
||||
* @return The dimension of the main display.
|
||||
*/
|
||||
void
|
||||
void
|
||||
getMainDisplayDimensions(
|
||||
GHOST_TUns32& width,
|
||||
GHOST_TUns32& height
|
||||
) const;
|
||||
GHOST_TUns32& width,
|
||||
GHOST_TUns32& height
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Create a new window.
|
||||
@ -120,22 +120,22 @@ public:
|
||||
* @param state The state of the window when opened.
|
||||
* @param type The type of drawing context installed in this window.
|
||||
* @param stereoVisual Create a stereo visual for quad buffered stereo.
|
||||
* @param parentWindow Parent (embedder) window
|
||||
* @param parentWindow Parent (embedder) window
|
||||
* @return The new window (or 0 if creation failed).
|
||||
*/
|
||||
GHOST_IWindow*
|
||||
GHOST_IWindow *
|
||||
createWindow(
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples = 0,
|
||||
const GHOST_TEmbedderWindowID parentWindow = 0
|
||||
);
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
const bool stereoVisual,
|
||||
const GHOST_TUns16 numOfAASamples = 0,
|
||||
const GHOST_TEmbedderWindowID parentWindow = 0
|
||||
);
|
||||
|
||||
/**
|
||||
* @section Interface Inherited from GHOST_ISystem
|
||||
@ -146,45 +146,45 @@ public:
|
||||
* @param waitForEvent Flag to wait for an event (or return immediately).
|
||||
* @return Indication of the presence of events.
|
||||
*/
|
||||
bool
|
||||
bool
|
||||
processEvents(
|
||||
bool waitForEvent
|
||||
);
|
||||
bool waitForEvent
|
||||
);
|
||||
|
||||
/**
|
||||
* @section Interface Inherited from GHOST_System
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getCursorPosition(
|
||||
GHOST_TInt32& x,
|
||||
GHOST_TInt32& y
|
||||
) const;
|
||||
GHOST_TInt32& x,
|
||||
GHOST_TInt32& y
|
||||
) const;
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setCursorPosition(
|
||||
GHOST_TInt32 x,
|
||||
GHOST_TInt32 y
|
||||
);
|
||||
GHOST_TInt32 x,
|
||||
GHOST_TInt32 y
|
||||
);
|
||||
|
||||
/**
|
||||
* Returns the state of all modifier keys.
|
||||
* @param keys The state of all modifier keys (true == pressed).
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getModifierKeys(
|
||||
GHOST_ModifierKeys& keys
|
||||
) const;
|
||||
GHOST_ModifierKeys& keys
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Returns the state of the mouse buttons (ouside the message queue).
|
||||
* @param buttons The state of the buttons.
|
||||
* @return Indication of success.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
getButtons(
|
||||
GHOST_Buttons& buttons
|
||||
) const;
|
||||
GHOST_Buttons& buttons
|
||||
) const;
|
||||
|
||||
/**
|
||||
* @section Interface Dirty
|
||||
@ -192,26 +192,26 @@ public:
|
||||
* generate a GHOST window update event on a call to processEvents()
|
||||
*/
|
||||
|
||||
void
|
||||
void
|
||||
addDirtyWindow(
|
||||
GHOST_WindowX11 * bad_wind
|
||||
);
|
||||
GHOST_WindowX11 *bad_wind
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* return a pointer to the X11 display structure
|
||||
*/
|
||||
|
||||
Display *
|
||||
Display *
|
||||
getXDisplay(
|
||||
) {
|
||||
) {
|
||||
return m_display;
|
||||
}
|
||||
|
||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||
XIM
|
||||
XIM
|
||||
getX11_XIM(
|
||||
) {
|
||||
) {
|
||||
return m_xim;
|
||||
}
|
||||
#endif
|
||||
@ -246,13 +246,15 @@ public:
|
||||
* @param window The window on which the event occurred
|
||||
* @return Indication whether the event was handled.
|
||||
*/
|
||||
static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,GHOST_IWindow* window, int mouseX, int mouseY, void* data);
|
||||
static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_IWindow *window, int mouseX, int mouseY, void *data);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @see GHOST_ISystem
|
||||
*/
|
||||
int toggleConsole(int action) { return 0; }
|
||||
int toggleConsole(int action) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Atom used for ICCCM, WM-spec and Motif.
|
||||
@ -282,9 +284,9 @@ public:
|
||||
Atom m_incr;
|
||||
Atom m_utf8_string;
|
||||
|
||||
private :
|
||||
private:
|
||||
|
||||
Display * m_display;
|
||||
Display *m_display;
|
||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||
XIM m_xim;
|
||||
#endif
|
||||
@ -307,24 +309,24 @@ private :
|
||||
* X11 window xwind
|
||||
*/
|
||||
|
||||
GHOST_WindowX11 *
|
||||
GHOST_WindowX11 *
|
||||
findGhostWindow(
|
||||
Window xwind
|
||||
) const;
|
||||
Window xwind
|
||||
) const;
|
||||
|
||||
void
|
||||
void
|
||||
processEvent(
|
||||
XEvent *xe
|
||||
);
|
||||
XEvent *xe
|
||||
);
|
||||
|
||||
Time
|
||||
Time
|
||||
lastEventTime(
|
||||
Time default_time
|
||||
);
|
||||
Time default_time
|
||||
);
|
||||
|
||||
bool
|
||||
bool
|
||||
generateWindowExposeEvents(
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -70,110 +70,110 @@ public:
|
||||
* @param width The width the window.
|
||||
* @param height The height the window.
|
||||
* @param state The state the window is initially opened with.
|
||||
* @param parentWindow Parent (embedder) window
|
||||
* @param parentWindow Parent (embedder) window
|
||||
* @param type The type of drawing context installed in this window.
|
||||
* @param stereoVisual Stereo visual for quad buffered stereo.
|
||||
* @param numOfAASamples Number of samples used for AA (zero if no AA)
|
||||
*/
|
||||
GHOST_WindowX11(
|
||||
GHOST_SystemX11 *system,
|
||||
Display * display,
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
const GHOST_TEmbedderWindowID parentWindow,
|
||||
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
|
||||
const bool stereoVisual = false,
|
||||
const GHOST_TUns16 numOfAASamples = 0
|
||||
);
|
||||
GHOST_SystemX11 *system,
|
||||
Display *display,
|
||||
const STR_String& title,
|
||||
GHOST_TInt32 left,
|
||||
GHOST_TInt32 top,
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
const GHOST_TEmbedderWindowID parentWindow,
|
||||
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
|
||||
const bool stereoVisual = false,
|
||||
const GHOST_TUns16 numOfAASamples = 0
|
||||
);
|
||||
|
||||
bool
|
||||
bool
|
||||
getValid(
|
||||
) const;
|
||||
) const;
|
||||
|
||||
void
|
||||
void
|
||||
setTitle(const STR_String& title);
|
||||
|
||||
void
|
||||
void
|
||||
getTitle(
|
||||
STR_String& title
|
||||
) const;
|
||||
STR_String& title
|
||||
) const;
|
||||
|
||||
void
|
||||
void
|
||||
getWindowBounds(
|
||||
GHOST_Rect& bounds
|
||||
) const;
|
||||
GHOST_Rect& bounds
|
||||
) const;
|
||||
|
||||
void
|
||||
void
|
||||
getClientBounds(
|
||||
GHOST_Rect& bounds
|
||||
) const;
|
||||
GHOST_Rect& bounds
|
||||
) const;
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setClientWidth(
|
||||
GHOST_TUns32 width
|
||||
);
|
||||
GHOST_TUns32 width
|
||||
);
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setClientHeight(
|
||||
GHOST_TUns32 height
|
||||
);
|
||||
GHOST_TUns32 height
|
||||
);
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setClientSize(
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height
|
||||
);
|
||||
GHOST_TUns32 width,
|
||||
GHOST_TUns32 height
|
||||
);
|
||||
|
||||
void
|
||||
void
|
||||
screenToClient(
|
||||
GHOST_TInt32 inX,
|
||||
GHOST_TInt32 inY,
|
||||
GHOST_TInt32& outX,
|
||||
GHOST_TInt32& outY
|
||||
) const;
|
||||
GHOST_TInt32 inX,
|
||||
GHOST_TInt32 inY,
|
||||
GHOST_TInt32& outX,
|
||||
GHOST_TInt32& outY
|
||||
) const;
|
||||
|
||||
void
|
||||
void
|
||||
clientToScreen(
|
||||
GHOST_TInt32 inX,
|
||||
GHOST_TInt32 inY,
|
||||
GHOST_TInt32& outX,
|
||||
GHOST_TInt32& outY
|
||||
) const;
|
||||
GHOST_TInt32 inX,
|
||||
GHOST_TInt32 inY,
|
||||
GHOST_TInt32& outX,
|
||||
GHOST_TInt32& outY
|
||||
) const;
|
||||
|
||||
GHOST_TWindowState
|
||||
GHOST_TWindowState
|
||||
getState(
|
||||
) const;
|
||||
) const;
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setState(
|
||||
GHOST_TWindowState state
|
||||
);
|
||||
GHOST_TWindowState state
|
||||
);
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setOrder(
|
||||
GHOST_TWindowOrder order
|
||||
);
|
||||
GHOST_TWindowOrder order
|
||||
);
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
swapBuffers(
|
||||
);
|
||||
);
|
||||
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
activateDrawingContext(
|
||||
);
|
||||
GHOST_TSuccess
|
||||
);
|
||||
GHOST_TSuccess
|
||||
invalidate(
|
||||
);
|
||||
);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
* Closes the window and disposes resources allocated.
|
||||
*/
|
||||
~GHOST_WindowX11();
|
||||
~GHOST_WindowX11();
|
||||
|
||||
/**
|
||||
* @section x11specific X11 system specific calls
|
||||
@ -185,24 +185,24 @@ public:
|
||||
* the GHOST event queue.
|
||||
*/
|
||||
|
||||
void
|
||||
void
|
||||
validate(
|
||||
);
|
||||
);
|
||||
|
||||
/**
|
||||
* Return a handle to the x11 window type.
|
||||
*/
|
||||
Window
|
||||
Window
|
||||
getXWindow(
|
||||
);
|
||||
);
|
||||
#ifdef WITH_X11_XINPUT
|
||||
class XTablet
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GHOST_TabletData CommonData;
|
||||
|
||||
XDevice* StylusDevice;
|
||||
XDevice* EraserDevice;
|
||||
XDevice *StylusDevice;
|
||||
XDevice *EraserDevice;
|
||||
|
||||
XID StylusID, EraserID;
|
||||
|
||||
@ -215,22 +215,32 @@ public:
|
||||
};
|
||||
|
||||
XTablet& GetXTablet()
|
||||
{ return m_xtablet; }
|
||||
{
|
||||
return m_xtablet;
|
||||
}
|
||||
|
||||
const GHOST_TabletData* GetTabletData()
|
||||
{ return &m_xtablet.CommonData; }
|
||||
const GHOST_TabletData *GetTabletData()
|
||||
{
|
||||
return &m_xtablet.CommonData;
|
||||
}
|
||||
#else // WITH_X11_XINPUT
|
||||
const GHOST_TabletData* GetTabletData()
|
||||
{ return NULL; }
|
||||
const GHOST_TabletData *GetTabletData()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif // WITH_X11_XINPUT
|
||||
|
||||
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
|
||||
XIC getX11_XIC() { return m_xic; }
|
||||
XIC getX11_XIC() {
|
||||
return m_xic;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_XDND
|
||||
GHOST_DropTargetX11* getDropTarget()
|
||||
{ return m_dropTarget; }
|
||||
GHOST_DropTargetX11 *getDropTarget()
|
||||
{
|
||||
return m_dropTarget;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -247,106 +257,106 @@ protected:
|
||||
* @param type The type of rendering context installed.
|
||||
* @return Indication as to whether installation has succeeded.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
installDrawingContext(
|
||||
GHOST_TDrawingContextType type
|
||||
);
|
||||
GHOST_TDrawingContextType type
|
||||
);
|
||||
|
||||
/**
|
||||
* Removes the current drawing context.
|
||||
* @return Indication as to whether removal has succeeded.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
removeDrawingContext(
|
||||
);
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the cursor visibility on the window using
|
||||
* native window system calls.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setWindowCursorVisibility(
|
||||
bool visible
|
||||
);
|
||||
bool visible
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the cursor grab on the window using
|
||||
* native window system calls.
|
||||
* @param warp Only used when grab is enabled, hides the mouse and allows gragging outside the screen.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setWindowCursorGrab(
|
||||
GHOST_TGrabCursorMode mode
|
||||
);
|
||||
GHOST_TGrabCursorMode mode
|
||||
);
|
||||
|
||||
GHOST_TGrabCursorMode
|
||||
GHOST_TGrabCursorMode
|
||||
getWindowCursorGrab() const;
|
||||
|
||||
/**
|
||||
* Sets the cursor shape on the window using
|
||||
* native window system calls.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setWindowCursorShape(
|
||||
GHOST_TStandardCursor shape
|
||||
);
|
||||
GHOST_TStandardCursor shape
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the cursor shape on the window using
|
||||
* native window system calls.
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setWindowCustomCursorShape(
|
||||
GHOST_TUns8 bitmap[16][2],
|
||||
GHOST_TUns8 mask[16][2],
|
||||
int hotX,
|
||||
int hotY
|
||||
);
|
||||
GHOST_TUns8 bitmap[16][2],
|
||||
GHOST_TUns8 mask[16][2],
|
||||
int hotX,
|
||||
int hotY
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets the cursor shape on the window using
|
||||
* native window system calls (Arbitrary size/color).
|
||||
*/
|
||||
GHOST_TSuccess
|
||||
GHOST_TSuccess
|
||||
setWindowCustomCursorShape(
|
||||
GHOST_TUns8 *bitmap,
|
||||
GHOST_TUns8 *mask,
|
||||
int sizex,
|
||||
int sizey,
|
||||
int hotX,
|
||||
int hotY,
|
||||
int fg_color,
|
||||
int bg_color
|
||||
);
|
||||
GHOST_TUns8 *bitmap,
|
||||
GHOST_TUns8 *mask,
|
||||
int sizex,
|
||||
int sizey,
|
||||
int hotX,
|
||||
int hotY,
|
||||
int fg_color,
|
||||
int bg_color
|
||||
);
|
||||
|
||||
private :
|
||||
private:
|
||||
|
||||
/// Force use of public constructor.
|
||||
|
||||
GHOST_WindowX11(
|
||||
);
|
||||
);
|
||||
|
||||
GHOST_WindowX11(
|
||||
const GHOST_WindowX11 &
|
||||
);
|
||||
const GHOST_WindowX11 &
|
||||
);
|
||||
|
||||
Cursor
|
||||
Cursor
|
||||
getStandardCursor(
|
||||
GHOST_TStandardCursor g_cursor
|
||||
);
|
||||
GHOST_TStandardCursor g_cursor
|
||||
);
|
||||
|
||||
Cursor
|
||||
Cursor
|
||||
getEmptyCursor(
|
||||
);
|
||||
);
|
||||
|
||||
#ifdef WITH_X11_XINPUT
|
||||
void initXInputDevices();
|
||||
#endif
|
||||
|
||||
GLXContext m_context;
|
||||
Window m_window;
|
||||
Display *m_display;
|
||||
XVisualInfo *m_visual;
|
||||
GLXContext m_context;
|
||||
Window m_window;
|
||||
Display *m_display;
|
||||
XVisualInfo *m_visual;
|
||||
GHOST_TWindowState m_normal_state;
|
||||
|
||||
/** The first created OpenGL context (for sharing display lists) */
|
||||
@ -354,7 +364,7 @@ private :
|
||||
|
||||
/// A pointer to the typed system class.
|
||||
|
||||
GHOST_SystemX11 * m_system;
|
||||
GHOST_SystemX11 *m_system;
|
||||
|
||||
bool m_valid_setup;
|
||||
|
||||
@ -371,7 +381,7 @@ private :
|
||||
std::map<unsigned int, Cursor> m_standard_cursors;
|
||||
|
||||
#ifdef WITH_XDND
|
||||
GHOST_DropTargetX11 * m_dropTarget;
|
||||
GHOST_DropTargetX11 *m_dropTarget;
|
||||
#endif
|
||||
|
||||
#ifdef WITH_X11_XINPUT
|
||||
|
@ -24,7 +24,9 @@ from bpy.props import StringProperty
|
||||
|
||||
|
||||
def _lang_module_get(sc):
|
||||
return __import__("console_" + sc.language)
|
||||
return __import__("console_" + sc.language,
|
||||
# for python 3.3, maybe a bug???
|
||||
level=0)
|
||||
|
||||
|
||||
class ConsoleExec(Operator):
|
||||
|
@ -121,12 +121,14 @@ class SaveDirty(Operator):
|
||||
if image.packed_file:
|
||||
if image.library:
|
||||
self.report({'WARNING'},
|
||||
"Packed library image: %r from library %r can't be re-packed" %
|
||||
"Packed library image: %r from library %r"
|
||||
" can't be re-packed" %
|
||||
(image.name, image.library.filepath))
|
||||
else:
|
||||
image.pack(as_png=True)
|
||||
else:
|
||||
filepath = bpy.path.abspath(image.filepath, library=image.library)
|
||||
filepath = bpy.path.abspath(image.filepath,
|
||||
library=image.library)
|
||||
if "\\" not in filepath and "/" not in filepath:
|
||||
self.report({'WARNING'}, "Invalid path: " + filepath)
|
||||
elif filepath in unique_paths:
|
||||
|
@ -104,24 +104,29 @@ class SelectPattern(Operator):
|
||||
|
||||
|
||||
class SelectCamera(Operator):
|
||||
'''Select object matching a naming pattern'''
|
||||
'''Select the active camera'''
|
||||
bl_idname = "object.select_camera"
|
||||
bl_label = "Select Camera"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.scene.camera is not None
|
||||
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
camera = scene.camera
|
||||
if camera.name not in scene.objects:
|
||||
self.report({'WARNING'}, "Active camera is not in this scene")
|
||||
view = context.space_data
|
||||
if view.type == 'VIEW_3D' and not view.lock_camera_and_layers:
|
||||
camera = view.camera
|
||||
else:
|
||||
camera = scene.camera
|
||||
|
||||
context.scene.objects.active = camera
|
||||
camera.select = True
|
||||
return {'FINISHED'}
|
||||
if camera is None:
|
||||
self.report({'WARNING'}, "No camera found")
|
||||
elif camera.name not in scene.objects:
|
||||
self.report({'WARNING'}, "Active camera is not in this scene")
|
||||
else:
|
||||
context.scene.objects.active = camera
|
||||
camera.select = True
|
||||
return {'FINISHED'}
|
||||
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
||||
class SelectHierarchy(Operator):
|
||||
|
@ -93,6 +93,29 @@ class AddPresetBase():
|
||||
filepath,
|
||||
preset_menu_class.preset_xml_map)
|
||||
else:
|
||||
|
||||
def rna_recursive_attr_expand(value, rna_path_step, level):
|
||||
if isinstance(value, bpy.types.PropertyGroup):
|
||||
for sub_value_attr in value.bl_rna.properties.keys():
|
||||
if sub_value_attr == "rna_type":
|
||||
continue
|
||||
sub_value = getattr(value, sub_value_attr)
|
||||
rna_recursive_attr_expand(sub_value, "%s.%s" % (rna_path_step, sub_value_attr), level)
|
||||
elif type(value).__name__ == "bpy_prop_collection_idprop": # could use nicer method
|
||||
file_preset.write("%s.clear()\n" % rna_path_step)
|
||||
for sub_value in value:
|
||||
file_preset.write("item_sub_%d = %s.add()\n" % (level, rna_path_step))
|
||||
rna_recursive_attr_expand(sub_value, "item_sub_%d" % level, level + 1)
|
||||
else:
|
||||
# convert thin wrapped sequences
|
||||
# to simple lists to repr()
|
||||
try:
|
||||
value = value[:]
|
||||
except:
|
||||
pass
|
||||
|
||||
file_preset.write("%s = %r\n" % (rna_path_step, value))
|
||||
|
||||
file_preset = open(filepath, 'w')
|
||||
file_preset.write("import bpy\n")
|
||||
|
||||
@ -104,14 +127,7 @@ class AddPresetBase():
|
||||
|
||||
for rna_path in self.preset_values:
|
||||
value = eval(rna_path)
|
||||
# convert thin wrapped sequences
|
||||
# to simple lists to repr()
|
||||
try:
|
||||
value = value[:]
|
||||
except:
|
||||
pass
|
||||
|
||||
file_preset.write("%s = %r\n" % (rna_path, value))
|
||||
rna_recursive_attr_expand(value, rna_path, 1)
|
||||
|
||||
file_preset.close()
|
||||
|
||||
|
@ -764,6 +764,7 @@ class WM_OT_path_open(Operator):
|
||||
|
||||
filepath = StringProperty(
|
||||
subtype='FILE_PATH',
|
||||
options={'SKIP_SAVE'},
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
@ -771,7 +772,13 @@ class WM_OT_path_open(Operator):
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
filepath = bpy.path.abspath(self.filepath)
|
||||
filepath = self.filepath
|
||||
|
||||
if not filepath:
|
||||
self.report({'ERROR'}, "File path was not set")
|
||||
return {'CANCELLED'}
|
||||
|
||||
filepath = bpy.path.abspath(filepath)
|
||||
filepath = os.path.normpath(filepath)
|
||||
|
||||
if not os.path.exists(filepath):
|
||||
@ -1538,6 +1545,65 @@ class WM_OT_addon_disable(Operator):
|
||||
addon_utils.disable(self.module)
|
||||
return {'FINISHED'}
|
||||
|
||||
class WM_OT_theme_install(Operator):
|
||||
"Install a theme"
|
||||
bl_idname = "wm.theme_install"
|
||||
bl_label = "Install Theme..."
|
||||
|
||||
overwrite = BoolProperty(
|
||||
name="Overwrite",
|
||||
description="Remove existing theme file if exists",
|
||||
default=True,
|
||||
)
|
||||
filepath = StringProperty(
|
||||
subtype='FILE_PATH',
|
||||
)
|
||||
filter_folder = BoolProperty(
|
||||
name="Filter folders",
|
||||
default=True,
|
||||
options={'HIDDEN'},
|
||||
)
|
||||
filter_glob = StringProperty(
|
||||
default="*.xml",
|
||||
options={'HIDDEN'},
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
import os
|
||||
import shutil
|
||||
import traceback
|
||||
|
||||
xmlfile = self.filepath
|
||||
|
||||
path_themes = bpy.utils.user_resource('SCRIPTS','presets/interface_theme',create=True)
|
||||
|
||||
if not path_themes:
|
||||
self.report({'ERROR'}, "Failed to get themes path")
|
||||
return {'CANCELLED'}
|
||||
|
||||
path_dest = os.path.join(path_themes, os.path.basename(xmlfile))
|
||||
|
||||
if not self.overwrite:
|
||||
if os.path.exists(path_dest):
|
||||
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
||||
return {'CANCELLED'}
|
||||
|
||||
try:
|
||||
shutil.copyfile(xmlfile, path_dest)
|
||||
bpy.ops.script.execute_preset(filepath=path_dest,menu_idname="USERPREF_MT_interface_theme_presets")
|
||||
|
||||
except:
|
||||
traceback.print_exc()
|
||||
return {'CANCELLED'}
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
def invoke(self, context, event):
|
||||
wm = context.window_manager
|
||||
wm.fileselect_add(self)
|
||||
return {'RUNNING_MODAL'}
|
||||
|
||||
|
||||
class WM_OT_addon_install(Operator):
|
||||
"Install an addon"
|
||||
|
@ -35,7 +35,7 @@ class MotionPathButtonsPanel():
|
||||
layout = self.layout
|
||||
|
||||
mps = avs.motion_path
|
||||
|
||||
|
||||
# Display Range
|
||||
layout.prop(mps, "type", expand=True)
|
||||
|
||||
@ -50,21 +50,21 @@ class MotionPathButtonsPanel():
|
||||
elif (mps.type == 'RANGE'):
|
||||
sub.prop(mps, "frame_start", text="Start")
|
||||
sub.prop(mps, "frame_end", text="End")
|
||||
|
||||
|
||||
sub.prop(mps, "frame_step", text="Step")
|
||||
|
||||
|
||||
col = split.column()
|
||||
if bones:
|
||||
col.label(text="Cache for Bone:")
|
||||
else:
|
||||
col.label(text="Cache:")
|
||||
|
||||
|
||||
if mpath:
|
||||
sub = col.column(align=True)
|
||||
sub.enabled = False
|
||||
sub.prop(mpath, "frame_start", text="From")
|
||||
sub.prop(mpath, "frame_end", text="To")
|
||||
|
||||
|
||||
if bones:
|
||||
col.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA')
|
||||
else:
|
||||
@ -72,15 +72,14 @@ class MotionPathButtonsPanel():
|
||||
else:
|
||||
col.label(text="Not available yet...", icon='ERROR')
|
||||
col.label(text="Calculate Paths first", icon='INFO')
|
||||
|
||||
|
||||
|
||||
# Display Settings
|
||||
split = layout.split()
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.label(text="Show:")
|
||||
col.prop(mps, "show_frame_numbers", text="Frame Numbers")
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.prop(mps, "show_keyframe_highlight", text="Keyframes")
|
||||
sub = col.column()
|
||||
|
@ -305,10 +305,10 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
||||
|
||||
ob = context.object
|
||||
avs = ob.pose.animation_visualisation
|
||||
|
||||
|
||||
pchan = context.active_pose_bone
|
||||
mpath = pchan.motion_path if pchan else None
|
||||
|
||||
|
||||
self.draw_settings(context, avs, mpath, bones=True)
|
||||
|
||||
|
||||
|
@ -356,9 +356,6 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
|
||||
sub.prop(bone, "bbone_in", text="Ease In")
|
||||
sub.prop(bone, "bbone_out", text="Ease Out")
|
||||
|
||||
col.label(text="Offset:")
|
||||
col.prop(bone, "use_cyclic_offset")
|
||||
|
||||
|
||||
class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
|
||||
|
@ -547,6 +547,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
col.prop(md, "angle")
|
||||
col.prop(md, "steps")
|
||||
col.prop(md, "render_steps")
|
||||
col.prop(md, "use_smooth_shade")
|
||||
|
||||
col = split.column()
|
||||
row = col.row()
|
||||
@ -838,6 +839,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
if md.mode == 'SHARP':
|
||||
layout.prop(md, "sharpness")
|
||||
|
||||
layout.prop(md, "use_smooth_shade")
|
||||
layout.prop(md, "remove_disconnected_pieces")
|
||||
row = layout.row()
|
||||
row.active = md.remove_disconnected_pieces
|
||||
|
@ -301,7 +301,7 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
|
||||
ob = context.object
|
||||
avs = ob.animation_visualisation
|
||||
mpath = ob.motion_path
|
||||
|
||||
|
||||
self.draw_settings(context, avs, mpath)
|
||||
|
||||
|
||||
|
@ -67,3 +67,37 @@ class UnifiedPaintPanel():
|
||||
ups = context.tool_settings.unified_paint_settings
|
||||
ptr = ups if ups.use_unified_weight else brush
|
||||
parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider)
|
||||
|
||||
|
||||
# Used in both the View3D toolbar and texture properties
|
||||
def sculpt_brush_texture_settings(layout, brush):
|
||||
tex_slot = brush.texture_slot
|
||||
|
||||
layout.label(text="Brush Mapping:")
|
||||
|
||||
# map_mode
|
||||
layout.row().prop(tex_slot, "map_mode", text="")
|
||||
layout.separator()
|
||||
|
||||
# angle and texture_angle_source
|
||||
col = layout.column()
|
||||
col.active = brush.sculpt_capabilities.has_texture_angle_source
|
||||
col.label(text="Angle:")
|
||||
if brush.sculpt_capabilities.has_random_texture_angle:
|
||||
col.prop(brush, "texture_angle_source_random", text="")
|
||||
else:
|
||||
col.prop(brush, "texture_angle_source_no_random", text="")
|
||||
|
||||
col = layout.column()
|
||||
col.active = brush.sculpt_capabilities.has_texture_angle
|
||||
col.prop(tex_slot, "angle", text="")
|
||||
|
||||
# scale and offset
|
||||
split = layout.split()
|
||||
split.prop(tex_slot, "offset")
|
||||
split.prop(tex_slot, "scale")
|
||||
|
||||
# texture_sample_bias
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Sample Bias:")
|
||||
col.prop(brush, "texture_sample_bias", slider=True, text="")
|
||||
|
@ -112,7 +112,6 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
|
||||
|
||||
col = split.column()
|
||||
col.prop(field, "use_object_coords")
|
||||
col.prop(field, "use_root_coords")
|
||||
col.prop(field, "use_2d_force")
|
||||
else:
|
||||
basic_force_field_settings_ui(self, context, field)
|
||||
|
@ -122,7 +122,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
|
||||
subcol.operator_context = 'INVOKE_DEFAULT'
|
||||
subcol.operator("anim.keying_set_export", text="Export to File").filepath = "keyingset.py"
|
||||
|
||||
col = row.column()
|
||||
col = row.column(align=True)
|
||||
col.label(text="Keyframing Settings:")
|
||||
col.prop(ks, "bl_options")
|
||||
|
||||
@ -161,20 +161,25 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
|
||||
col.template_any_ID(ksp, "id", "id_type")
|
||||
col.template_path_builder(ksp, "data_path", ksp.id)
|
||||
|
||||
row = col.row(align=True)
|
||||
row.label(text="Array Target:")
|
||||
row.prop(ksp, "use_entire_array", text="All Items")
|
||||
if ksp.use_entire_array:
|
||||
row.label(text=" ") # padding
|
||||
else:
|
||||
row.prop(ksp, "array_index", text="Index")
|
||||
|
||||
layout.separator()
|
||||
|
||||
row = layout.row()
|
||||
|
||||
col = row.column()
|
||||
col.label(text="Array Target:")
|
||||
col.prop(ksp, "use_entire_array")
|
||||
if ksp.use_entire_array is False:
|
||||
col.prop(ksp, "array_index")
|
||||
|
||||
col = row.column()
|
||||
col.label(text="F-Curve Grouping:")
|
||||
col.prop(ksp, "group_method")
|
||||
col.prop(ksp, "group_method", text="")
|
||||
if ksp.group_method == 'NAMED':
|
||||
col.prop(ksp, "group")
|
||||
|
||||
|
||||
col = row.column(align=True)
|
||||
col.label(text="Keyframing Settings:")
|
||||
col.prop(ksp, "bl_options")
|
||||
|
||||
|
||||
|
@ -29,6 +29,8 @@ from bpy.types import (Brush,
|
||||
|
||||
from rna_prop_ui import PropertyPanel
|
||||
|
||||
from bl_ui.properties_paint_common import sculpt_brush_texture_settings
|
||||
|
||||
|
||||
class TEXTURE_MT_specials(Menu):
|
||||
bl_label = "Texture Specials"
|
||||
@ -856,12 +858,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
|
||||
|
||||
if isinstance(idblock, Brush):
|
||||
if context.sculpt_object:
|
||||
layout.label(text="Brush Mapping:")
|
||||
layout.prop(tex, "map_mode", expand=True)
|
||||
|
||||
row = layout.row()
|
||||
row.active = tex.map_mode in {'FIXED', 'TILED'}
|
||||
row.prop(tex, "angle")
|
||||
sculpt_brush_texture_settings(layout, idblock)
|
||||
else:
|
||||
if isinstance(idblock, Material):
|
||||
split = layout.split(percentage=0.3)
|
||||
@ -884,9 +881,9 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
|
||||
row.prop(tex, "mapping_y", text="")
|
||||
row.prop(tex, "mapping_z", text="")
|
||||
|
||||
row = layout.row()
|
||||
row.column().prop(tex, "offset")
|
||||
row.column().prop(tex, "scale")
|
||||
row = layout.row()
|
||||
row.column().prop(tex, "offset")
|
||||
row.column().prop(tex, "scale")
|
||||
|
||||
|
||||
class TEXTURE_PT_influence(TextureSlotPanel, Panel):
|
||||
|
@ -101,6 +101,7 @@ class CLIP_PT_clip_view_panel:
|
||||
|
||||
return clip and sc.view == 'CLIP'
|
||||
|
||||
|
||||
class CLIP_PT_tracking_panel:
|
||||
|
||||
@classmethod
|
||||
|
@ -205,5 +205,25 @@ class NODE_PT_properties(Panel):
|
||||
col.prop(snode, "backdrop_y", text="Y")
|
||||
col.operator("node.backimage_move", text="Move")
|
||||
|
||||
class NODE_PT_quality(bpy.types.Panel):
|
||||
bl_space_type = 'NODE_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
bl_label = "Quality"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
snode = context.space_data
|
||||
return snode.tree_type == 'COMPOSITING' and snode.node_tree is not None
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
snode = context.space_data
|
||||
tree = snode.node_tree
|
||||
|
||||
layout.prop(tree, "render_quality", text="Render")
|
||||
layout.prop(tree, "edit_quality", text="Edit")
|
||||
layout.prop(tree, "chunksize")
|
||||
layout.prop(tree, "use_opencl")
|
||||
|
||||
if __name__ == "__main__": # only for live edit.
|
||||
bpy.utils.register_module(__name__)
|
||||
|
@ -277,7 +277,7 @@ class TEXT_MT_edit(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("text.move_lines",
|
||||
layout.operator("text.move_lines",
|
||||
text="Move line(s) up").direction = 'UP'
|
||||
layout.operator("text.move_lines",
|
||||
text="Move line(s) down").direction = 'DOWN'
|
||||
|
@ -83,7 +83,7 @@ class TIME_HT_header(Header):
|
||||
row.prop(toolsettings, "use_keyframe_insert_auto", text="", toggle=True)
|
||||
if toolsettings.use_keyframe_insert_auto:
|
||||
row.prop(toolsettings, "use_keyframe_insert_keyingset", text="", toggle=True)
|
||||
|
||||
|
||||
if screen.is_animation_playing:
|
||||
subsub = row.row()
|
||||
subsub.prop(toolsettings, "use_record_with_nla", toggle=True)
|
||||
|
@ -96,6 +96,7 @@ class USERPREF_HT_header(Header):
|
||||
layout.menu("USERPREF_MT_addons_dev_guides")
|
||||
elif userpref.active_section == 'THEMES':
|
||||
layout.operator("ui.reset_default_theme")
|
||||
layout.operator("wm.theme_install")
|
||||
|
||||
|
||||
class USERPREF_PT_tabs(Panel):
|
||||
@ -452,7 +453,7 @@ class USERPREF_PT_system(Panel):
|
||||
col.separator()
|
||||
col.separator()
|
||||
|
||||
col.label(text="Sequencer:")
|
||||
col.label(text="Sequencer / Clip Editor:")
|
||||
col.prop(system, "prefetch_frames")
|
||||
col.prop(system, "memory_cache_limit")
|
||||
|
||||
|
@ -93,7 +93,7 @@ class VIEW3D_HT_header(Header):
|
||||
if snap_element != 'INCREMENT':
|
||||
row.prop(toolsettings, "snap_target", text="")
|
||||
if obj:
|
||||
if obj.mode == 'OBJECT' and snap_element != 'VOLUME':
|
||||
if obj.mode in {'OBJECT', 'POSE'} and snap_element != 'VOLUME':
|
||||
row.prop(toolsettings, "use_snap_align_rotation", text="")
|
||||
elif obj.mode == 'EDIT':
|
||||
row.prop(toolsettings, "use_snap_self", text="")
|
||||
@ -164,7 +164,7 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base):
|
||||
def draw(self, context):
|
||||
# base menu
|
||||
VIEW3D_MT_transform_base.draw(self, context)
|
||||
|
||||
|
||||
# generic...
|
||||
layout = self.layout
|
||||
layout.separator()
|
||||
@ -178,16 +178,16 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base):
|
||||
def draw(self, context):
|
||||
# base menu
|
||||
VIEW3D_MT_transform_base.draw(self, context)
|
||||
|
||||
|
||||
# object-specific option follow...
|
||||
layout = self.layout
|
||||
layout.separator()
|
||||
|
||||
layout.operator("transform.translate", text="Move Texture Space").texture_space = True
|
||||
layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
layout.operator_context = 'EXEC_REGION_WIN'
|
||||
layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
|
||||
|
||||
@ -214,13 +214,13 @@ class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base):
|
||||
def draw(self, context):
|
||||
# base menu
|
||||
VIEW3D_MT_transform_base.draw(self, context)
|
||||
|
||||
|
||||
# armature specific extensions follow...
|
||||
layout = self.layout
|
||||
layout.separator()
|
||||
|
||||
obj = context.object
|
||||
if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
|
||||
if (obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and
|
||||
obj.data.draw_type in {'BBONE', 'ENVELOPE'}):
|
||||
layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
|
||||
|
||||
@ -612,6 +612,7 @@ class VIEW3D_MT_select_edit_curve(Menu):
|
||||
layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
|
||||
layout.operator("curve.select_random")
|
||||
layout.operator("curve.select_nth", text="Every Nth Number of Points")
|
||||
layout.operator("curve.select_linked", text="Select Linked")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -641,6 +642,7 @@ class VIEW3D_MT_select_edit_surface(Menu):
|
||||
layout.operator("curve.select_all", text="Inverse").action = 'INVERT'
|
||||
layout.operator("curve.select_random")
|
||||
layout.operator("curve.select_nth", text="Every Nth Number of Points")
|
||||
layout.operator("curve.select_linked", text="Select Linked")
|
||||
|
||||
layout.separator()
|
||||
|
||||
@ -1286,7 +1288,7 @@ class VIEW3D_MT_hide_mask(Menu):
|
||||
op = layout.operator("paint.hide_show", text="Show Bounding Box")
|
||||
op.action = 'SHOW'
|
||||
op.area = 'INSIDE'
|
||||
|
||||
|
||||
op = layout.operator("paint.hide_show", text="Hide Masked")
|
||||
op.area = 'MASKED'
|
||||
op.action = 'HIDE'
|
||||
@ -1795,6 +1797,11 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("transform.edge_crease")
|
||||
layout.operator("transform.edge_bevelweight")
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("mesh.mark_seam").clear = False
|
||||
layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
|
||||
|
||||
@ -1947,8 +1954,8 @@ def draw_curve(self, context):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("curve.extrude")
|
||||
layout.operator("curve.duplicate")
|
||||
layout.operator("curve.extrude_move")
|
||||
layout.operator("curve.duplicate_move")
|
||||
layout.operator("curve.separate")
|
||||
layout.operator("curve.make_segment")
|
||||
layout.operator("curve.cyclic_toggle")
|
||||
@ -1994,7 +2001,7 @@ class VIEW3D_MT_edit_curve_ctrlpoints(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.menu("VIEW3D_MT_hook")
|
||||
layout.menu("VIEW3D_MT_hook")
|
||||
|
||||
|
||||
class VIEW3D_MT_edit_curve_segments(Menu):
|
||||
@ -2304,7 +2311,7 @@ class VIEW3D_PT_view3d_cursor(Panel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
view = context.space_data
|
||||
return (view)
|
||||
return (view is not None)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -20,6 +20,7 @@
|
||||
import bpy
|
||||
from bpy.types import Menu, Panel
|
||||
from bl_ui.properties_paint_common import UnifiedPaintPanel
|
||||
from bl_ui.properties_paint_common import sculpt_brush_texture_settings
|
||||
|
||||
|
||||
class View3DPanel():
|
||||
@ -231,7 +232,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Curve:")
|
||||
col.operator("curve.duplicate")
|
||||
col.operator("curve.duplicate_move", text="Duplicate")
|
||||
col.operator("curve.delete")
|
||||
col.operator("curve.cyclic_toggle")
|
||||
col.operator("curve.switch_direction")
|
||||
@ -248,7 +249,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Modeling:")
|
||||
col.operator("curve.extrude")
|
||||
col.operator("curve.extrude_move", text="Extrude")
|
||||
col.operator("curve.subdivide")
|
||||
|
||||
draw_repeat_tools(context, layout)
|
||||
@ -273,14 +274,14 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel, Panel):
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Curve:")
|
||||
col.operator("curve.duplicate")
|
||||
col.operator("curve.duplicate_move", text="Duplicate")
|
||||
col.operator("curve.delete")
|
||||
col.operator("curve.cyclic_toggle")
|
||||
col.operator("curve.switch_direction")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Modeling:")
|
||||
col.operator("curve.extrude")
|
||||
col.operator("curve.extrude", text="Extrude")
|
||||
col.operator("curve.subdivide")
|
||||
|
||||
draw_repeat_tools(context, layout)
|
||||
@ -719,45 +720,11 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
|
||||
col.prop(brush, "use_fixed_texture")
|
||||
|
||||
if context.sculpt_object:
|
||||
#XXX duplicated from properties_texture.py
|
||||
|
||||
col.label(text="Brush Mapping:")
|
||||
col.row().prop(tex_slot, "map_mode", expand=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = tex_slot.map_mode in {'FIXED'}
|
||||
col.label(text="Angle:")
|
||||
if brush.sculpt_capabilities.has_random_texture_angle:
|
||||
col.prop(brush, "texture_angle_source_random", text="")
|
||||
else:
|
||||
col.prop(brush, "texture_angle_source_no_random", text="")
|
||||
|
||||
#row = col.row(align=True)
|
||||
#row.label(text="Angle:")
|
||||
#row.active = tex_slot.map_mode in {'FIXED', 'TILED'}
|
||||
|
||||
#row = col.row(align=True)
|
||||
|
||||
#col = row.column()
|
||||
#col.active = tex_slot.map_mode in {'FIXED'}
|
||||
#col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
|
||||
|
||||
col = layout.column()
|
||||
col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
|
||||
col.prop(tex_slot, "angle", text="")
|
||||
|
||||
split = layout.split()
|
||||
split.prop(tex_slot, "offset")
|
||||
split.prop(tex_slot, "scale")
|
||||
sculpt_brush_texture_settings(col, brush)
|
||||
|
||||
# use_texture_overlay and texture_overlay_alpha
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Sample Bias:")
|
||||
col.prop(brush, "texture_sample_bias", slider=True, text="")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.active = tex_slot.map_mode in {'FIXED', 'TILED'}
|
||||
col.active = brush.sculpt_capabilities.has_overlay
|
||||
col.label(text="Overlay:")
|
||||
|
||||
row = col.row()
|
||||
@ -766,7 +733,6 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
|
||||
else:
|
||||
row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
|
||||
sub = row.row()
|
||||
sub.active = tex_slot.map_mode in {'FIXED', 'TILED'} and brush.use_texture_overlay
|
||||
sub.prop(brush, "texture_overlay_alpha", text="Alpha")
|
||||
|
||||
|
||||
|
@ -95,11 +95,13 @@ add_subdirectory(blenkernel)
|
||||
add_subdirectory(blenlib)
|
||||
add_subdirectory(bmesh)
|
||||
add_subdirectory(render)
|
||||
add_subdirectory(compositor)
|
||||
add_subdirectory(blenfont)
|
||||
add_subdirectory(blenloader)
|
||||
add_subdirectory(blenpluginapi)
|
||||
add_subdirectory(ikplugin)
|
||||
add_subdirectory(gpu)
|
||||
add_subdirectory(opencl)
|
||||
add_subdirectory(imbuf)
|
||||
add_subdirectory(avi)
|
||||
add_subdirectory(nodes)
|
||||
|
@ -9,10 +9,12 @@ SConscript(['avi/SConscript',
|
||||
'blenloader/SConscript',
|
||||
'blenpluginapi/SConscript',
|
||||
'gpu/SConscript',
|
||||
'opencl/SConscript',
|
||||
'editors/SConscript',
|
||||
'freestyle/SConscript',
|
||||
'imbuf/SConscript',
|
||||
'makesdna/SConscript',
|
||||
'compositor/SConscript',
|
||||
'render/SConscript',
|
||||
'nodes/SConscript',
|
||||
'modifiers/SConscript',
|
||||
|
@ -201,7 +201,7 @@ typedef struct _AviMovie {
|
||||
} AviMovie;
|
||||
|
||||
typedef enum {
|
||||
AVI_ERROR_NONE=0,
|
||||
AVI_ERROR_NONE = 0,
|
||||
AVI_ERROR_COMPRESSION,
|
||||
AVI_ERROR_OPEN,
|
||||
AVI_ERROR_READING,
|
||||
@ -214,7 +214,7 @@ typedef enum {
|
||||
|
||||
/* belongs to the option-setting function. */
|
||||
typedef enum {
|
||||
AVI_OPTION_WIDTH=0,
|
||||
AVI_OPTION_WIDTH = 0,
|
||||
AVI_OPTION_HEIGHT,
|
||||
AVI_OPTION_QUALITY,
|
||||
AVI_OPTION_FRAMERATE
|
||||
@ -230,7 +230,7 @@ typedef enum {
|
||||
/**
|
||||
* This is a sort of MAKE_ID thing. Used in imbuf :( It is used
|
||||
* through options in the AVI header (AviStreamHeader). */
|
||||
#define FCC(ch4) (ch4[0] | ch4[1]<<8 | ch4[2]<<16 | ch4[3] << 24)
|
||||
#define FCC(ch4) (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24)
|
||||
|
||||
/**
|
||||
* Test whether this is an avi-format.
|
||||
|
@ -191,11 +191,11 @@ struct DerivedMesh {
|
||||
* and freed on the next ->release(). consider using getVert/Edge/Face if
|
||||
* you are only interested in a few verts/edges/faces.
|
||||
*/
|
||||
struct MVert *(*getVertArray)(DerivedMesh *dm);
|
||||
struct MEdge *(*getEdgeArray)(DerivedMesh *dm);
|
||||
struct MFace *(*getTessFaceArray)(DerivedMesh *dm);
|
||||
struct MLoop *(*getLoopArray)(DerivedMesh *dm);
|
||||
struct MPoly *(*getPolyArray)(DerivedMesh *dm);
|
||||
struct MVert *(*getVertArray)(DerivedMesh * dm);
|
||||
struct MEdge *(*getEdgeArray)(DerivedMesh * dm);
|
||||
struct MFace *(*getTessFaceArray)(DerivedMesh * dm);
|
||||
struct MLoop *(*getLoopArray)(DerivedMesh * dm);
|
||||
struct MPoly *(*getPolyArray)(DerivedMesh * dm);
|
||||
|
||||
/* copy all verts/edges/faces from the derived mesh into
|
||||
* *{vert/edge/face}_r (must point to a buffer large enough)
|
||||
@ -209,35 +209,35 @@ struct DerivedMesh {
|
||||
/* return a copy of all verts/edges/faces from the derived mesh
|
||||
* it is the caller's responsibility to free the returned pointer
|
||||
*/
|
||||
struct MVert *(*dupVertArray)(DerivedMesh *dm);
|
||||
struct MEdge *(*dupEdgeArray)(DerivedMesh *dm);
|
||||
struct MFace *(*dupTessFaceArray)(DerivedMesh *dm);
|
||||
struct MLoop *(*dupLoopArray)(DerivedMesh *dm);
|
||||
struct MPoly *(*dupPolyArray)(DerivedMesh *dm);
|
||||
struct MVert *(*dupVertArray)(DerivedMesh * dm);
|
||||
struct MEdge *(*dupEdgeArray)(DerivedMesh * dm);
|
||||
struct MFace *(*dupTessFaceArray)(DerivedMesh * dm);
|
||||
struct MLoop *(*dupLoopArray)(DerivedMesh * dm);
|
||||
struct MPoly *(*dupPolyArray)(DerivedMesh * dm);
|
||||
|
||||
/* return a pointer to a single element of vert/edge/face custom data
|
||||
* from the derived mesh (this gives a pointer to the actual data, not
|
||||
* a copy)
|
||||
*/
|
||||
void *(*getVertData)(DerivedMesh *dm, int index, int type);
|
||||
void *(*getEdgeData)(DerivedMesh *dm, int index, int type);
|
||||
void *(*getTessFaceData)(DerivedMesh *dm, int index, int type);
|
||||
void *(*getVertData)(DerivedMesh * dm, int index, int type);
|
||||
void *(*getEdgeData)(DerivedMesh * dm, int index, int type);
|
||||
void *(*getTessFaceData)(DerivedMesh * dm, int index, int type);
|
||||
|
||||
/* return a pointer to the entire array of vert/edge/face custom data
|
||||
* from the derived mesh (this gives a pointer to the actual data, not
|
||||
* a copy)
|
||||
*/
|
||||
void *(*getVertDataArray)(DerivedMesh *dm, int type);
|
||||
void *(*getEdgeDataArray)(DerivedMesh *dm, int type);
|
||||
void *(*getTessFaceDataArray)(DerivedMesh *dm, int type);
|
||||
void *(*getVertDataArray)(DerivedMesh * dm, int type);
|
||||
void *(*getEdgeDataArray)(DerivedMesh * dm, int type);
|
||||
void *(*getTessFaceDataArray)(DerivedMesh * dm, int type);
|
||||
|
||||
/* retrieves the base CustomData structures for
|
||||
* verts/edges/tessfaces/loops/facdes*/
|
||||
CustomData *(*getVertDataLayout)(DerivedMesh *dm);
|
||||
CustomData *(*getEdgeDataLayout)(DerivedMesh *dm);
|
||||
CustomData *(*getTessFaceDataLayout)(DerivedMesh *dm);
|
||||
CustomData *(*getLoopDataLayout)(DerivedMesh *dm);
|
||||
CustomData *(*getPolyDataLayout)(DerivedMesh *dm);
|
||||
CustomData *(*getVertDataLayout)(DerivedMesh * dm);
|
||||
CustomData *(*getEdgeDataLayout)(DerivedMesh * dm);
|
||||
CustomData *(*getTessFaceDataLayout)(DerivedMesh * dm);
|
||||
CustomData *(*getLoopDataLayout)(DerivedMesh * dm);
|
||||
CustomData *(*getPolyDataLayout)(DerivedMesh * dm);
|
||||
|
||||
/*copies all customdata for an element source into dst at index dest*/
|
||||
void (*copyFromVertCData)(DerivedMesh *dm, int source, CustomData *dst, int dest);
|
||||
@ -247,12 +247,12 @@ struct DerivedMesh {
|
||||
/* optional grid access for subsurf */
|
||||
int (*getNumGrids)(DerivedMesh *dm);
|
||||
int (*getGridSize)(DerivedMesh *dm);
|
||||
struct CCGElem **(*getGridData)(DerivedMesh *dm);
|
||||
DMGridAdjacency *(*getGridAdjacency)(DerivedMesh *dm);
|
||||
int *(*getGridOffset)(DerivedMesh *dm);
|
||||
struct CCGElem **(*getGridData)(DerivedMesh * dm);
|
||||
DMGridAdjacency *(*getGridAdjacency)(DerivedMesh * dm);
|
||||
int *(*getGridOffset)(DerivedMesh * dm);
|
||||
void (*getGridKey)(DerivedMesh *dm, struct CCGKey *key);
|
||||
DMFlagMat *(*getGridFlagMats)(DerivedMesh *dm);
|
||||
unsigned int **(*getGridHidden)(DerivedMesh *dm);
|
||||
DMFlagMat *(*getGridFlagMats)(DerivedMesh * dm);
|
||||
unsigned int **(*getGridHidden)(DerivedMesh * dm);
|
||||
|
||||
|
||||
/* Iterate over each mapped vertex in the derived mesh, calling the
|
||||
@ -335,15 +335,15 @@ struct DerivedMesh {
|
||||
* Also called for *final* editmode DerivedMeshes
|
||||
*/
|
||||
void (*drawFacesSolid)(DerivedMesh *dm, float (*partial_redraw_planes)[4],
|
||||
int fast, DMSetMaterial setMaterial);
|
||||
int fast, DMSetMaterial setMaterial);
|
||||
|
||||
/* Draw all faces using MTFace
|
||||
* o Drawing options too complicated to enumerate, look at code.
|
||||
*/
|
||||
void (*drawFacesTex)(DerivedMesh *dm,
|
||||
DMSetDrawOptionsTex setDrawOptions,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData);
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData);
|
||||
|
||||
/* Draw all faces with GLSL materials
|
||||
* o setMaterial is called for every different material nr
|
||||
@ -365,19 +365,19 @@ struct DerivedMesh {
|
||||
* smooth shaded.
|
||||
*/
|
||||
void (*drawMappedFaces)(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMSetMaterial setMaterial,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData,
|
||||
DMDrawFlag flag);
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMSetMaterial setMaterial,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData,
|
||||
DMDrawFlag flag);
|
||||
|
||||
/* Draw mapped faces using MTFace
|
||||
* o Drawing options too complicated to enumerate, look at code.
|
||||
*/
|
||||
void (*drawMappedFacesTex)(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData);
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMCompareDrawOptions compareDrawOptions,
|
||||
void *userData);
|
||||
|
||||
/* Draw mapped faces with GLSL materials
|
||||
* o setMaterial is called for every different material nr
|
||||
@ -385,17 +385,17 @@ struct DerivedMesh {
|
||||
* o Only if setMaterial and setDrawOptions return true
|
||||
*/
|
||||
void (*drawMappedFacesGLSL)(DerivedMesh *dm,
|
||||
DMSetMaterial setMaterial,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
void *userData);
|
||||
DMSetMaterial setMaterial,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
void *userData);
|
||||
|
||||
/* Draw mapped edges as lines
|
||||
* o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge)
|
||||
* returns true
|
||||
*/
|
||||
void (*drawMappedEdges)(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
void *userData);
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
void *userData);
|
||||
|
||||
/* Draw mapped edges as lines with interpolation values
|
||||
* o Only if !setDrawOptions or
|
||||
@ -405,17 +405,17 @@ struct DerivedMesh {
|
||||
* NOTE: This routine is optional!
|
||||
*/
|
||||
void (*drawMappedEdgesInterp)(DerivedMesh *dm,
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMSetDrawInterpOptions setDrawInterpOptions,
|
||||
void *userData);
|
||||
DMSetDrawOptions setDrawOptions,
|
||||
DMSetDrawInterpOptions setDrawInterpOptions,
|
||||
void *userData);
|
||||
|
||||
/* Draw all faces with materials
|
||||
* o setMaterial is called for every different material nr
|
||||
* o setFace is called to verify if a face must be hidden
|
||||
*/
|
||||
void (*drawMappedFacesMat)(DerivedMesh *dm,
|
||||
void (*setMaterial)(void *userData, int, void *attribs),
|
||||
int (*setFace)(void *userData, int index), void *userData);
|
||||
void (*setMaterial)(void *userData, int, void *attribs),
|
||||
int (*setFace)(void *userData, int index), void *userData);
|
||||
|
||||
/* Release reference to the DerivedMesh. This function decides internally
|
||||
* if the DerivedMesh will be freed, or cached for later use. */
|
||||
@ -438,9 +438,9 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges,
|
||||
* of vertices, edges and faces, with a layer setup copied from source
|
||||
*/
|
||||
void DM_from_template(DerivedMesh *dm, DerivedMesh *source,
|
||||
DerivedMeshType type,
|
||||
int numVerts, int numEdges, int numFaces,
|
||||
int numLoops, int numPolys);
|
||||
DerivedMeshType type,
|
||||
int numVerts, int numEdges, int numFaces,
|
||||
int numLoops, int numPolys);
|
||||
|
||||
/* utility function to release a DerivedMesh's layers
|
||||
* returns 1 if DerivedMesh has to be released by the backend, 0 otherwise
|
||||
@ -518,15 +518,15 @@ void DM_set_tessface_data(struct DerivedMesh *dm, int index, int type, void *dat
|
||||
* these copy all layers for which the CD_FLAG_NOCOPY flag is not set
|
||||
*/
|
||||
void DM_copy_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
void DM_copy_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
void DM_copy_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
void DM_copy_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
void DM_copy_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
void DM_copy_loop_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
void DM_copy_poly_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int source_index, int dest_index, int count);
|
||||
int source_index, int dest_index, int count);
|
||||
|
||||
/* custom data free functions
|
||||
* free count elements, starting at index
|
||||
@ -550,8 +550,8 @@ void DM_update_tessface_data(DerivedMesh *dm);
|
||||
* indexed by dest_index in the dest mesh
|
||||
*/
|
||||
void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int *src_indices, float *weights,
|
||||
int count, int dest_index);
|
||||
int *src_indices, float *weights,
|
||||
int count, int dest_index);
|
||||
|
||||
/* interpolates edge data from the edges indexed by src_indices in the
|
||||
* source mesh using the given weights and stores the result in the edge indexed
|
||||
@ -562,9 +562,9 @@ void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
*/
|
||||
typedef float EdgeVertWeight[SUB_ELEMS_EDGE][SUB_ELEMS_EDGE];
|
||||
void DM_interp_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int *src_indices,
|
||||
float *weights, EdgeVertWeight *vert_weights,
|
||||
int count, int dest_index);
|
||||
int *src_indices,
|
||||
float *weights, EdgeVertWeight *vert_weights,
|
||||
int count, int dest_index);
|
||||
|
||||
/* interpolates face data from the faces indexed by src_indices in the
|
||||
* source mesh using the given weights and stores the result in the face indexed
|
||||
@ -575,9 +575,9 @@ void DM_interp_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
*/
|
||||
typedef float FaceVertWeight[SUB_ELEMS_FACE][SUB_ELEMS_FACE];
|
||||
void DM_interp_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest,
|
||||
int *src_indices,
|
||||
float *weights, FaceVertWeight *vert_weights,
|
||||
int count, int dest_index);
|
||||
int *src_indices,
|
||||
float *weights, FaceVertWeight *vert_weights,
|
||||
int count, int dest_index);
|
||||
|
||||
void DM_swap_tessface_data(struct DerivedMesh *dm, int index, const int *corner_indices);
|
||||
|
||||
@ -597,54 +597,54 @@ void vDM_ColorBand_store(struct ColorBand *coba);
|
||||
* In use now by vertex/weight paint and particles */
|
||||
float *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob);
|
||||
|
||||
/* */
|
||||
/* */
|
||||
DerivedMesh *mesh_get_derived_final(struct Scene *scene, struct Object *ob,
|
||||
CustomDataMask dataMask);
|
||||
CustomDataMask dataMask);
|
||||
DerivedMesh *mesh_get_derived_deform(struct Scene *scene, struct Object *ob,
|
||||
CustomDataMask dataMask);
|
||||
CustomDataMask dataMask);
|
||||
|
||||
DerivedMesh *mesh_create_derived_for_modifier(struct Scene *scene, struct Object *ob,
|
||||
struct ModifierData *md, int build_shapekey_layers);
|
||||
struct ModifierData *md, int build_shapekey_layers);
|
||||
|
||||
DerivedMesh *mesh_create_derived_render(struct Scene *scene, struct Object *ob,
|
||||
CustomDataMask dataMask);
|
||||
CustomDataMask dataMask);
|
||||
|
||||
DerivedMesh *getEditDerivedBMesh(struct BMEditMesh *em, struct Object *ob,
|
||||
float (*vertexCos)[3]);
|
||||
float (*vertexCos)[3]);
|
||||
|
||||
DerivedMesh *mesh_create_derived_index_render(struct Scene *scene, struct Object *ob, CustomDataMask dataMask, int index);
|
||||
|
||||
/* same as above but wont use render settings */
|
||||
/* same as above but wont use render settings */
|
||||
DerivedMesh *mesh_create_derived(struct Mesh *me, struct Object *ob, float (*vertCos)[3]);
|
||||
DerivedMesh *mesh_create_derived_view(struct Scene *scene, struct Object *ob,
|
||||
CustomDataMask dataMask);
|
||||
CustomDataMask dataMask);
|
||||
DerivedMesh *mesh_create_derived_no_deform(struct Scene *scene, struct Object *ob,
|
||||
float (*vertCos)[3],
|
||||
CustomDataMask dataMask);
|
||||
float (*vertCos)[3],
|
||||
CustomDataMask dataMask);
|
||||
DerivedMesh *mesh_create_derived_no_deform_render(struct Scene *scene, struct Object *ob,
|
||||
float (*vertCos)[3],
|
||||
CustomDataMask dataMask);
|
||||
float (*vertCos)[3],
|
||||
CustomDataMask dataMask);
|
||||
/* for gameengine */
|
||||
DerivedMesh *mesh_create_derived_no_virtual(struct Scene *scene, struct Object *ob, float (*vertCos)[3],
|
||||
CustomDataMask dataMask);
|
||||
CustomDataMask dataMask);
|
||||
DerivedMesh *mesh_create_derived_physics(struct Scene *scene, struct Object *ob, float (*vertCos)[3],
|
||||
CustomDataMask dataMask);
|
||||
CustomDataMask dataMask);
|
||||
|
||||
DerivedMesh *editbmesh_get_derived_base(struct Object *, struct BMEditMesh *em);
|
||||
DerivedMesh *editbmesh_get_derived_cage(struct Scene *scene, struct Object *,
|
||||
struct BMEditMesh *em, CustomDataMask dataMask);
|
||||
struct BMEditMesh *em, CustomDataMask dataMask);
|
||||
DerivedMesh *editbmesh_get_derived_cage_and_final(struct Scene *scene, struct Object *,
|
||||
struct BMEditMesh *em, DerivedMesh **final_r,
|
||||
CustomDataMask dataMask);
|
||||
struct BMEditMesh *em, DerivedMesh **final_r,
|
||||
CustomDataMask dataMask);
|
||||
float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *numVerts_r))[3];
|
||||
int editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, DerivedMesh *dm);
|
||||
void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct BMEditMesh *em,
|
||||
CustomDataMask dataMask, int build_shapekey_layers);
|
||||
CustomDataMask dataMask, int build_shapekey_layers);
|
||||
|
||||
/* returns an array of deform matrices for crazyspace correction, and the
|
||||
* number of modifiers left */
|
||||
int editbmesh_get_first_deform_matrices(struct Scene *, struct Object *, struct BMEditMesh *em,
|
||||
float (**deformmats)[3][3], float (**deformcos)[3]);
|
||||
float (**deformmats)[3][3], float (**deformcos)[3]);
|
||||
|
||||
void weight_to_rgb(float r_rgb[3], const float weight);
|
||||
/* Update the weight MCOL preview layer.
|
||||
@ -684,7 +684,7 @@ typedef struct DMVertexAttribs {
|
||||
} DMVertexAttribs;
|
||||
|
||||
void DM_vertex_attributes_from_gpu(DerivedMesh *dm,
|
||||
struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs);
|
||||
struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs);
|
||||
|
||||
void DM_add_tangent_layer(DerivedMesh *dm);
|
||||
void DM_calc_auto_bump_scale(DerivedMesh *dm);
|
||||
|
@ -71,24 +71,24 @@ void BKE_action_make_local(struct bAction *act);
|
||||
/* Action API ----------------- */
|
||||
|
||||
/* types of transforms applied to the given item
|
||||
* - these are the return falgs for action_get_item_transforms()
|
||||
* - these are the return falgs for action_get_item_transforms()
|
||||
*/
|
||||
typedef enum eAction_TransformFlags {
|
||||
/* location */
|
||||
ACT_TRANS_LOC = (1<<0),
|
||||
/* rotation */
|
||||
ACT_TRANS_ROT = (1<<1),
|
||||
/* scaling */
|
||||
ACT_TRANS_SCALE = (1<<2),
|
||||
|
||||
/* strictly not a transform, but custom properties are also
|
||||
* quite often used in modern rigs
|
||||
*/
|
||||
ACT_TRANS_PROP = (1<<3),
|
||||
|
||||
/* all flags */
|
||||
ACT_TRANS_ONLY = (ACT_TRANS_LOC|ACT_TRANS_ROT|ACT_TRANS_SCALE),
|
||||
ACT_TRANS_ALL = (ACT_TRANS_ONLY|ACT_TRANS_PROP)
|
||||
/* location */
|
||||
ACT_TRANS_LOC = (1 << 0),
|
||||
/* rotation */
|
||||
ACT_TRANS_ROT = (1 << 1),
|
||||
/* scaling */
|
||||
ACT_TRANS_SCALE = (1 << 2),
|
||||
|
||||
/* strictly not a transform, but custom properties are also
|
||||
* quite often used in modern rigs
|
||||
*/
|
||||
ACT_TRANS_PROP = (1 << 3),
|
||||
|
||||
/* all flags */
|
||||
ACT_TRANS_ONLY = (ACT_TRANS_LOC | ACT_TRANS_ROT | ACT_TRANS_SCALE),
|
||||
ACT_TRANS_ALL = (ACT_TRANS_ONLY | ACT_TRANS_PROP)
|
||||
} eAction_TransformFlags;
|
||||
|
||||
/* Return flags indicating which transforms the given object/posechannel has
|
||||
@ -182,7 +182,7 @@ struct bPoseChannel *BKE_pose_channel_active(struct Object *ob);
|
||||
* already exists in this pose - if not a new one is
|
||||
* allocated and initialized.
|
||||
*/
|
||||
struct bPoseChannel *BKE_pose_channel_verify(struct bPose* pose, const char* name);
|
||||
struct bPoseChannel *BKE_pose_channel_verify(struct bPose *pose, const char *name);
|
||||
|
||||
/* Copy the data from the action-pose (src) into the pose */
|
||||
void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);
|
||||
|
@ -46,28 +46,26 @@ struct Mesh;
|
||||
struct PoseTree;
|
||||
struct ListBase;
|
||||
|
||||
typedef struct PoseTarget
|
||||
{
|
||||
typedef struct PoseTarget {
|
||||
struct PoseTarget *next, *prev;
|
||||
|
||||
struct bConstraint *con; /* the constrait of this target */
|
||||
int tip; /* index of tip pchan in PoseTree */
|
||||
struct bConstraint *con; /* the constrait of this target */
|
||||
int tip; /* index of tip pchan in PoseTree */
|
||||
} PoseTarget;
|
||||
|
||||
typedef struct PoseTree
|
||||
{
|
||||
typedef struct PoseTree {
|
||||
struct PoseTree *next, *prev;
|
||||
|
||||
int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */
|
||||
int totchannel; /* number of pose channels */
|
||||
int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */
|
||||
int totchannel; /* number of pose channels */
|
||||
|
||||
struct ListBase targets; /* list of targets of the tree */
|
||||
struct bPoseChannel **pchan; /* array of pose channels */
|
||||
int *parent; /* and their parents */
|
||||
|
||||
float (*basis_change)[3][3]; /* basis change result from solver */
|
||||
int iterations; /* iterations from the constraint */
|
||||
int stretch; /* disable stretching */
|
||||
struct ListBase targets; /* list of targets of the tree */
|
||||
struct bPoseChannel **pchan; /* array of pose channels */
|
||||
int *parent; /* and their parents */
|
||||
|
||||
float (*basis_change)[3][3]; /* basis change result from solver */
|
||||
int iterations; /* iterations from the constraint */
|
||||
int stretch; /* disable stretching */
|
||||
} PoseTree;
|
||||
|
||||
/* Core armature functionality */
|
||||
@ -77,7 +75,7 @@ extern "C" {
|
||||
|
||||
struct bArmature *BKE_armature_add(const char *name);
|
||||
struct bArmature *BKE_armature_from_object(struct Object *ob);
|
||||
void BKE_armature_bonelist_free (struct ListBase *lb);
|
||||
void BKE_armature_bonelist_free(struct ListBase *lb);
|
||||
void BKE_armature_free(struct bArmature *arm);
|
||||
void BKE_armature_make_local(struct bArmature *arm);
|
||||
struct bArmature *BKE_armature_copy(struct bArmature *arm);
|
||||
@ -85,9 +83,9 @@ struct bArmature *BKE_armature_copy(struct bArmature *arm);
|
||||
/* Bounding box. */
|
||||
struct BoundBox *BKE_armature_boundbox_get(struct Object *ob);
|
||||
|
||||
int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail);
|
||||
int bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail);
|
||||
|
||||
struct Bone *BKE_armature_find_bone_name (struct bArmature *arm, const char *name);
|
||||
struct Bone *BKE_armature_find_bone_name(struct bArmature *arm, const char *name);
|
||||
|
||||
float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist);
|
||||
|
||||
@ -99,7 +97,7 @@ void BKE_pose_where_is_bone(struct Scene *scene, struct Object *ob, struct bPose
|
||||
void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan);
|
||||
|
||||
/* get_objectspace_bone_matrix has to be removed still */
|
||||
void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed);
|
||||
void get_objectspace_bone_matrix(struct Bone *bone, float M_accumulatedMatrix[][4], int root, int posed);
|
||||
void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3]);
|
||||
void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
|
||||
|
||||
|
@ -41,17 +41,17 @@ extern "C" {
|
||||
/* these lines are grep'd, watch out for our not-so-awesome regex
|
||||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 263
|
||||
#define BLENDER_SUBVERSION 5
|
||||
#define BLENDER_VERSION 263
|
||||
#define BLENDER_SUBVERSION 5
|
||||
|
||||
#define BLENDER_MINVERSION 250
|
||||
#define BLENDER_MINSUBVERSION 0
|
||||
#define BLENDER_MINVERSION 250
|
||||
#define BLENDER_MINSUBVERSION 0
|
||||
|
||||
/* used by packaging tools */
|
||||
/* can be left blank, otherwise a,b,c... etc with no quotes */
|
||||
/* can be left blank, otherwise a,b,c... etc with no quotes */
|
||||
#define BLENDER_VERSION_CHAR
|
||||
/* alpha/beta/rc/release, docs use this */
|
||||
#define BLENDER_VERSION_CYCLE alpha
|
||||
/* alpha/beta/rc/release, docs use this */
|
||||
#define BLENDER_VERSION_CYCLE alpha
|
||||
|
||||
extern char versionstr[]; /* from blender.c */
|
||||
|
||||
@ -64,11 +64,11 @@ struct Main;
|
||||
|
||||
int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *reports);
|
||||
|
||||
#define BKE_READ_FILE_FAIL 0 /* no load */
|
||||
#define BKE_READ_FILE_OK 1 /* OK */
|
||||
#define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */
|
||||
#define BKE_READ_FILE_FAIL 0 /* no load */
|
||||
#define BKE_READ_FILE_OK 1 /* OK */
|
||||
#define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */
|
||||
|
||||
int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, struct ReportList *reports);
|
||||
int BKE_read_file_from_memory(struct bContext *C, char *filebuf, int filelength, struct ReportList *reports);
|
||||
int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports);
|
||||
|
||||
void free_blender(void);
|
||||
|
@ -42,28 +42,28 @@
|
||||
|
||||
/* bevel tool defines */
|
||||
/* element flags */
|
||||
#define BME_BEVEL_ORIG 1
|
||||
#define BME_BEVEL_BEVEL (1<<1)
|
||||
#define BME_BEVEL_NONMAN (1<<2)
|
||||
#define BME_BEVEL_WIRE (1<<3)
|
||||
#define BME_BEVEL_ORIG 1
|
||||
#define BME_BEVEL_BEVEL (1 << 1)
|
||||
#define BME_BEVEL_NONMAN (1 << 2)
|
||||
#define BME_BEVEL_WIRE (1 << 3)
|
||||
|
||||
/* tool options */
|
||||
#define BME_BEVEL_SELECT 1
|
||||
#define BME_BEVEL_VERT (1<<1)
|
||||
#define BME_BEVEL_RADIUS (1<<2)
|
||||
#define BME_BEVEL_ANGLE (1<<3)
|
||||
#define BME_BEVEL_WEIGHT (1<<4)
|
||||
#define BME_BEVEL_SELECT 1
|
||||
#define BME_BEVEL_VERT (1 << 1)
|
||||
#define BME_BEVEL_RADIUS (1 << 2)
|
||||
#define BME_BEVEL_ANGLE (1 << 3)
|
||||
#define BME_BEVEL_WEIGHT (1 << 4)
|
||||
//~ #define BME_BEVEL_EWEIGHT (1<<4)
|
||||
//~ #define BME_BEVEL_VWEIGHT (1<<5)
|
||||
#define BME_BEVEL_PERCENT (1<<6)
|
||||
#define BME_BEVEL_EMIN (1<<7)
|
||||
#define BME_BEVEL_EMAX (1<<8)
|
||||
#define BME_BEVEL_RUNNING (1<<9)
|
||||
#define BME_BEVEL_RES (1<<10)
|
||||
#define BME_BEVEL_PERCENT (1 << 6)
|
||||
#define BME_BEVEL_EMIN (1 << 7)
|
||||
#define BME_BEVEL_EMAX (1 << 8)
|
||||
#define BME_BEVEL_RUNNING (1 << 9)
|
||||
#define BME_BEVEL_RES (1 << 10)
|
||||
|
||||
#define BME_BEVEL_EVEN (1<<11) /* this is a new setting not related to old (trunk bmesh bevel code) but adding
|
||||
* here because they are mixed - campbell */
|
||||
#define BME_BEVEL_DIST (1<<12) /* same as above */
|
||||
#define BME_BEVEL_EVEN (1 << 11) /* this is a new setting not related to old (trunk bmesh bevel code) but adding
|
||||
* here because they are mixed - campbell */
|
||||
#define BME_BEVEL_DIST (1 << 12) /* same as above */
|
||||
|
||||
typedef struct BME_TransData {
|
||||
struct BMesh *bm; /* the bmesh the vert belongs to */
|
||||
@ -74,11 +74,11 @@ typedef struct BME_TransData {
|
||||
void *loc; /* a pointer to the data to transform (likely the vert's cos) */
|
||||
float factor; /* primary scaling factor; also accumulates number of weighted edges for beveling tool */
|
||||
float weight; /* another scaling factor; used primarily for propogating vertex weights to transforms; */
|
||||
/* weight is also used across recursive bevels to help with the math */
|
||||
/* weight is also used across recursive bevels to help with the math */
|
||||
float maxfactor; /* the unscaled, original factor (used only by "edge verts" in recursive beveling) */
|
||||
float *max; /* the maximum distance this vert can be transformed; negative is infinite
|
||||
* it points to the "parent" maxfactor (where maxfactor makes little sense)
|
||||
* where the max limit is stored (limits are stored per-corner) */
|
||||
* it points to the "parent" maxfactor (where maxfactor makes little sense)
|
||||
* where the max limit is stored (limits are stored per-corner) */
|
||||
} BME_TransData;
|
||||
|
||||
typedef struct BME_TransData_Head {
|
||||
|
@ -41,14 +41,14 @@ struct bmGlyph;
|
||||
struct ImBuf;
|
||||
struct bmFont;
|
||||
|
||||
void printfGlyph(struct bmGlyph * glyph);
|
||||
void calcAlpha(struct ImBuf * ibuf);
|
||||
void readBitmapFontVersion0(struct ImBuf * ibuf,
|
||||
unsigned char * rect,
|
||||
void printfGlyph(struct bmGlyph *glyph);
|
||||
void calcAlpha(struct ImBuf *ibuf);
|
||||
void readBitmapFontVersion0(struct ImBuf *ibuf,
|
||||
unsigned char *rect,
|
||||
int step);
|
||||
void detectBitmapFont(struct ImBuf *ibuf);
|
||||
int locateGlyph(struct bmFont *bmfont, unsigned short unicode);
|
||||
void matrixGlyph(struct ImBuf * ibuf, unsigned short unicode,
|
||||
void matrixGlyph(struct ImBuf *ibuf, unsigned short unicode,
|
||||
float *centerx, float *centery,
|
||||
float *sizex, float *sizey,
|
||||
float *transx, float *transy,
|
||||
|
@ -53,12 +53,9 @@ typedef struct CSG_MeshDescriptor {
|
||||
} CSG_MeshDescriptor;
|
||||
|
||||
|
||||
extern
|
||||
int
|
||||
CSG_LoadBlenderMesh(
|
||||
struct Object * obj,
|
||||
CSG_MeshDescriptor *output
|
||||
);
|
||||
extern int
|
||||
CSG_LoadBlenderMesh(struct Object *obj,
|
||||
CSG_MeshDescriptor *output);
|
||||
|
||||
/**
|
||||
* Destroy the contents of a mesh descriptor.
|
||||
@ -67,11 +64,8 @@ CSG_LoadBlenderMesh(
|
||||
* internal memory in the desriptor.
|
||||
*/
|
||||
|
||||
extern
|
||||
void
|
||||
CSG_DestroyMeshDescriptor(
|
||||
CSG_MeshDescriptor *mesh
|
||||
);
|
||||
extern void
|
||||
CSG_DestroyMeshDescriptor(CSG_MeshDescriptor *mesh);
|
||||
|
||||
/**
|
||||
* Perform a boolean operation between 2 meshes and return the
|
||||
@ -82,14 +76,11 @@ CSG_DestroyMeshDescriptor(
|
||||
* 3 = difference.
|
||||
*/
|
||||
|
||||
extern
|
||||
int
|
||||
CSG_PerformOp(
|
||||
CSG_MeshDescriptor *mesh1,
|
||||
CSG_MeshDescriptor *mesh2,
|
||||
int op_type,
|
||||
CSG_MeshDescriptor *output
|
||||
);
|
||||
extern int
|
||||
CSG_PerformOp(CSG_MeshDescriptor *mesh1,
|
||||
CSG_MeshDescriptor *mesh2,
|
||||
int op_type,
|
||||
CSG_MeshDescriptor *output);
|
||||
|
||||
|
||||
|
||||
@ -97,23 +88,17 @@ CSG_PerformOp(
|
||||
* Add a mesh to blender as a new object.
|
||||
*/
|
||||
|
||||
extern
|
||||
int
|
||||
CSG_AddMeshToBlender(
|
||||
CSG_MeshDescriptor *mesh
|
||||
);
|
||||
extern int
|
||||
CSG_AddMeshToBlender(CSG_MeshDescriptor *mesh);
|
||||
|
||||
/**
|
||||
* Test functionality.
|
||||
*/
|
||||
|
||||
extern
|
||||
int
|
||||
NewBooleanMeshTest(
|
||||
struct Base * base,
|
||||
struct Base * base_select,
|
||||
int op_type
|
||||
);
|
||||
extern int
|
||||
NewBooleanMeshTest(struct Base *base,
|
||||
struct Base *base_select,
|
||||
int op_type);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -59,17 +59,17 @@ int BKE_brush_clone_image_delete(struct Brush *brush);
|
||||
|
||||
/* jitter */
|
||||
void BKE_brush_jitter_pos(const struct Scene *scene, struct Brush *brush,
|
||||
const float pos[2], float jitterpos[2]);
|
||||
const float pos[2], float jitterpos[2]);
|
||||
|
||||
/* brush curve */
|
||||
void BKE_brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset);
|
||||
void BKE_brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/ int preset);
|
||||
float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len);
|
||||
float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
|
||||
|
||||
/* sampling */
|
||||
void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread);
|
||||
void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size,
|
||||
struct ImBuf **imbuf, int use_color_correction);
|
||||
struct ImBuf **imbuf, int use_color_correction);
|
||||
|
||||
/* painting */
|
||||
struct BrushPainter;
|
||||
@ -78,9 +78,9 @@ typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, const float lastpos[2],
|
||||
|
||||
BrushPainter *BKE_brush_painter_new(struct Scene *scene, struct Brush *brush);
|
||||
void BKE_brush_painter_require_imbuf(BrushPainter *painter, short flt,
|
||||
short texonly, int size);
|
||||
short texonly, int size);
|
||||
int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2],
|
||||
double time, float pressure, void *user, int use_color_correction);
|
||||
double time, float pressure, void *user, int use_color_correction);
|
||||
void BKE_brush_painter_break_stroke(BrushPainter *painter);
|
||||
void BKE_brush_painter_free(BrushPainter *painter);
|
||||
|
||||
@ -108,13 +108,13 @@ int BKE_brush_use_size_pressure(const struct Scene *scene, struct Brush *brush)
|
||||
|
||||
/* scale unprojected radius to reflect a change in the brush's 2D size */
|
||||
void BKE_brush_scale_unprojected_radius(float *unprojected_radius,
|
||||
int new_brush_size,
|
||||
int old_brush_size);
|
||||
int new_brush_size,
|
||||
int old_brush_size);
|
||||
|
||||
/* scale brush size to reflect a change in the brush's unprojected radius */
|
||||
void BKE_brush_scale_size(int *BKE_brush_size_get,
|
||||
float new_unprojected_radius,
|
||||
float old_unprojected_radius);
|
||||
float new_unprojected_radius,
|
||||
float old_unprojected_radius);
|
||||
|
||||
/* debugging only */
|
||||
void BKE_brush_debug_print_state(struct Brush *br);
|
||||
|
@ -38,7 +38,7 @@ struct BulletSoftBody;
|
||||
extern struct BulletSoftBody *bsbNew(void);
|
||||
|
||||
/* frees internal data and softbody itself */
|
||||
extern void bsbFree(struct BulletSoftBody *sb);
|
||||
extern void bsbFree(struct BulletSoftBody *sb);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -44,20 +44,19 @@ struct MFace;
|
||||
/*
|
||||
* struct that kepts basic information about a BVHTree build from a mesh
|
||||
*/
|
||||
typedef struct BVHTreeFromMesh
|
||||
{
|
||||
typedef struct BVHTreeFromMesh {
|
||||
struct BVHTree *tree;
|
||||
|
||||
/* default callbacks to bvh nearest and raycast */
|
||||
BVHTree_NearestPointCallback nearest_callback;
|
||||
BVHTree_RayCastCallback raycast_callback;
|
||||
BVHTree_RayCastCallback raycast_callback;
|
||||
|
||||
/* Mesh represented on this BVHTree */
|
||||
struct DerivedMesh *mesh;
|
||||
|
||||
/* Vertex array, so that callbacks have instante access to data */
|
||||
struct MVert *vert;
|
||||
struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */
|
||||
struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */
|
||||
struct MFace *face;
|
||||
|
||||
/* radius for raycast */
|
||||
@ -65,7 +64,7 @@ typedef struct BVHTreeFromMesh
|
||||
|
||||
/* Private data */
|
||||
int cached;
|
||||
void *em_evil; /* var only for snapping */
|
||||
void *em_evil; /* var only for snapping */
|
||||
|
||||
} BVHTreeFromMesh;
|
||||
|
||||
@ -80,7 +79,7 @@ typedef struct BVHTreeFromMesh
|
||||
*
|
||||
* free_bvhtree_from_mesh should be called when the tree is no longer needed.
|
||||
*/
|
||||
BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
|
||||
BVHTree *bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
|
||||
|
||||
/*
|
||||
* Builds a bvh tree where nodes are the faces of the given mesh.
|
||||
@ -96,9 +95,9 @@ BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMes
|
||||
*
|
||||
* free_bvhtree_from_mesh should be called when the tree is no longer needed.
|
||||
*/
|
||||
BVHTree* bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
|
||||
BVHTree *bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
|
||||
|
||||
BVHTree* bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
|
||||
BVHTree *bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
|
||||
|
||||
/*
|
||||
* Frees data allocated by a call to bvhtree_from_mesh_*.
|
||||
@ -116,11 +115,11 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f
|
||||
*/
|
||||
|
||||
//Using local coordinates
|
||||
#define BVHTREE_FROM_FACES 0
|
||||
#define BVHTREE_FROM_VERTICES 1
|
||||
#define BVHTREE_FROM_EDGES 2
|
||||
#define BVHTREE_FROM_FACES 0
|
||||
#define BVHTREE_FROM_VERTICES 1
|
||||
#define BVHTREE_FROM_EDGES 2
|
||||
|
||||
typedef struct LinkNode* BVHCache;
|
||||
typedef struct LinkNode *BVHCache;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -112,13 +112,12 @@ void BKE_camera_params_compute_matrix(CameraParams *params);
|
||||
/* Camera View Frame */
|
||||
|
||||
void BKE_camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
|
||||
float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]);
|
||||
float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]);
|
||||
|
||||
void BKE_camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
|
||||
|
||||
int BKE_camera_view_frame_fit_to_scene(
|
||||
struct Scene *scene, struct View3D *v3d, struct Object *camera_ob,
|
||||
float r_co[3]);
|
||||
int BKE_camera_view_frame_fit_to_scene(struct Scene *scene, struct View3D *v3d, struct Object *camera_ob,
|
||||
float r_co[3]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -38,19 +38,19 @@
|
||||
struct CCGSubSurf;
|
||||
|
||||
/* Each CCGElem is CCGSubSurf's representation of a subdivided
|
||||
vertex. All CCGElems in a particular CCGSubSurf have the same
|
||||
layout, but the layout can vary from one CCGSubSurf to another. For
|
||||
this reason, CCGElem is presented as an opaque pointer, and
|
||||
elements should always be accompanied by a CCGKey, which provides
|
||||
the necessary offsets to access components of a CCGElem.
|
||||
*/
|
||||
* vertex. All CCGElems in a particular CCGSubSurf have the same
|
||||
* layout, but the layout can vary from one CCGSubSurf to another. For
|
||||
* this reason, CCGElem is presented as an opaque pointer, and
|
||||
* elements should always be accompanied by a CCGKey, which provides
|
||||
* the necessary offsets to access components of a CCGElem.
|
||||
*/
|
||||
typedef struct CCGElem CCGElem;
|
||||
|
||||
typedef struct CCGKey {
|
||||
int level;
|
||||
|
||||
/* number of bytes in each element (one float per layer, plus
|
||||
three floats for normals if enabled) */
|
||||
* three floats for normals if enabled) */
|
||||
int elem_size;
|
||||
|
||||
/* number of elements along each side of grid */
|
||||
@ -61,11 +61,11 @@ typedef struct CCGKey {
|
||||
int grid_bytes;
|
||||
|
||||
/* currently always the last three floats, unless normals are
|
||||
disabled */
|
||||
* disabled */
|
||||
int normal_offset;
|
||||
|
||||
/* offset in bytes of mask value; only valid if 'has_mask' is
|
||||
true */
|
||||
* true */
|
||||
int mask_offset;
|
||||
|
||||
int num_layers;
|
||||
@ -104,24 +104,24 @@ BLI_INLINE CCGElem *CCG_elem_next(const CCGKey *key, CCGElem *elem);
|
||||
|
||||
BLI_INLINE float *CCG_elem_co(const CCGKey *UNUSED(key), CCGElem *elem)
|
||||
{
|
||||
return (float*)elem;
|
||||
return (float *)elem;
|
||||
}
|
||||
|
||||
BLI_INLINE float *CCG_elem_no(const CCGKey *key, CCGElem *elem)
|
||||
{
|
||||
BLI_assert(key->has_normals);
|
||||
return (float*)((char*)elem + key->normal_offset);
|
||||
return (float *)((char *)elem + key->normal_offset);
|
||||
}
|
||||
|
||||
BLI_INLINE float *CCG_elem_mask(const CCGKey *key, CCGElem *elem)
|
||||
{
|
||||
BLI_assert(key->has_mask);
|
||||
return (float*)((char*)elem + (key->mask_offset));
|
||||
return (float *)((char *)elem + (key->mask_offset));
|
||||
}
|
||||
|
||||
BLI_INLINE CCGElem *CCG_elem_offset(const CCGKey *key, CCGElem *elem, int offset)
|
||||
{
|
||||
return (CCGElem*)(((char*)elem) + key->elem_size * offset);
|
||||
return (CCGElem *)(((char *)elem) + key->elem_size * offset);
|
||||
}
|
||||
|
||||
BLI_INLINE CCGElem *CCG_grid_elem(const CCGKey *key, CCGElem *elem, int x, int y)
|
||||
|
@ -79,11 +79,11 @@ struct DerivedMesh *CDDM_copy_from_tessface(struct DerivedMesh *dm);
|
||||
* elements are initialized to all zeros
|
||||
*/
|
||||
struct DerivedMesh *CDDM_from_template(struct DerivedMesh *source,
|
||||
int numVerts, int numEdges, int numFaces,
|
||||
int numLoops, int numPolys);
|
||||
int numVerts, int numEdges, int numFaces,
|
||||
int numLoops, int numPolys);
|
||||
|
||||
/*converts mfaces to mpolys. note things may break if there are not valid
|
||||
*medges surrounding each mface.
|
||||
/* converts mfaces to mpolys. note things may break if there are not valid
|
||||
* medges surrounding each mface.
|
||||
*/
|
||||
void CDDM_tessfaces_to_faces(struct DerivedMesh *dm);
|
||||
|
||||
|
@ -61,10 +61,10 @@ struct LinkNode;
|
||||
/* COLLISION FLAGS */
|
||||
typedef enum
|
||||
{
|
||||
COLLISION_IN_FUTURE = (1 << 1),
|
||||
COLLISION_IN_FUTURE = (1 << 1),
|
||||
#ifdef WITH_ELTOPO
|
||||
COLLISION_USE_COLLFACE = (1 << 2),
|
||||
COLLISION_IS_EDGES = (1 << 3),
|
||||
COLLISION_USE_COLLFACE = (1 << 2),
|
||||
COLLISION_IS_EDGES = (1 << 3),
|
||||
#endif
|
||||
} COLLISION_FLAGS;
|
||||
|
||||
@ -73,8 +73,7 @@ typedef enum
|
||||
// used for collisions in collision.c
|
||||
////////////////////////////////////////
|
||||
/* used for collisions in collision.c */
|
||||
typedef struct CollPair
|
||||
{
|
||||
typedef struct CollPair {
|
||||
unsigned int face1; // cloth face
|
||||
unsigned int face2; // object face
|
||||
double distance; // magnitude of vector
|
||||
@ -95,8 +94,7 @@ typedef struct CollPair
|
||||
CollPair;
|
||||
|
||||
/* used for collisions in collision.c */
|
||||
typedef struct EdgeCollPair
|
||||
{
|
||||
typedef struct EdgeCollPair {
|
||||
unsigned int p11, p12, p21, p22;
|
||||
float normal[3];
|
||||
float vector[3];
|
||||
@ -107,8 +105,7 @@ typedef struct EdgeCollPair
|
||||
EdgeCollPair;
|
||||
|
||||
/* used for collisions in collision.c */
|
||||
typedef struct FaceCollPair
|
||||
{
|
||||
typedef struct FaceCollPair {
|
||||
unsigned int p11, p12, p13, p21;
|
||||
float normal[3];
|
||||
float vector[3];
|
||||
@ -130,8 +127,8 @@ FaceCollPair;
|
||||
// used in modifier.c from collision.c
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
BVHTree *bvhtree_build_from_mvert(struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon );
|
||||
void bvhtree_update_from_mvert(BVHTree * bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving );
|
||||
BVHTree *bvhtree_build_from_mvert(struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon);
|
||||
void bvhtree_update_from_mvert(BVHTree *bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving);
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
|
@ -33,48 +33,51 @@
|
||||
|
||||
struct CurveMapping;
|
||||
struct CurveMap;
|
||||
struct CurveMapPoint;
|
||||
struct Scopes;
|
||||
struct ImBuf;
|
||||
struct rctf;
|
||||
|
||||
#if defined _WIN32
|
||||
# define DO_INLINE __inline
|
||||
#elif defined (__sun) || defined (__sun__)
|
||||
#elif defined(__sun) || defined(__sun__)
|
||||
# define DO_INLINE
|
||||
#else
|
||||
# define DO_INLINE static inline
|
||||
#endif
|
||||
|
||||
struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
|
||||
void curvemapping_free(struct CurveMapping *cumap);
|
||||
struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap);
|
||||
void curvemapping_set_black_white(struct CurveMapping *cumap, const float black[3], const float white[3]);
|
||||
struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
|
||||
void curvemapping_free(struct CurveMapping *cumap);
|
||||
struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap);
|
||||
void curvemapping_set_black_white(struct CurveMapping *cumap, const float black[3], const float white[3]);
|
||||
|
||||
#define CURVEMAP_SLOPE_NEGATIVE 0
|
||||
#define CURVEMAP_SLOPE_POSITIVE 1
|
||||
void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope);
|
||||
void curvemap_remove(struct CurveMap *cuma, int flag);
|
||||
void curvemap_insert(struct CurveMap *cuma, float x, float y);
|
||||
void curvemap_sethandle(struct CurveMap *cuma, int type);
|
||||
#define CURVEMAP_SLOPE_NEGATIVE 0
|
||||
#define CURVEMAP_SLOPE_POSITIVE 1
|
||||
void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope);
|
||||
void curvemap_remove(struct CurveMap *cuma, int flag);
|
||||
void curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);
|
||||
struct CurveMapPoint *curvemap_insert(struct CurveMap *cuma, float x, float y);
|
||||
void curvemap_sethandle(struct CurveMap *cuma, int type);
|
||||
|
||||
void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
|
||||
|
||||
/* single curve, no table check */
|
||||
float curvemap_evaluateF(struct CurveMap *cuma, float value);
|
||||
/* single curve, with table check */
|
||||
float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value);
|
||||
void curvemapping_evaluate3F(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
||||
void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
||||
void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
||||
void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf);
|
||||
void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
|
||||
int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
|
||||
void curvemapping_initialize(struct CurveMapping *cumap);
|
||||
void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
|
||||
void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
|
||||
void curvemapping_changed_all(struct CurveMapping *cumap);
|
||||
|
||||
void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
|
||||
void scopes_free(struct Scopes *scopes);
|
||||
void scopes_new(struct Scopes *scopes);
|
||||
/* single curve, no table check */
|
||||
float curvemap_evaluateF(struct CurveMap *cuma, float value);
|
||||
/* single curve, with table check */
|
||||
float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value);
|
||||
void curvemapping_evaluate3F(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
||||
void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
||||
void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]);
|
||||
void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf);
|
||||
void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
|
||||
int curvemapping_RGBA_does_something(struct CurveMapping *cumap);
|
||||
void curvemapping_initialize(struct CurveMapping *cumap);
|
||||
void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
|
||||
|
||||
void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management);
|
||||
void scopes_free(struct Scopes *scopes);
|
||||
void scopes_new(struct Scopes *scopes);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -48,15 +48,15 @@ extern "C" {
|
||||
|
||||
/* special struct for use in constraint evaluation */
|
||||
typedef struct bConstraintOb {
|
||||
struct Scene *scene; /* for system time, part of deglobalization, code nicer later with local time (ton) */
|
||||
struct Object *ob; /* if pchan, then armature that it comes from, otherwise constraint owner */
|
||||
struct bPoseChannel *pchan; /* pose channel that owns the constraints being evaluated */
|
||||
struct Scene *scene; /* for system time, part of deglobalization, code nicer later with local time (ton) */
|
||||
struct Object *ob; /* if pchan, then armature that it comes from, otherwise constraint owner */
|
||||
struct bPoseChannel *pchan; /* pose channel that owns the constraints being evaluated */
|
||||
|
||||
float matrix[4][4]; /* matrix where constraints are accumulated + solved */
|
||||
float startmat[4][4]; /* original matrix (before constraint solving) */
|
||||
float matrix[4][4]; /* matrix where constraints are accumulated + solved */
|
||||
float startmat[4][4]; /* original matrix (before constraint solving) */
|
||||
|
||||
short type; /* type of owner */
|
||||
short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */
|
||||
short type; /* type of owner */
|
||||
short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */
|
||||
} bConstraintOb;
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
@ -79,31 +79,31 @@ typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, sh
|
||||
*/
|
||||
typedef struct bConstraintTypeInfo {
|
||||
/* admin/ident */
|
||||
short type; /* CONSTRAINT_TYPE_### */
|
||||
short size; /* size in bytes of the struct */
|
||||
char name[32]; /* name of constraint in interface */
|
||||
char structName[32]; /* name of struct for SDNA */
|
||||
short type; /* CONSTRAINT_TYPE_### */
|
||||
short size; /* size in bytes of the struct */
|
||||
char name[32]; /* name of constraint in interface */
|
||||
char structName[32]; /* name of struct for SDNA */
|
||||
|
||||
/* data management function pointers - special handling */
|
||||
/* free any data that is allocated separately (optional) */
|
||||
/* free any data that is allocated separately (optional) */
|
||||
void (*free_data)(struct bConstraint *con);
|
||||
/* run the provided callback function on all the ID-blocks linked to the constraint */
|
||||
/* run the provided callback function on all the ID-blocks linked to the constraint */
|
||||
void (*id_looper)(struct bConstraint *con, ConstraintIDFunc func, void *userdata);
|
||||
/* copy any special data that is allocated separately (optional) */
|
||||
/* copy any special data that is allocated separately (optional) */
|
||||
void (*copy_data)(struct bConstraint *con, struct bConstraint *src);
|
||||
/* set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */
|
||||
/* set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */
|
||||
void (*new_data)(void *cdata);
|
||||
|
||||
/* target handling function pointers */
|
||||
/* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */
|
||||
/* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */
|
||||
int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list);
|
||||
/* for single-target constraints only: flush data back to source data, and the free memory used */
|
||||
/* for single-target constraints only: flush data back to source data, and the free memory used */
|
||||
void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, short nocopy);
|
||||
|
||||
/* evaluation */
|
||||
/* set the ct->matrix for the given constraint target (at the given ctime) */
|
||||
/* set the ct->matrix for the given constraint target (at the given ctime) */
|
||||
void (*get_target_matrix)(struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime);
|
||||
/* evaluate the constraint for the given time */
|
||||
/* evaluate the constraint for the given time */
|
||||
void (*evaluate_constraint)(struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets);
|
||||
} bConstraintTypeInfo;
|
||||
|
||||
|
@ -72,7 +72,7 @@ struct bContextDataResult;
|
||||
typedef struct bContextDataResult bContextDataResult;
|
||||
|
||||
typedef int (*bContextDataCallback)(const bContext *C,
|
||||
const char *member, bContextDataResult *result);
|
||||
const char *member, bContextDataResult *result);
|
||||
|
||||
typedef struct bContextStoreEntry {
|
||||
struct bContextStoreEntry *next, *prev;
|
||||
@ -223,7 +223,7 @@ void CTX_data_list_add(bContextDataResult *result, void *data);
|
||||
BLI_freelistN(&ctx_data_list); \
|
||||
}
|
||||
|
||||
int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*));
|
||||
int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBase *));
|
||||
|
||||
#define CTX_DATA_COUNT(C, member) \
|
||||
ctx_data_list_count(C, CTX_data_##member)
|
||||
|
@ -43,15 +43,15 @@ struct Nurb;
|
||||
struct Object;
|
||||
struct Scene;
|
||||
|
||||
#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu-1) : 0) )
|
||||
#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv-1) : 0) )
|
||||
#define KNOTSU(nu) ( (nu)->orderu + (nu)->pntsu + (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu - 1) : 0) )
|
||||
#define KNOTSV(nu) ( (nu)->orderv + (nu)->pntsv + (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv - 1) : 0) )
|
||||
|
||||
/* Non cyclic nurbs have 1 less segment */
|
||||
#define SEGMENTSU(nu) ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 )
|
||||
#define SEGMENTSV(nu) ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 )
|
||||
#define SEGMENTSU(nu) ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu - 1)
|
||||
#define SEGMENTSV(nu) ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv - 1)
|
||||
|
||||
#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1)
|
||||
#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || ((cu)->flag & CU_PATH_RADIUS) || (cu)->bevobj || (cu)->ext1!=0.0f || (cu)->ext2!=0.0f) ? 1:0)
|
||||
#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D) == 0) ? 0 : 1)
|
||||
#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || ((cu)->flag & CU_PATH_RADIUS) || (cu)->bevobj || (cu)->ext1 != 0.0f || (cu)->ext2 != 0.0f) ? 1 : 0)
|
||||
|
||||
/* ** Curve ** */
|
||||
void BKE_curve_unlink(struct Curve *cu);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user