Merged changes in the trunk up to revision 50956.

Conflicts resolved:
source/blender/editors/interface/resources.c
This commit is contained in:
Tamito Kajiyama 2012-09-30 13:16:55 +00:00
commit e91f33101f
223 changed files with 1601 additions and 906 deletions

@ -120,7 +120,7 @@ option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default (recommend to leave off)" OFF)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distrobutions see this as a security issue, rather than have them patch it, make a build option.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
@ -371,7 +371,7 @@ if(WITH_CYCLES OR WITH_MOD_BOOLEAN)
set(WITH_BOOST ON)
endif()
# don't store paths to libs for portable distrobution
# don't store paths to libs for portable distribution
if(WITH_INSTALL_PORTABLE)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
endif()
@ -566,7 +566,7 @@ if(UNIX AND NOT APPLE)
mark_as_advanced(FFMPEG)
# lame, but until we have propper find module for ffmpeg
# lame, but until we have proper find module for ffmpeg
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include)
if(EXISTS "${FFMPEG}/include/ffmpeg/")
set(FFMPEG_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS} ${FFMPEG}/include/ffmpeg")
@ -647,7 +647,11 @@ if(UNIX AND NOT APPLE)
else()
set(Boost_USE_MULTITHREADED ON)
endif()
find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
if(WITH_CYCLES_OSL)
find_package(Boost 1.34 COMPONENTS filesystem python3 regex system thread) # osl_nodes uses boost_python
else()
find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
endif()
mark_as_advanced(Boost_DIR) # why doesnt boost do this?
endif()
@ -1079,9 +1083,17 @@ elseif(WIN32)
endif()
set(BOOST_LIBRARIES
optimized libboost_date_time-${BOOST_POSTFIX} optimized libboost_filesystem-${BOOST_POSTFIX}
optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
optimized libboost_regex-${BOOST_POSTFIX}
optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
debug libboost_regex-${BOOST_DEBUG_POSTFIX}
debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
if(WITH_CYCLES_OSL)
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
optimized libboost_python3-${BOOST_POSTFIX}
debug libboost_python3-${BOOST_DEBUG_POSTFIX})
endif(WITH_CYCLES_OSL)
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
endif()
@ -1097,7 +1109,7 @@ elseif(WIN32)
set(OPENCOLORIO ${LIBDIR}/opencolorio)
set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
set(OPENCOLORIO_LIBRARIES OpenColorIO)
set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib")
set(OPENCOLORIO_LIBPATH ${LIBDIR}/opencolorio/lib)
set(OPENCOLORIO_DEFINITIONS)
endif()
@ -1257,9 +1269,17 @@ elseif(WIN32)
endif()
set(BOOST_LIBRARIES
optimized boost_date_time-${BOOST_POSTFIX} boost_filesystem-${BOOST_POSTFIX}
boost_regex-${BOOST_POSTFIX} boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
boost_regex-${BOOST_POSTFIX}
boost_system-${BOOST_POSTFIX} boost_thread-${BOOST_POSTFIX}
debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX}
boost_regex-${BOOST_DEBUG_POSTFIX} boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
boost_regex-${BOOST_DEBUG_POSTFIX}
boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
if(WITH_CYCLES_OSL)
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
optimized libboost_python3-${BOOST_POSTFIX}
debug libboost_python3-${BOOST_DEBUG_POSTFIX})
endif(WITH_CYCLES_OSL)
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
endif()
@ -1283,7 +1303,7 @@ elseif(WIN32)
set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
## DISABLE - causes linking errors
## for re-distrobution, so users dont need mingw installed
## for re-distribution, so users dont need mingw installed
# set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-libgcc -static-libstdc++")
endif()
@ -1395,6 +1415,7 @@ elseif(APPLE)
if(WITH_IMAGE_OPENEXR)
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBRARIES Iex Half IlmImf Imath IlmThread)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
@ -1513,7 +1534,11 @@ elseif(APPLE)
if(WITH_BOOST)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
if(WITH_CYCLES_OSL)
set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_python3-mt boost_regex-mt boost_system-mt boost_thread-mt)
else(WITH_CYCLES_OSL)
set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
endif(WITH_CYCLES_OSL)
set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_DEFINITIONS)
endif()
@ -1521,7 +1546,7 @@ elseif(APPLE)
if(WITH_OPENIMAGEIO)
set(OPENIMAGEIO ${LIBDIR}/openimageio)
set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
set(OPENIMAGEIO_LIBRARIES OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
set(OPENIMAGEIO_LIBRARIES -force_load ${OPENIMAGEIO}/lib/libOpenImageIO.a ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
endif()
@ -1543,7 +1568,7 @@ elseif(APPLE)
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
# WARNING! depends on correct order of OSL libs linking
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
@ -1557,6 +1582,66 @@ elseif(APPLE)
endif()
include_directories(${OSL_INCLUDES})
# LLVM library setup, needed for osl
set(LLVM_DIRECTORY "${LIBDIR}/llvm")
set(LLVM_STATIC YES)
if (LLVM_DIRECTORY)
set (LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
else ()
set (LLVM_CONFIG llvm-config)
endif ()
execute_process (COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_DIRECTORY
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIB_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${LLVM_CONFIG} --includedir
OUTPUT_VARIABLE LLVM_INCLUDES
OUTPUT_STRIP_TRAILING_WHITESPACE)
find_library ( LLVM_LIBRARY
NAMES libLLVMAnalysis.a # first of a whole bunch of libs to get
PATHS ${LLVM_LIB_DIR})
message (STATUS "LLVM version = ${LLVM_VERSION}")
message (STATUS "LLVM dir = ${LLVM_DIRECTORY}")
message (STATUS "LLVM includes = ${LLVM_INCLUDES}")
message (STATUS "LLVM lib dir = ${LLVM_LIB_DIR}")
if (LLVM_LIBRARY AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
# ensure include directory is added (in case of non-standard locations
include_directories (BEFORE "${LLVM_INCLUDES}")
string (REGEX REPLACE "\\." "" OSL_LLVM_VERSION ${LLVM_VERSION})
message (STATUS "LLVM OSL_LLVM_VERSION = ${OSL_LLVM_VERSION}")
add_definitions ("-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION}")
if (LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
set (LLVM_LIBRARY "")
execute_process (COMMAND ${LLVM_CONFIG} --libs
OUTPUT_VARIABLE llvm_library_list
OUTPUT_STRIP_TRAILING_WHITESPACE)
string (REPLACE "-l" "" llvm_library_list ${llvm_library_list})
string (REPLACE " " ";" llvm_library_list ${llvm_library_list})
foreach (f ${llvm_library_list})
list (APPEND LLVM_LIBRARY "${LLVM_LIB_DIR}/lib${f}.a")
endforeach ()
endif ()
string (REPLACE ";" " " LLVM_LIBRARY "${LLVM_LIBRARY}")
message (STATUS "LLVM library = ${LLVM_LIBRARY}")
else ()
message (FATAL_ERROR "LLVM not found.")
endif ()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${LLVM_LIBRARY}")
# end LLVM library setup
endif()
set(EXETYPE MACOSX_BUNDLE)

@ -201,7 +201,7 @@ LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distrobution, so users dont need mingw installed
## for re-distribution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False

@ -199,7 +199,7 @@ LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
## DISABLED, causes linking errors!
## for re-distrobution, so users dont need mingw installed
## for re-distribution, so users dont need mingw installed
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False

@ -84,7 +84,7 @@ public:
* Sets the highest passed frequency.
* \param high The highest passed frequency.
*/
void setHigh(float hight);
void setHigh(float high);
virtual AUD_IReader* createReader();
};

@ -38,7 +38,7 @@ extern "C" {
#endif
/**
* Initalizes the Python module.
* Initializes the Python module.
*/
extern PyObject *AUD_initPython(void);

@ -59,7 +59,8 @@ include_directories(
SYSTEM
${BOOST_INCLUDE_DIR}
${OPENIMAGEIO_INCLUDE_DIRS}
${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO)
${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO
${OPENEXR_INCLUDE_DIR})
# Subdirectories

@ -59,7 +59,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
col = split.column()
sub = col.column()
sub.enabled = (device_type == 'NONE' or cscene.device == 'CPU')
sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
sub.prop(cscene, "progressive")
sub = col.column(align=True)
@ -438,6 +438,28 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel):
layout.prop(cdata, "dicing_rate")
class Cycles_PT_mesh_normals(CyclesButtonsPanel, Panel):
bl_label = "Normals"
bl_context = "data"
@classmethod
def poll(cls, context):
return CyclesButtonsPanel.poll(context) and context.mesh
def draw(self, context):
layout = self.layout
mesh = context.mesh
split = layout.split()
col = split.column()
col.prop(mesh, "show_double_sided")
col = split.column()
col.label()
class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel):
bl_label = "Ray Visibility"
bl_context = "object"

@ -309,7 +309,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
hide = hide || !(ob_layer & scene_layer);
if(!hide) {
progress.set_status("Synchronizing object", (*b_ob).name());
progress.set_sync_status("Synchronizing object", (*b_ob).name());
int num_particles = object_count_particles(*b_ob);
@ -356,6 +356,8 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
}
}
progress.set_sync_status("");
if(!cancel && !motion) {
sync_background_light();

@ -125,8 +125,18 @@ __device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float
kernel_write_pass_float3(buffer + kernel_data.film.pass_glossy_color, sample, L->color_glossy);
if(flag & PASS_TRANSMISSION_COLOR)
kernel_write_pass_float3(buffer + kernel_data.film.pass_transmission_color, sample, L->color_transmission);
if(flag & PASS_SHADOW)
kernel_write_pass_float4(buffer + kernel_data.film.pass_shadow, sample, L->shadow);
if(flag & PASS_SHADOW) {
float4 shadow = L->shadow;
/* bit of an ugly hack to compensate for emitting triangles influencing
* amount of samples we get for this pass */
if(kernel_data.integrator.progressive && kernel_data.integrator.pdf_triangles != 0.0f)
shadow.w = 0.5f;
else
shadow.w = 1.0f;
kernel_write_pass_float4(buffer + kernel_data.film.pass_shadow, sample, shadow);
}
#endif
}

@ -196,7 +196,18 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int
else if(components == 3) {
assert(pass.components == 4);
if(pass.divide_type != PASS_NONE) {
/* RGBA */
if(type == PASS_SHADOW) {
for(int i = 0; i < size; i++, in += pass_stride, pixels += 3) {
float4 f = make_float4(in[0], in[1], in[2], in[3]);
float invw = (f.w > 0.0f)? 1.0f/f.w: 1.0f;
pixels[0] = f.x*invw;
pixels[1] = f.y*invw;
pixels[2] = f.z*invw;
}
}
else if(pass.divide_type != PASS_NONE) {
/* RGB lighting passes that need to divide out color */
pass_offset = 0;
foreach(Pass& color_pass, params.passes) {

@ -366,8 +366,10 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
device_vector<float4>& tex_img = dscene->tex_float_image[slot];
if(tex_img.device_pointer)
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
device->tex_free(tex_img);
}
if(!file_load_float_image(img, tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
@ -384,8 +386,10 @@ 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);
if(!pack_images)
if(!pack_images) {
thread_scoped_lock device_lock(device_mutex);
device->tex_alloc(name.c_str(), tex_img, true, true);
}
}
else {
string filename = path_filename(images[slot - tex_image_byte_start]->filename);
@ -393,8 +397,10 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
device_vector<uchar4>& tex_img = dscene->tex_image[slot - tex_image_byte_start];
if(tex_img.device_pointer)
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
device->tex_free(tex_img);
}
if(!file_load_image(img, tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
@ -411,8 +417,10 @@ 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);
if(!pack_images)
if(!pack_images) {
thread_scoped_lock device_lock(device_mutex);
device->tex_alloc(name.c_str(), tex_img, true, true);
}
}
img->need_load = false;
@ -440,15 +448,27 @@ void ImageManager::device_free_image(Device *device, DeviceScene *dscene, int sl
#endif
}
else if(is_float) {
device->tex_free(dscene->tex_float_image[slot]);
dscene->tex_float_image[slot].clear();
device_vector<float4>& tex_img = dscene->tex_float_image[slot];
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
device->tex_free(tex_img);
}
tex_img.clear();
delete float_images[slot];
float_images[slot] = NULL;
}
else {
device->tex_free(dscene->tex_image[slot - tex_image_byte_start]);
dscene->tex_image[slot - tex_image_byte_start].clear();
device_vector<uchar4>& tex_img = dscene->tex_image[slot - tex_image_byte_start];
if(tex_img.device_pointer) {
thread_scoped_lock device_lock(device_mutex);
device->tex_free(tex_img);
}
tex_img.clear();
delete images[slot - tex_image_byte_start];
images[slot - tex_image_byte_start] = NULL;
@ -542,9 +562,9 @@ void ImageManager::device_free(Device *device, DeviceScene *dscene)
device_free_image(device, dscene, slot);
device->tex_free(dscene->tex_image_packed);
dscene->tex_image_packed.clear();
device->tex_free(dscene->tex_image_packed_info);
dscene->tex_image_packed.clear();
dscene->tex_image_packed_info.clear();
images.clear();

@ -22,6 +22,7 @@
#include "device_memory.h"
#include "util_string.h"
#include "util_thread.h"
#include "util_vector.h"
CCL_NAMESPACE_BEGIN
@ -66,6 +67,7 @@ private:
int tex_num_images;
int tex_num_float_images;
int tex_image_byte_start;
thread_mutex device_mutex;
struct Image {
string filename;

@ -43,6 +43,8 @@ public:
tile_time = 0.0f;
status = "Initializing";
substatus = "";
sync_status = "";
sync_substatus = "";
update_cb = NULL;
cancel = false;
cancel_message = "";
@ -164,11 +166,42 @@ public:
set_update();
}
void set_sync_status(const string& status_, const string& substatus_ = "")
{
{
thread_scoped_lock lock(progress_mutex);
sync_status = status_;
sync_substatus = substatus_;
total_time = time_dt() - start_time;
}
set_update();
}
void set_sync_substatus(const string& substatus_)
{
{
thread_scoped_lock lock(progress_mutex);
sync_substatus = substatus_;
total_time = time_dt() - start_time;
}
set_update();
}
void get_status(string& status_, string& substatus_)
{
thread_scoped_lock lock(progress_mutex);
status_ = status;
substatus_ = substatus;
if(sync_status != "") {
status_ = sync_status;
substatus_ = sync_substatus;
}
else {
status_ = status;
substatus_ = substatus;
}
}
/* callback */
@ -202,6 +235,9 @@ protected:
string status;
string substatus;
string sync_status;
string sync_substatus;
volatile bool cancel;
string cancel_message;
};

@ -35,7 +35,7 @@
#define OCIO_CAPI_IMPLEMENTATION
#include "ocio_capi.h"
#ifdef NDEBUG
#if !defined(WITH_ASSERT_ABORT)
# define OCIO_abort()
#else
# include <stdlib.h>
@ -53,7 +53,7 @@ static void OCIO_reportError(const char *err)
{
std::cerr << "OpenColorIO Error: " << err << std::endl;
// OCIO_abort();
OCIO_abort();
}
static void OCIO_reportException(Exception &exception)

@ -11,7 +11,7 @@ luma: [0.2126, 0.7152, 0.0722]
description: RRT version ut33
roles:
reference: Linear ACES
reference: Linear
# Internal scene linear space
scene_linear: Linear
@ -51,17 +51,19 @@ displays:
- !<View> {name: Raw, colorspace: Raw}
- !<View> {name: Log, colorspace: adx10}
None:
- !<View> {name: Default, colorspace: raw}
- !<View> {name: Default, colorspace: Raw}
active_displays: [sRGB, DCIP3, Rec709, XYZ, None]
active_views: [Default, RRT, Raw, Log]
colorspaces:
- !<ColorSpace>
name: Linear ACES
name: Linear
family: aces
equalitygroup:
bitdepth: 32f
description: |
Rec. 709 (Full Range), Blender native linear space
isdata: false
allocation: lg2
allocationvars: [-8.5, 5]
@ -93,18 +95,19 @@ colorspaces:
- !<FileTransform> {src: adx_cid_to_rle.spi1d, interpolation: linear}
- !<LogTransform> {base: 10, direction: inverse}
- !<FileTransform> {src: adx_exp_to_aces.spimtx}
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: linear, direction: inverse}
- !<ColorSpace>
name: Linear
name: Linear ACES
family:
equalitygroup:
bitdepth: 32f
description: |
Rec. 709 (Full Range), Blender native linear space
ACES linear space
isdata: false
allocation: uniform
allocationvars: [-0.125, 1.125]
to_reference: !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
allocationvars: [-8.5, 5]
to_reference: !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: linear, direction: inverse}
- !<ColorSpace>
name: rrt_srgb
@ -116,6 +119,7 @@ colorspaces:
allocationvars: [0, 1]
from_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
- !<FileTransform> {src: rrt_ut33_sRGB.spi3d, interpolation: tetrahedral}
@ -132,7 +136,6 @@ colorspaces:
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709.spi1d, interpolation: linear}
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<ColorSpace>
name: rrt_rec709
@ -144,6 +147,7 @@ colorspaces:
allocationvars: [0, 1]
from_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
- !<FileTransform> {src: rrt_ut33_rec709.spi3d, interpolation: tetrahedral}
@ -157,6 +161,7 @@ colorspaces:
allocationvars: [0, 1]
from_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
- !<FileTransform> {src: rrt_ut33_p3dci.spi3d, interpolation: tetrahedral}
@ -170,6 +175,7 @@ colorspaces:
allocationvars: [0, 1]
from_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<FileTransform> {src: aces_to_xyz.spimtx, interpolation: linear}
- !<ColorSpace>
@ -182,6 +188,7 @@ colorspaces:
allocationvars: [0, 1]
from_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<AllocationTransform> {allocation: lg2, vars: [-8.5, 5]}
- !<FileTransform> {src: rrt_ut33_dcdm.spi3d, interpolation: tetrahedral}
@ -197,7 +204,6 @@ colorspaces:
allocationvars: [0, 1]
from_reference: !<GroupTransform>
children:
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: linear, direction: inverse}
- !<FileTransform> {src: srgb_to_xyz.spimtx, interpolation: linear}
- !<FileTransform> {src: dci_xyz.spi1d, interpolation: linear}
@ -213,7 +219,6 @@ colorspaces:
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: lg10.spi1d, interpolation: nearest}
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<ColorSpace>
name: srgb8
@ -226,7 +231,7 @@ colorspaces:
allocation: uniform
from_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: Linear ACES, dst: lg10}
- !<ColorSpaceTransform> {src: Linear, dst: lg10}
- !<FileTransform> {src: spi_ocio_srgb_test.spi3d, interpolation: linear}
- !<ColorSpace>
@ -242,7 +247,6 @@ colorspaces:
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: srgb.spi1d, interpolation: linear}
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: nearest}
- !<ColorSpace>
name: VD16
@ -256,7 +260,6 @@ colorspaces:
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: vd16.spi1d, interpolation: nearest}
- !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: linear}
- !<ColorSpace>
name: Non-Color
@ -280,5 +283,5 @@ colorspaces:
allocation: uniform
from_reference: !<GroupTransform>
children:
- !<ColorSpaceTransform> {src: Linear ACES, dst: lg10}
- !<ColorSpaceTransform> {src: Linear, dst: lg10}
- !<FileTransform> {src: colorworks_filmlg_to_p3.3dl, interpolation: linear}

Binary file not shown.

@ -275,7 +275,8 @@ def enable(module_name, default_set=True, persistent=False):
try:
mod.register()
except:
print("Exception in module register(): %r" % getattr(mod, "__file__", module_name))
print("Exception in module register(): %r" %
getattr(mod, "__file__", module_name))
handle_error()
del sys.modules[module_name]
return None
@ -317,7 +318,8 @@ def disable(module_name, default_set=True):
try:
mod.unregister()
except:
print("Exception in module unregister(): %r" % getattr(mod, "__file__", module_name))
print("Exception in module unregister(): %r" %
getattr(mod, "__file__", module_name))
import traceback
traceback.print_exc()
else:

@ -16,7 +16,7 @@
#
# ***** END GPL LICENSE BLOCK *****
# <pep8-80 compliant>
# <pep8 compliant>
# Write out messages.txt from Blender.
# XXX: This script is meant to be used from inside Blender!
@ -43,6 +43,7 @@ UNDOC_OPS_STR = settings.UNDOC_OPS_STR
NC_ALLOWED = settings.WARN_MSGID_NOT_CAPITALIZED_ALLOWED
def check(check_ctxt, messages, key, msgsrc):
if check_ctxt is None:
return
@ -78,7 +79,8 @@ def dump_messages_rna(messages, check_ctxt):
import bpy
def classBlackList():
blacklist_rna_class = [# core classes
blacklist_rna_class = [
# core classes
"Context", "Event", "Function", "UILayout",
"BlendData",
# registerable classes

@ -162,9 +162,9 @@ def main():
" {} specific context{} present:\n {}\n"
"".format(glob_stats["nbr"], glob_stats["lvl"] / glob_stats["nbr"],
glob_stats["lvl_ttips"] / glob_stats["nbr"],
glob_stats["lvl_trans_ttips"]/glob_stats["nbr"],
glob_stats["lvl_ttips_in_trans"]/glob_stats["nbr"],
glob_stats["lvl_comm"]/glob_stats["nbr"], glob_stats["nbr_signs"],
glob_stats["lvl_trans_ttips"] / glob_stats["nbr"],
glob_stats["lvl_ttips_in_trans"] / glob_stats["nbr"],
glob_stats["lvl_comm"] / glob_stats["nbr"], glob_stats["nbr_signs"],
glob_stats["nbr_trans_signs"], nbr_contexts, _ctx_txt,
"\n ".join(glob_stats["contexts"]-{""})))

@ -95,7 +95,6 @@ def parse_messages(fname):
msgctxt_lines = []
comment_lines = []
def finalize_message():
nonlocal reading_msgid, reading_msgstr, reading_msgctxt, \
reading_comment, is_fuzzy, is_translated, is_commented, \
@ -225,7 +224,6 @@ def parse_messages(fname):
if reading_msgstr:
finalize_message()
return (messages,
{"trans_msg": translated_messages,
"fuzzy_msg": fuzzy_messages,

@ -59,6 +59,7 @@ import addon_utils as _addon_utils
_script_module_dirs = "startup", "modules"
def _test_import(module_name, loaded_modules):
use_time = _bpy.app.debug_python
@ -615,12 +616,15 @@ def _blender_default_map():
# hooks for doc lookups
_manual_map = [_blender_default_map]
def register_manual_map(manual_hook):
_manual_map.append(manual_hook)
def unregister_manual_map(manual_hook):
_manual_map.remove(manual_hook)
def manual_map():
# reverse so default is called last
for cb in reversed(_manual_map):
@ -633,4 +637,3 @@ def manual_map():
continue
yield prefix, url_manual_mapping

@ -257,7 +257,10 @@ def xml2rna(root_xml,
try:
value_xml_coerce = [int(v) for v in value_xml_split]
except ValueError:
value_xml_coerce = [float(v) for v in value_xml_split]
try:
value_xml_coerce = [float(v) for v in value_xml_split]
except ValueError: # bool vector property
value_xml_coerce = [{'TRUE': True, 'FALSE': False}[v] for v in value_xml_split]
del value_xml_split
tp_name = 'ARRAY'

@ -22,12 +22,16 @@ import bpy
from bpy.types import Operator
from bpy.props import EnumProperty
# XXX These node item lists should actually be generated by a callback at operator execution time (see node_type_items below),
# using the active node tree from the context. Due to a difficult bug in bpy this is not possible (item list memory gets freed too early),
# XXX These node item lists should actually be generated by a callback at
# operator execution time (see node_type_items below),
# using the active node tree from the context.
# Due to a difficult bug in bpy this is not possible
# (item list memory gets freed too early),
# so for now just copy the static item lists to these global variables.
#
# In the custom_nodes branch, the static per-tree-type node items are replaced by a single independent type list anyway (with a poll function
# to limit node types to the respective trees). So this workaround is only temporary.
# In the custom_nodes branch, the static per-tree-type node items are replaced
# by a single independent type list anyway (with a poll function to limit node
# types to the respective trees). So this workaround is only temporary.
# lazy init
node_type_items_dict = {}
@ -39,18 +43,21 @@ node_group_prefix = 'GROUP_'
# Generate a list of enum items for a given node class
# Copy existing type enum, adding a prefix to distinguish from node groups
# Skip the base node group type, node groups will be added below for all existing group trees
# Skip the base node group type,
# node groups will be added below for all existing group trees
def node_type_items(node_class):
return [(node_type_prefix + item.identifier, item.name, item.description)
for item in node_class.bl_rna.properties['type'].enum_items if item.identifier != 'GROUP']
for item in node_class.bl_rna.properties['type'].enum_items
if item.identifier != 'GROUP']
# Generate items for node group types
# Filter by the given tree_type
# Node group trees don't have a description property yet (could add this as a custom property though)
# Node group trees don't have a description property yet
# (could add this as a custom property though)
def node_group_items(tree_type):
return [(node_group_prefix + group.name, group.name, '')
for group in bpy.data.node_groups if group.type == tree_type]
for group in bpy.data.node_groups if group.type == tree_type]
# Returns the enum item list for the edited tree in the context
@ -71,7 +78,11 @@ def node_type_items_cb(self, context):
})
# XXX Does not work correctly, see comment above
#return [(item.identifier, item.name, item.description, item.value) for item in tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
'''
return [(item.identifier, item.name, item.description, item.value)
for item in
tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
'''
if tree.type in node_type_items_dict:
return node_type_items_dict[tree.type] + node_group_items(tree.type)
@ -85,7 +96,8 @@ class NODE_OT_add_search(Operator):
bl_label = "Search and Add Node"
bl_options = {'REGISTER', 'UNDO'}
# XXX this should be called 'node_type' but the operator search property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
# XXX this should be called 'node_type' but the operator search
# property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
type = EnumProperty(
name="Node Type",
description="Node type",
@ -98,14 +110,17 @@ class NODE_OT_add_search(Operator):
space = context.space_data
tree = space.edit_tree
# Enum item identifier has an additional prefix to distinguish base node types from node groups
# Enum item identifier has an additional prefix to
# distinguish base node types from node groups
item = self.type
if item.startswith(node_type_prefix):
# item means base node type
node = tree.nodes.new(type=item[len(node_type_prefix):])
elif item.startswith(node_group_prefix):
# item means node group type
node = tree.nodes.new(type='GROUP', group=bpy.data.node_groups[item[len(node_group_prefix):]])
node = tree.nodes.new(
type='GROUP',
group=bpy.data.node_groups[item[len(node_group_prefix):]])
else:
return None
@ -133,7 +148,8 @@ class NODE_OT_add_search(Operator):
v2d = context.region.view2d
# convert mouse position to the View2D for later node placement
space.cursor_location = v2d.region_to_view(event.mouse_region_x, event.mouse_region_y)
space.cursor_location = v2d.region_to_view(event.mouse_region_x,
event.mouse_region_y)
context.window_manager.invoke_search_popup(self)
return {'CANCELLED'}

@ -185,7 +185,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
split = col.box().split()
col = split.column()
col.prop(group, "layers", text="Dupli")
col.prop(group, "layers", text="Dupli Visibility")
col = split.column()
col.prop(group, "dupli_offset", text="")

@ -866,7 +866,6 @@ class RENDER_PT_shading(RenderButtonsPanel, Panel):
col = split.column()
col.prop(rd, "use_raytrace", text="Ray Tracing")
col.prop(rd, "use_color_unpremultiply")
col.prop(rd, "alpha_mode", text="Alpha")

@ -241,6 +241,7 @@ class SCENE_PT_color_management(Panel):
layout = self.layout
scene = context.scene
rd = scene.render
col = layout.column()
col.label(text="Display:")
@ -250,6 +251,7 @@ class SCENE_PT_color_management(Panel):
col.separator()
col.label(text="Render:")
col.template_colormanaged_view_settings(scene, "view_settings")
col.prop(rd, "use_color_unpremultiply")
col = layout.column()
col.separator()

@ -866,7 +866,7 @@ class USERPREF_MT_ndof_settings(Menu):
layout.separator()
layout.label(text="Orbit options")
layout.prop(input_prefs, "ndof_turntable")
layout.row().prop(input_prefs, "ndof_view_rotate_method", text="")
layout.prop(input_prefs, "ndof_roll_invert_axis")
layout.prop(input_prefs, "ndof_tilt_invert_axis")
layout.prop(input_prefs, "ndof_rotate_invert_axis")
@ -953,6 +953,8 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
sub = col.column()
sub.label(text="NDOF Device:")
sub.prop(inputs, "ndof_sensitivity", text="NDOF Sensitivity")
sub.prop(inputs, "ndof_orbit_sensitivity", text="NDOF Orbit Sensitivity")
sub.row().prop(inputs, "ndof_view_rotate_method", expand=True)
row.separator()

@ -39,10 +39,9 @@ def add_object(self, context):
class OBJECT_OT_add_object(Operator, AddObjectHelper):
"""Add a Mesh Object"""
"""Create a new Mesh Object"""
bl_idname = "mesh.add_object"
bl_label = "Add Mesh Object"
bl_description = "Create a new Mesh Object"
bl_options = {'REGISTER', 'UNDO'}
scale = FloatVectorProperty(
@ -82,6 +81,7 @@ def register():
bpy.utils.register_manual_map(add_object_manual_map)
bpy.types.INFO_MT_mesh_add.append(add_object_button)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_add_object)
bpy.utils.unregister_manual_map(add_object_manual_map)

@ -12,36 +12,36 @@ class LayoutDemoPanel(bpy.types.Panel):
def draw(self, context):
layout = self.layout
sc = context.scene
scene = context.scene
#Create a simple row.
# Create a simple row.
layout.label(text=" Simple Row:")
row = layout.row()
row.prop(sc, "frame_start")
row.prop(sc, "frame_end")
row.prop(scene, "frame_start")
row.prop(scene, "frame_end")
#Create an row where the buttons are aligned to each other.
# Create an row where the buttons are aligned to each other.
layout.label(text=" Aligned Row")
row = layout.row(align=True)
row.prop(sc, "frame_start")
row.prop(sc, "frame_end")
row.prop(scene, "frame_start")
row.prop(scene, "frame_end")
#Create two columns, by using a split layout.
# Create two columns, by using a split layout.
split = layout.split()
# First column
col = split.column()
col.label(text="Column One:")
col.prop(sc, "frame_end")
col.prop(sc, "frame_start")
col.prop(scene, "frame_end")
col.prop(scene, "frame_start")
# Second column, aligned
col = split.column(align=True)
col.label(text="Column Two")
col.prop(sc, "frame_start")
col.prop(sc, "frame_end")
col.prop(scene, "frame_start")
col.prop(scene, "frame_end")
def register():

@ -22,6 +22,9 @@ class HelloWorldPanel(bpy.types.Panel):
row = layout.row()
row.prop(obj, "name")
row = layout.row()
row.operator("mesh.primitive_cube_add")
def register():
bpy.utils.register_class(HelloWorldPanel)

@ -188,7 +188,7 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
SOCKET s_in;
char buf[256];
struct sockaddr_in addr;
FILE* fp;
FILE *fp;
p = lpFileName;
while (*p && *p != '.') p++;
@ -229,7 +229,7 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
return VF_ERROR;
}
rval = (conndesc*) malloc(sizeof(conndesc));
rval = (conndesc *) malloc(sizeof(conndesc));
rval->addr = addr;
@ -281,7 +281,7 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
HRESULT __stdcall VF_CloseFileFunc_Blen(
VF_FileHandle hFileHandle )
{
free((conndesc*) hFileHandle);
free((conndesc *) hFileHandle);
return VF_OK;
}
@ -290,7 +290,7 @@ HRESULT __stdcall VF_GetFileInfoFunc_Blen(
VF_FileHandle hFileHandle,
LPVF_FileInfo lpFileInfo )
{
conndesc * c = (conndesc*) hFileHandle;
conndesc *c = (conndesc *) hFileHandle;
if (c == 0) {
return VF_ERROR;
}
@ -385,10 +385,10 @@ HRESULT __stdcall VF_ReadDataFunc_Blen(
framebuf = (unsigned char*) v->lpData;
for (y = 0; y < height; y++) {
unsigned char * p = framebuf + v->lPitch * y;
unsigned char * e = p + width * 3;
unsigned char *p = framebuf + v->lPitch * y;
unsigned char *e = p + width * 3;
my_recv(s_in, (char*) p, width * 3);
my_recv(s_in, (char *)p, width * 3);
while (p != e) {
unsigned char tmp = p[2];
p[2] = p[0];

@ -63,12 +63,12 @@
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
#define FONT_SIZE_DEFAULT 12
/* locale options. */
/* Locale options. */
static char global_messagepath[1024];
static char global_language[32];
static char global_encoding_name[32];
/* map from the rna_userdef.c:rna_def_userdef_system(BlenderRNA *brna):language_items */
/* Map from the rna_userdef.c:rna_def_userdef_system(BlenderRNA *brna):language_items */
static const char *locales[] = {
"", "",
"english", "en_US",
@ -107,14 +107,13 @@ static const char *locales[] = {
"kyrgyz", "ky_KG",
"turkish", "tr_TR",
"hungarian", "hu_HU",
"brazilian portuguese", "pt_BR",
"portuguese-brazilian", "pt_BR",
"hebrew", "he_IL",
};
void BLF_lang_init(void)
{
char *messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale");
/* printf("%s\n", messagepath);*/
BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name));
@ -125,10 +124,9 @@ void BLF_lang_init(void)
printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
global_messagepath[0] = '\0';
}
}
/* get LANG/LANGUAGE environment variable */
/* Get LANG/LANGUAGE environment variable. */
static void get_language_variable(const char *varname, char *var, const size_t maxlen)
{
char *env = getenv(varname);
@ -136,18 +134,18 @@ static void get_language_variable(const char *varname, char *var, const size_t m
if (env) {
char *s;
/* store defaul locale */
/* Store defaul locale. */
BLI_strncpy(var, env, maxlen);
/* use first language as default */
/* Use first language as default. */
s = strchr(var, ':');
if (s)
s[0] = 0;
}
}
/* get language to be used based on locale(which might be empty when using default language) and
* LANG environment variable
/* Get language to be used based on locale (which might be empty when using default language) and
* LANG environment variable.
*/
static void get_language(const char *locale, const char *lang, char *language, const size_t maxlen)
{
@ -165,7 +163,7 @@ static void get_language(const char *locale, const char *lang, char *language, c
}
}
/* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */
/* XXX WARNING!!! In osx somehow the previous function call jumps in this one??? (ton, ppc) */
void BLF_lang_set(const char *str)
{
char *locreturn;
@ -185,7 +183,7 @@ void BLF_lang_set(const char *str)
if (short_locale) {
char *envStr;
if (U.language == 0) /* use system setting */
if (U.language == 0) /* Use system setting. */
envStr = BLI_sprintfN("LANG=%s", getenv("LANG"));
else
envStr = BLI_sprintfN("LANG=%s", short_locale);
@ -252,7 +250,7 @@ void BLF_lang_set(const char *str)
printf("Fallback to LANG=%s and LANGUAGE=%s\n", default_lang, language);
}
/* fallback to default settings */
/* Fallback to default settings. */
BLI_setenv("LANG", default_lang);
BLI_setenv("LANGUAGE", language);

@ -203,7 +203,7 @@ void BKE_pose_ikparam_init(struct bPose *pose);
void BKE_pose_itasc_init(struct bItasc *itasc);
/* clears BONE_UNKEYED flags for frame changing */
// XXX to be depreceated for a more general solution in animsys...
// XXX to be deprecated for a more general solution in animsys...
void framechange_poses_clear_unkeyed(void);
/* Bone Groups API --------------------- */

@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 263
#define BLENDER_SUBVERSION 21
#define BLENDER_SUBVERSION 22
/* 262 was the last editmesh release but its has compatibility code for bmesh data,
* so set the minversion to 2.61 */

@ -66,7 +66,7 @@ int BKE_imtype_is_movie(const char imtype);
int BKE_imtype_supports_zbuf(const char imtype);
int BKE_imtype_supports_compress(const char imtype);
int BKE_imtype_supports_quality(const char imtype);
int BKE_imtype_supports_float(const char imtype);
int BKE_imtype_requires_linear_float(const char imtype);
char BKE_imtype_valid_channels(const char imtype);
char BKE_imtype_valid_depths(const char imtype);

@ -68,7 +68,7 @@ typedef struct Main {
ListBase latt;
ListBase lamp;
ListBase camera;
ListBase ipo; // XXX depreceated
ListBase ipo; // XXX deprecated
ListBase key;
ListBase world;
ListBase screen;

@ -88,8 +88,8 @@ int BKE_mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
struct CustomData *pdata, int totface, int totloop, int totpoly);
/*calculates a face normal.*/
void mesh_calc_poly_normal(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float no[3]);
void BKE_mesh_calc_poly_normal(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float no[3]);
void BKE_mesh_calc_poly_normal_coords(struct MPoly *mpoly, struct MLoop *loopstart,
const float (*vertex_coords)[3], float no[3]);
@ -98,7 +98,7 @@ void BKE_mesh_calc_poly_center(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float cent[3]);
float BKE_mesh_calc_poly_area(struct MPoly *mpoly, struct MLoop *loopstart,
struct MVert *mvarray, float polynormal[3]);
struct MVert *mvarray, const float polynormal[3]);
/* Find the index of the loop in 'poly' which references vertex,
* returns -1 if not found */

@ -54,7 +54,7 @@ void BKE_object_workob_clear(struct Object *workob);
void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
void BKE_object_transform_copy(struct Object *ob_tar, const struct Object *ob_src);
struct SoftBody *copy_softbody(struct SoftBody *sb);
struct SoftBody *copy_softbody(struct SoftBody *sb, int copy_caches);
struct BulletSoftBody *copy_bulletsoftbody(struct BulletSoftBody *sb);
void BKE_object_copy_particlesystems(struct Object *obn, struct Object *ob);
void BKE_object_copy_softbody(struct Object *obn, struct Object *ob);
@ -82,6 +82,7 @@ struct Object *BKE_object_add(struct Scene *scene, int type);
void *BKE_object_obdata_add_from_type(int type);
struct Object *BKE_object_copy(struct Object *ob);
struct Object *BKE_object_copy_with_caches(struct Object *ob);
void BKE_object_make_local(struct Object *ob);
int BKE_object_is_libdata(struct Object *ob);
int BKE_object_obdata_is_libdata(struct Object *ob);

@ -303,7 +303,7 @@ struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
void BKE_ptcache_free_mem(struct ListBase *mem_cache);
void BKE_ptcache_free(struct PointCache *cache);
void BKE_ptcache_free_list(struct ListBase *ptcaches);
struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old);
struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old, int copy_data);
/********************** Baking *********************/

@ -1140,21 +1140,17 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
float *v3;
/* float *v4; */ /* UNUSED */
float cent[3], quat[4], mat[3][3], mat3[3][3], tmat[4][4], obmat[4][4];
float f_no[3];
MLoop *loopstart = mloop + mp->loopstart;
if (mp->totloop < 3) {
/* highly unlikely but to be safe */
if (UNLIKELY(mp->totloop < 3)) {
continue;
}
else {
BKE_mesh_calc_poly_normal(mp, mloop + mp->loopstart, mvert, f_no);
v1 = mvert[(mv1 = loopstart[0].v)].co;
v2 = mvert[(mv2 = loopstart[1].v)].co;
v3 = mvert[(mv3 = loopstart[2].v)].co;
#if 0
if (mp->totloop > 3) {
v4 = mvert[(mv4 = loopstart[3].v)].co;
}
#endif
}
/* translation */
@ -1170,12 +1166,12 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
copy_v3_v3(obmat[3], cent);
/* rotation */
tri_to_quat(quat, v1, v2, v3);
tri_to_quat_ex(quat, v1, v2, v3, f_no);
quat_to_mat3(mat, quat);
/* scale */
if (par->transflag & OB_DUPLIFACES_SCALE) {
float size = BKE_mesh_calc_poly_area(mp, loopstart, mvert, NULL);
float size = BKE_mesh_calc_poly_area(mp, loopstart, mvert, f_no);
size = sqrtf(size) * par->dupfacesca;
mul_m3_fl(mat, size);
}

@ -640,7 +640,7 @@ static void fcurves_path_rename_fix(ID *owner_id, const char *prefix, const char
if (fcu->rna_path != old_path) {
bActionGroup *agrp = fcu->grp;
if ((agrp) && strcmp(oldName, agrp->name)==0) {
if ((agrp) && strcmp(oldName, agrp->name) == 0) {
BLI_strncpy(agrp->name, newName, sizeof(agrp->name));
}
}

@ -96,7 +96,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
ysize = (bytes + (ibuf->x - 1)) / ibuf->x;
if (ysize < ibuf->y) {
/* we're first going to copy all data into a liniar buffer.
/* we're first going to copy all data into a linear buffer.
* step can be 4 or 1 bytes, and the data is not sequential because
* the bitmap was flipped vertically. */

@ -563,7 +563,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
else {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
mul_v3_v3v3(dstf, rgba, brush_rgb);
dstf[3] = rgba[3] *alpha *BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
}
}
}
@ -594,7 +594,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
else if (texfall == 2) {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
mul_v3_v3(rgba, brush->rgb);
alpha_f = rgba[3] *alpha *BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
rgb_float_to_uchar(dst, rgba);
@ -602,7 +602,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
}
else {
BKE_brush_sample_tex(scene, brush, xy, rgba, 0);
alpha_f = rgba[3] *alpha *BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
dst[0] = crgb[0];
dst[1] = crgb[1];

@ -2768,7 +2768,7 @@ static void calchandleNurb_intern(BezTriple *bezt, BezTriple *prev, BezTriple *n
if (skip_align) {
/* handles need to be updated during animation and applying stuff like hooks,
* but in such situatios it's quite difficult to distinguish in which order
* but in such situations it's quite difficult to distinguish in which order
* align handles should be aligned so skip them for now */
return;
}

@ -1944,7 +1944,7 @@ static int dynamicPaint_findNeighbourPixel(PaintUVPoint *tempPoints, DerivedMesh
{
/* Note: Current method only uses polygon edges to detect neighboring pixels.
* -> It doesn't always lead to the optimum pixel but is accurate enough
* and faster/simplier than including possible face tip point links)
* and faster/simpler than including possible face tip point links)
*/
int x, y;
@ -2852,15 +2852,15 @@ static void mesh_faces_nearest_point_dp(void *userdata, int index, const float c
/***************************** Brush Painting Calls ******************************/
/*
* Mix color values to canvas point.
/**
* Mix color values to canvas point.
*
* surface : canvas surface
* index : surface point index
* paintFlags : paint object flags
* paintColor,Alpha,Wetness : to be mixed paint values
* timescale : value used to adjust time dependand
* operations when using substeps
* \param surface canvas surface
* \param index surface point index
* \param paintFlags paint object flags
* \param paintColor,Alpha,Wetness to be mixed paint values
* \param timescale value used to adjust time dependent
* operations when using substeps
*/
static void dynamicPaint_mixPaintColors(DynamicPaintSurface *surface, int index, int paintFlags,
const float paintColor[3], float *paintAlpha, float *paintWetness, float *timescale)
@ -4161,7 +4161,7 @@ static int dynamicPaint_prepareEffectStep(DynamicPaintSurface *surface, Scene *s
pdEndEffectors(&effectors);
}
/* Get number of required steps using averate point distance
/* Get number of required steps using average point distance
* so that just a few ultra close pixels wont up substeps to max */
/* adjust number of required substep by fastest active effect */
@ -4224,7 +4224,7 @@ static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force
/* Only continue if surrounding point has higher wetness */
if (ePoint->wetness < pPoint->wetness || ePoint->wetness < MIN_WETNESS) continue;
w_factor = 1.0f / numOfNeighs *MIN2(ePoint->wetness, 1.0f) * speed_scale;
w_factor = 1.0f / numOfNeighs * MIN2(ePoint->wetness, 1.0f) * speed_scale;
CLAMP(w_factor, 0.0f, 1.0f);
/* mix new wetness and color */

@ -619,6 +619,8 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
BLI_strncpy(colorspace_settings->name, colorspace, sizeof(colorspace_settings->name));
}
IMB_colormanagement_check_is_data(ibuf, colorspace_settings->name);
}
else {
ibuf = IMB_allocImBuf(width, height, depth, IB_rect);
@ -1031,7 +1033,7 @@ int BKE_imtype_supports_quality(const char imtype)
return 0;
}
int BKE_imtype_supports_float(const char imtype)
int BKE_imtype_requires_linear_float(const char imtype)
{
switch (imtype) {
case R_IMF_IMTYPE_CINEON:
@ -2605,8 +2607,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
/* invalidate color managed buffers if render result changed */
BLI_lock_thread(LOCK_COLORMANAGE);
if (ibuf->x != rres.rectx || ibuf->y != rres.recty || ibuf->rect_float != rectf)
{
if (ibuf->x != rres.rectx || ibuf->y != rres.recty || ibuf->rect_float != rectf) {
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
}

@ -32,7 +32,7 @@
/* NOTE:
*
* This file is no longer used to provide tools for the depreceated IPO system. Instead, it
* This file is no longer used to provide tools for the deprecated IPO system. Instead, it
* is only used to house the conversion code to the new system.
*
* -- Joshua Leung, Jan 2009
@ -1765,7 +1765,7 @@ void do_versions_ipos_to_animato(Main *main)
/* Any actuators set to ACT_IPO at this point are actually Action Actuators that
need this converted IPO to finish converting the actuator. */
if (act->type == ACT_IPO) {
aa = (bActionActuator*)act->data;
aa = (bActionActuator *)act->data;
aa->act = ob->adt->action;
act->type = ACT_ACTION;
}

@ -133,7 +133,7 @@ Key *BKE_key_add(ID *id) /* common function */
key->uidgen = 1;
/* XXX the code here uses some defines which will soon be depreceated... */
/* XXX the code here uses some defines which will soon be deprecated... */
switch (GS(id->name)) {
case ID_ME:
el = key->elemstr;

@ -1208,7 +1208,7 @@ static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], cons
/* needs work */
#if 1
/* quad check fails for bowtie, so keep using 2 tri checks */
/* quad check fails for bow-tie, so keep using 2 tri checks */
//if (isect_point_quad_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]], cos[face[3]]))
if (isect_point_tri_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]]) ||
isect_point_tri_v2(xy, cos[face[0]], cos[face[2]], cos[face[3]]))
@ -1216,7 +1216,7 @@ static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], cons
return maskrasterize_layer_z_depth_quad(xy, cos[face[0]], cos[face[1]], cos[face[2]], cos[face[3]]);
}
#elif 1
/* don't use isect_point_tri_v2_cw because we could have bowtie quads */
/* don't use isect_point_tri_v2_cw because we could have bow-tie quads */
if (isect_point_tri_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]])) {
return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]);

@ -1328,9 +1328,9 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
r_col[2] = facm * (r_col[2]) + fac * (r_col[2]) / col[2];
break;
case MA_RAMP_DIFF:
r_col[0] = facm * (r_col[0]) + fac *fabsf(r_col[0] - col[0]);
r_col[1] = facm * (r_col[1]) + fac *fabsf(r_col[1] - col[1]);
r_col[2] = facm * (r_col[2]) + fac *fabsf(r_col[2] - col[2]);
r_col[0] = facm * (r_col[0]) + fac * fabsf(r_col[0] - col[0]);
r_col[1] = facm * (r_col[1]) + fac * fabsf(r_col[1] - col[1]);
r_col[2] = facm * (r_col[2]) + fac * fabsf(r_col[2] - col[2]);
break;
case MA_RAMP_DARK:
tmp = col[0] + ((1 - col[0]) * facm);
@ -1491,7 +1491,7 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
}
/**
* \brief copy/paste buffer, if we had a propper py api that would be better
* \brief copy/paste buffer, if we had a proper py api that would be better
* \note matcopybuf.nodetree does _NOT_ use ID's
* \todo matcopybuf.nodetree's node->id's are NOT validated, this will crash!
*/

@ -788,7 +788,7 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
nr--;
}
/* check corrupt cases, bowtie geometry, cant handle these because edge data wont exist so just return 0 */
/* check corrupt cases, bow-tie geometry, cant handle these because edge data wont exist so just return 0 */
if (nr == 3) {
if (
/* real edges */
@ -1864,7 +1864,7 @@ void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
/* only calc poly normals */
mp = mpolys;
for (i = 0; i < numPolys; i++, mp++) {
mesh_calc_poly_normal(mp, mloop + mp->loopstart, mverts, pnors[i]);
BKE_mesh_calc_poly_normal(mp, mloop + mp->loopstart, mverts, pnors[i]);
}
}
@ -1914,7 +1914,7 @@ void BKE_mesh_calc_normals(MVert *mverts, int numVerts, MLoop *mloop, MPoly *mpo
mp = mpolys;
for (i = 0; i < numPolys; i++, mp++) {
mesh_calc_poly_normal(mp, mloop + mp->loopstart, mverts, pnors[i]);
BKE_mesh_calc_poly_normal(mp, mloop + mp->loopstart, mverts, pnors[i]);
ml = mloop + mp->loopstart;
BLI_array_empty(vertcos);
@ -2900,8 +2900,8 @@ static void mesh_calc_ngon_normal(MPoly *mpoly, MLoop *loopstart,
}
}
void mesh_calc_poly_normal(MPoly *mpoly, MLoop *loopstart,
MVert *mvarray, float no[3])
void BKE_mesh_calc_poly_normal(MPoly *mpoly, MLoop *loopstart,
MVert *mvarray, float no[3])
{
if (mpoly->totloop > 4) {
mesh_calc_ngon_normal(mpoly, loopstart, mvarray, no);
@ -3016,7 +3016,7 @@ void BKE_mesh_calc_poly_center(MPoly *mpoly, MLoop *loopstart,
/* note, passing polynormal is only a speedup so we can skip calculating it */
float BKE_mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
MVert *mvarray, float polynormal[3])
MVert *mvarray, const float polynormal[3])
{
if (mpoly->totloop == 3) {
return area_tri_v3(mvarray[loopstart[0].v].co,
@ -3035,7 +3035,7 @@ float BKE_mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
int i;
MLoop *l_iter = loopstart;
float area, polynorm_local[3], (*vertexcos)[3];
float *no = polynormal ? polynormal : polynorm_local;
const float *no = polynormal ? polynormal : polynorm_local;
BLI_array_fixedstack_declare(vertexcos, BM_NGON_STACK_SIZE, mpoly->totloop, __func__);
/* pack vertex cos into an array for area_poly_v3 */
@ -3045,7 +3045,7 @@ float BKE_mesh_calc_poly_area(MPoly *mpoly, MLoop *loopstart,
/* need normal for area_poly_v3 as well */
if (polynormal == NULL) {
mesh_calc_poly_normal(mpoly, loopstart, mvarray, no);
BKE_mesh_calc_poly_normal(mpoly, loopstart, mvarray, polynorm_local);
}
/* finally calculate the area */

@ -292,11 +292,11 @@ static void movieclip_calc_length(MovieClip *clip)
clip->len = framenr + 1;
}
else {
for (;; ) {
for (;;) {
get_sequence_fname(clip, framenr, name);
if (!BLI_exists(name)) {
clip->len = framenr + 1;
clip->len = framenr;
break;
}

@ -899,23 +899,44 @@ Object *BKE_object_add(struct Scene *scene, int type)
return ob;
}
SoftBody *copy_softbody(SoftBody *sb)
SoftBody *copy_softbody(SoftBody *sb, int copy_caches)
{
SoftBody *sbn;
if (sb == NULL) return(NULL);
sbn = MEM_dupallocN(sb);
sbn->totspring = sbn->totpoint = 0;
sbn->bpoint = NULL;
sbn->bspring = NULL;
if (copy_caches == FALSE) {
sbn->totspring = sbn->totpoint = 0;
sbn->bpoint = NULL;
sbn->bspring = NULL;
}
else {
sbn->totspring = sb->totspring;
sbn->totpoint = sb->totpoint;
if (sbn->bpoint) {
int i;
sbn->bpoint = MEM_dupallocN(sbn->bpoint);
for (i = 0; i < sbn->totpoint; i++) {
if (sbn->bpoint[i].springs)
sbn->bpoint[i].springs = MEM_dupallocN(sbn->bpoint[i].springs);
}
}
if (sb->bspring)
sbn->bspring = MEM_dupallocN(sb->bspring);
}
sbn->keys = NULL;
sbn->totkey = sbn->totpointkey = 0;
sbn->scratch = NULL;
sbn->pointcache = BKE_ptcache_copy_list(&sbn->ptcaches, &sb->ptcaches);
sbn->pointcache = BKE_ptcache_copy_list(&sbn->ptcaches, &sb->ptcaches, copy_caches);
if (sb->effector_weights)
sbn->effector_weights = MEM_dupallocN(sb->effector_weights);
@ -988,7 +1009,7 @@ static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
psysn->childcachebufs.first = psysn->childcachebufs.last = NULL;
psysn->renderdata = NULL;
psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches);
psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, FALSE);
/* XXX - from reading existing code this seems correct but intended usage of
* pointcache should /w cloth should be added in 'ParticleSystem' - campbell */
@ -1049,7 +1070,7 @@ void BKE_object_copy_particlesystems(Object *obn, Object *ob)
void BKE_object_copy_softbody(Object *obn, Object *ob)
{
if (ob->soft)
obn->soft = copy_softbody(ob->soft);
obn->soft = copy_softbody(ob->soft, FALSE);
}
static void copy_object_pose(Object *obn, Object *ob)
@ -1130,7 +1151,7 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
copy_v3_v3(ob_tar->size, ob_src->size);
}
Object *BKE_object_copy(Object *ob)
static Object *object_copy_do(Object *ob, int copy_caches)
{
Object *obn;
ModifierData *md;
@ -1191,7 +1212,7 @@ Object *BKE_object_copy(Object *ob)
if (obn->pd->rng)
obn->pd->rng = MEM_dupallocN(ob->pd->rng);
}
obn->soft = copy_softbody(ob->soft);
obn->soft = copy_softbody(ob->soft, copy_caches);
obn->bsoft = copy_bulletsoftbody(ob->bsoft);
BKE_object_copy_particlesystems(obn, ob);
@ -1207,6 +1228,18 @@ Object *BKE_object_copy(Object *ob)
return obn;
}
/* copy objects, will re-initialize cached simulation data */
Object *BKE_object_copy(Object *ob)
{
return object_copy_do(ob, FALSE);
}
/* copy objects, will duplicate cached simulation data */
Object *BKE_object_copy_with_caches(Object *ob)
{
return object_copy_do(ob, TRUE);
}
static void extern_local_object(Object *ob)
{
ParticleSystem *psys;

@ -190,7 +190,7 @@ void BKE_paint_free(Paint *paint)
}
/* called when copying scene settings, so even if 'src' and 'tar' are the same
* still do a id_us_plus(), rather then if we were copying betweem 2 existing
* still do a id_us_plus(), rather then if we were copying between 2 existing
* scenes where a matching value should decrease the existing user count as
* with paint_brush_set() */
void BKE_paint_copy(Paint *src, Paint *tar)

@ -116,7 +116,7 @@ int count_particles_mod(ParticleSystem *psys, int totgr, int cur)
}
return tot;
}
/* we allocate path cache memory in chunks instead of a big continguous
/* we allocate path cache memory in chunks instead of a big contiguous
* chunk, windows' memory allocater fails to find big blocks of memory often */
#define PATH_CACHE_BUF_SIZE 1024
@ -3776,7 +3776,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
ptex->gravity = ptex->field = ptex->time = ptex->clump = ptex->kink =
ptex->effector = ptex->rough1 = ptex->rough2 = ptex->roughe = 1.f;
ptex->length = 1.0f - part->randlength *PSYS_FRAND(child_index + 26);
ptex->length = 1.0f - part->randlength * PSYS_FRAND(child_index + 26);
ptex->length *= part->clength_thres < PSYS_FRAND(child_index + 27) ? part->clength : 1.0f;
for (m = 0; m < MAX_MTEX; m++, mtexp++) {
@ -3968,7 +3968,7 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float UNUSED
size *= part->childsize;
if (part->childrandsize != 0.0f)
size *= 1.0f - part->childrandsize *PSYS_FRAND(cpa - psys->child + 26);
size *= 1.0f - part->childrandsize * PSYS_FRAND(cpa - psys->child + 26);
return size;
}

@ -797,8 +797,10 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
}
else {
ctx->jitoff[i] = fmod(ctx->jitoff[i],(float)ctx->jitlevel);
psys_uv_to_w(ctx->jit[2*(int)ctx->jitoff[i]], ctx->jit[2*(int)ctx->jitoff[i]+1], mface->v4, pa->fuv);
ctx->jitoff[i]++;
if (!isnan(ctx->jitoff[i])) {
psys_uv_to_w(ctx->jit[2*(int)ctx->jitoff[i]], ctx->jit[2*(int)ctx->jitoff[i]+1], mface->v4, pa->fuv);
ctx->jitoff[i]++;
}
}
break;
case PART_DISTR_RAND:
@ -3775,7 +3777,7 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
/* Calculate the speed of the particle relative to the local scale of the
* simulation. This should be called once per particle during a simulation
* step, after the velocity has been updated. element_size defines the scale of
* the simulation, and is typically the distance to neighbourning particles. */
* the simulation, and is typically the distance to neighboring particles. */
static void update_courant_num(ParticleSimulationData *sim, ParticleData *pa,
float dtime, SPHData *sphdata)
{

@ -2663,32 +2663,59 @@ void BKE_ptcache_free_list(ListBase *ptcaches)
}
}
static PointCache *ptcache_copy(PointCache *cache)
static PointCache *ptcache_copy(PointCache *cache, int copy_data)
{
PointCache *ncache;
ncache= MEM_dupallocN(cache);
/* hmm, should these be copied over instead? */
ncache->mem_cache.first = NULL;
ncache->mem_cache.last = NULL;
ncache->cached_frames = NULL;
ncache->edit = NULL;
ncache->flag= 0;
ncache->simframe= 0;
if (copy_data == FALSE) {
ncache->mem_cache.first = NULL;
ncache->mem_cache.last = NULL;
ncache->cached_frames = NULL;
ncache->flag= 0;
ncache->simframe= 0;
}
else {
PTCacheMem *pm;
for (pm = cache->mem_cache.first; pm; pm = pm->next) {
PTCacheMem *pmn = MEM_dupallocN(pm);
int i;
for (i = 0; i < BPHYS_TOT_DATA; i++) {
if (pmn->data[i])
pmn->data[i] = MEM_dupallocN(pm->data[i]);
}
BKE_ptcache_mem_pointers_init(pm);
BLI_addtail(&ncache->mem_cache, pmn);
}
if (ncache->cached_frames)
ncache->cached_frames = MEM_dupallocN(cache->cached_frames);
}
/* hmm, should these be copied over instead? */
ncache->edit = NULL;
return ncache;
}
/* returns first point cache */
PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old)
PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old, int copy_data)
{
PointCache *cache = ptcaches_old->first;
ptcaches_new->first = ptcaches_new->last = NULL;
for (; cache; cache=cache->next)
BLI_addtail(ptcaches_new, ptcache_copy(cache));
BLI_addtail(ptcaches_new, ptcache_copy(cache, copy_data));
return ptcaches_new->first;
}

@ -390,7 +390,7 @@ Scene *BKE_scene_add(const char *name)
sce->r.edgeint = 10;
sce->r.ocres = 128;
/* OCIO_TODO: for forwards compatibiliy only, so if no tonecurve are used,
/* OCIO_TODO: for forwards compatibility only, so if no tonecurve are used,
* images would look in the same way as in current blender
*
* perhaps at some point should be completely deprecated?
@ -1274,9 +1274,11 @@ void BKE_scene_disable_color_management(Scene *scene)
ColorManagedDisplaySettings *display_settings = &scene->display_settings;
ColorManagedViewSettings *view_settings = &scene->view_settings;
const char *view;
const char *none_display_name;
/* NOTE: None display with Default view should always exist in OCIO configuration, otherwise it wouldn't work as expected */
BLI_strncpy(display_settings->display_device, "None", sizeof(display_settings->display_device));
none_display_name = IMB_colormanagement_display_get_none_name();
BLI_strncpy(display_settings->display_device, none_display_name, sizeof(display_settings->display_device));
view = IMB_colormanagement_view_get_default_name(display_settings->display_device);

@ -313,7 +313,7 @@ void BKE_sequencer_editing_free(Scene *scene)
static void sequencer_imbuf_assign_spaces(Scene *scene, ImBuf *ibuf)
{
IMB_colormanagement_imbuf_assign_float_space(ibuf, &scene->sequencer_colorspace_settings);
IMB_colormanagement_assign_float_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
}
void BKE_sequencer_imbuf_to_sequencer_space(Scene *scene, ImBuf *ibuf, int make_float)
@ -1835,8 +1835,6 @@ static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float cfra,
StripCrop c = {0};
StripTransform t = {0};
int sx, sy, dx, dy;
double xscale = 1.0;
double yscale = 1.0;
if (is_proxy_image) {
double f = seq_rendersize_to_scale_factor(context.preview_render_size);
@ -1853,14 +1851,6 @@ static ImBuf *input_preprocess(SeqRenderData context, Sequence *seq, float cfra,
t = *seq->strip->transform;
}
xscale = context.scene->r.xsch ? ((double) context.rectx / (double) context.scene->r.xsch) : 1.0;
yscale = context.scene->r.ysch ? ((double) context.recty / (double) context.scene->r.ysch) : 1.0;
c.left *= xscale; c.right *= xscale;
c.top *= yscale; c.bottom *= yscale;
t.xofs *= xscale; t.yofs *= yscale;
sx = ibuf->x - c.left - c.right;
sy = ibuf->y - c.top - c.bottom;
dx = sx;
@ -2186,7 +2176,7 @@ static ImBuf *seq_render_movieclip_strip(SeqRenderData context, Sequence *seq, f
memset(&user, 0, sizeof(MovieClipUser));
BKE_movieclip_user_set_frame(&user, nr + seq->anim_startofs);
BKE_movieclip_user_set_frame(&user, nr + seq->anim_startofs + seq->clip->start_frame);
user.render_size = MCLIP_PROXY_RENDER_SIZE_FULL;
@ -2583,17 +2573,19 @@ static ImBuf *do_render_strip_uncached(SeqRenderData context, Sequence *seq, flo
case SEQ_TYPE_MOVIECLIP:
{
ibuf = seq_render_movieclip_strip(context, seq, nr);
sequencer_imbuf_assign_spaces(context.scene, ibuf);
if (ibuf && use_preprocess) {
if (ibuf) {
/* duplicate frame so movie cache wouldn't be confused by sequencer's stuff */
ImBuf *i = IMB_dupImBuf(ibuf);
IMB_freeImBuf(ibuf);
ibuf = i;
if (ibuf->rect_float)
BKE_sequencer_imbuf_to_sequencer_space(context.scene, ibuf, FALSE);
copy_to_ibuf_still(context, seq, nr, ibuf);
}
copy_to_ibuf_still(context, seq, nr, ibuf);
break;
}

@ -151,7 +151,7 @@ typedef struct SB_thread_context {
#define SOFTGOALSNAP 0.999f
/* if bp-> goal is above make it a *forced follow original* and skip all ODE stuff for this bp
* removes *unnecessary* stiffnes from ODE system
* removes *unnecessary* stiffness from ODE system
*/
#define HEUNWARNLIMIT 1 /* 500 would be fine i think for detecting severe *stiff* stuff */
@ -3925,7 +3925,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
sst=PIL_check_seconds_timer();
/* Integration back in time is possible in theory, but pretty useless here.
* So we refuse to do so. Since we do not know anything about 'outside' canges
* So we refuse to do so. Since we do not know anything about 'outside' changes
* especially colliders we refuse to go more than 10 frames.
*/
if (dtime < 0 || dtime > 10.5f) return;

@ -48,6 +48,7 @@
#include "DNA_constraint_types.h"
#include "DNA_controller_types.h"
#include "DNA_actuator_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@ -528,6 +529,7 @@ void BKE_text_unlink(Main *bmain, Text *text)
SpaceLink *sl;
Object *ob;
bController *cont;
bActuator *act;
bConstraint *con;
short update;
@ -541,6 +543,15 @@ void BKE_text_unlink(Main *bmain, Text *text)
if (pc->text == text) pc->text = NULL;
}
}
/* game actuators */
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_2DFILTER) {
bTwoDFilterActuator *tfa;
tfa = act->data;
if (tfa->text == text) tfa->text = NULL;
}
}
/* pyconstraints */
update = 0;

@ -335,7 +335,7 @@ static void search_pixel_to_marker_unified(int frame_width, int frame_height,
}
/* Each marker has 5 coordinates associated with it that get warped with
* tracking: the four corners ("pattern_corners"), and the cernter ("pos").
* tracking: the four corners ("pattern_corners"), and the center ("pos").
* This function puts those 5 points into the appropriate frame for tracking
* (the "search" coordinate frame).
*/
@ -455,7 +455,7 @@ void BKE_tracking_clipboard_paste_tracks(MovieTracking *tracking, MovieTrackingO
/*********************** Tracks *************************/
static void tracking_marker_insert_disabled(MovieTrackingTrack *track, MovieTrackingMarker *ref_marker,
static void tracking_marker_insert_disabled(MovieTrackingTrack *track, const MovieTrackingMarker *ref_marker,
int before, int overwrite)
{
MovieTrackingMarker marker_new;
@ -2400,7 +2400,7 @@ static void tracking_insert_new_marker(MovieTrackingContext *context, MovieTrack
* if so -- create disabled marker before currently tracking "segment"
*/
tracking_marker_insert_disabled(track, &new_marker, !context->backwards, FALSE);
tracking_marker_insert_disabled(track, old_marker, !context->backwards, FALSE);
}
/* insert currently tracked marker */

@ -350,7 +350,7 @@ static int unit_as_string(char *str, int len_max, double value, int prec, bUnitC
/* Add unit prefix and strip zeros */
/* replace trailing zero's with spaces
* so the number is less complicated but allignment in a button wont
* so the number is less complicated but alignment in a button wont
* jump about while dragging */
i = len - 1;

@ -839,7 +839,7 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
* inter-frames (H.264 B-frames, for example), it can output the frames
* in a different order from the one it was given.
* For example, when sending frames 1, 2, 3, 4 to the encoder, it may write
* them in the order 1, 4, 2, 3 - first the two frames used for predition,
* them in the order 1, 4, 2, 3 - first the two frames used for prediction,
* and then the bidirectionally-predicted frames. What this means in practice
* is that the encoder may not immediately produce one output frame for each
* input frame. These delayed frames must be flushed before we close the
@ -914,8 +914,7 @@ void BKE_ffmpeg_filepath_get(char *string, RenderData *rd)
}
while (*fe) {
if (BLI_strcasecmp(string + strlen(string) - strlen(*fe), *fe) == 0)
{
if (BLI_strcasecmp(string + strlen(string) - strlen(*fe), *fe) == 0) {
break;
}
fe++;

@ -78,6 +78,8 @@ void quat_to_mat4(float mat[4][4], const float q[4]);
void mat3_to_quat(float q[4], float mat[3][3]);
void mat4_to_quat(float q[4], float mat[4][4]);
void tri_to_quat_ex(float quat[4], const float v1[3], const float v2[3], const float v3[3],
const float no_orig[3]);
void tri_to_quat(float q[4], const float a[3], const float b[3], const float c[3]);
void vec_to_quat(float q[4], const float vec[3], short axis, const short upflag);
/* note: v1 and v2 must be normalized */
@ -105,7 +107,7 @@ void single_axis_angle_to_mat3(float R[3][3], const char axis, const float angle
/****************************** Vector/Rotation ******************************/
/* old axis angle code */
/* TODO: the following calls should probably be depreceated sometime */
/* TODO: the following calls should probably be deprecated sometime */
/* conversion */
void vec_rot_to_mat3(float mat[3][3], const float vec[3], const float phi);

@ -705,8 +705,8 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array,
BVHNode *tmp = branches_array + 0;
tmp->parent = NULL;
/*Most of bvhtree code relies on 1-leaf trees having at least one branch
*We handle that special case here */
/* Most of bvhtree code relies on 1-leaf trees having at least one branch
* We handle that special case here */
if (num_leafs == 1) {
BVHNode *root = branches_array + 0;
refit_kdop_hull(tree, root, 0, num_leafs);

@ -364,7 +364,7 @@ static void rotate_right(DLRBT_Tree *tree, DLRBT_Node *root)
root_slot = &root->parent->right;
}
else
root_slot = ((DLRBT_Node **)&tree->root); /* &((DLRBT_Node*)tree->root); */
root_slot = ((DLRBT_Node **)&tree->root); /* &((DLRBT_Node *)tree->root); */
/* - pivot's right child becomes root's left child
* - root now becomes pivot's right child

@ -42,6 +42,9 @@
#include "zlib.h"
#ifdef WIN32
#ifdef __MINGW32__
#include <ctype.h>
#endif
#include <io.h>
# include "BLI_winstuff.h"
# include "BLI_callbacks.h"
@ -514,8 +517,9 @@ static int recursive_operation(const char *startfrom, const char *startto, Recur
}
if (ret != 0) {
while (i < n)
free(dirlist[i]);
while (i < n) {
free(dirlist[i++]);
}
break;
}
}

@ -1387,7 +1387,7 @@ int isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3],
}
/* find closest point to p on line through l1,l2 and return lambda,
* where (0 <= lambda <= 1) when cp is in the line segement l1,l2
* where (0 <= lambda <= 1) when cp is in the line segment l1,l2
*/
float closest_to_line_v3(float cp[3], const float p[3], const float l1[3], const float l2[3])
{
@ -1429,7 +1429,7 @@ float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2
return (dot_v2v2(u, h) / dot_v2v2(u, u));
}
/* ensyre the distance between these points is no greater then 'dist'
/* ensure the distance between these points is no greater then 'dist'
* if it is, scale then both into the center */
void limit_dist_v3(float v1[3], float v2[3], const float dist)
{
@ -1672,7 +1672,7 @@ static int point_in_slice(const float p[3], const float v1[3], const float l1[3]
* the room inside usually is rather small compared to R3 though still infinite
* useful for restricting (speeding up) searches
* e.g. all points of triangular prism are within the intersection of 3 'slices'
* onother trivial case : cube
* another trivial case : cube
* but see a 'spat' which is a deformed cube with paired parallel planes needs only 3 slices too
*/
float h, rp[3], cp[3], q[3];
@ -1992,8 +1992,8 @@ void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const flo
const float co[2], float w[4])
{
/* note: fabsf() here is not needed for convex quads (and not used in interp_weights_poly_v2).
* but in the case of concave/bowtie quads for the mask rasterizer it gives unreliable results
* without adding absf(). If this becomes an issue for more general useage we could have
* but in the case of concave/bow-tie quads for the mask rasterizer it gives unreliable results
* without adding absf(). If this becomes an issue for more general usage we could have
* this optional or use a different function - Campbell */
#define MEAN_VALUE_HALF_TAN_V2(_area, i1, i2) \
((_area = cross_v2v2(dirs[i1], dirs[i2])) != 0.0f ? \

@ -613,13 +613,21 @@ void add_qt_qtqt(float result[4], const float quat1[4], const float quat2[4], co
result[3] = quat1[3] + t * quat2[3];
}
void tri_to_quat(float quat[4], const float v1[3], const float v2[3], const float v3[3])
/* same as tri_to_quat() but takes pre-computed normal from the triangle
* used for ngons when we know their normal */
void tri_to_quat_ex(float quat[4], const float v1[3], const float v2[3], const float v3[3],
const float no_orig[3])
{
/* imaginary x-axis, y-axis triangle is being rotated */
float vec[3], q1[4], q2[4], n[3], si, co, angle, mat[3][3], imat[3][3];
/* move z-axis to face-normal */
#if 0
normal_tri_v3(vec, v1, v2, v3);
#else
copy_v3_v3(vec, no_orig);
(void)v3;
#endif
n[0] = vec[1];
n[1] = -vec[0];
@ -659,6 +667,13 @@ void tri_to_quat(float quat[4], const float v1[3], const float v2[3], const floa
mul_qt_qtqt(quat, q1, q2);
}
void tri_to_quat(float quat[4], const float v1[3], const float v2[3], const float v3[3])
{
float vec[3];
normal_tri_v3(vec, v1, v2, v3);
tri_to_quat_ex(quat, v1, v2, v3, vec);
}
void print_qt(const char *str, const float q[4])
{
printf("%s: %.3f %.3f %.3f %.3f\n", str, q[0], q[1], q[2], q[3]);
@ -843,7 +858,7 @@ void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float ang
}
/****************************** Vector/Rotation ******************************/
/* TODO: the following calls should probably be depreceated sometime */
/* TODO: the following calls should probably be deprecated sometime */
/* TODO, replace use of this function with axis_angle_to_mat3() */
void vec_rot_to_mat3(float mat[][3], const float vec[3], const float phi)

@ -58,11 +58,11 @@ static const char trailingBytesForUTF8[256] = {
int BLI_utf8_invalid_byte(const char *str, int length)
{
const unsigned char *p, *pend = (unsigned char*)str + length;
const unsigned char *p, *pend = (unsigned char *)str + length;
unsigned char c;
int ab;
for (p = (unsigned char*)str; p < pend; p++) {
for (p = (unsigned char *)str; p < pend; p++) {
c = *p;
if (c < 128)
continue;

@ -1000,7 +1000,7 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports)
gzfile = BLI_gzopen(filepath, "rb");
if (gzfile == (gzFile)Z_NULL) {
BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error reading file");
BKE_reportf(reports, RPT_WARNING, "Unable to open \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error reading file");
return NULL;
}
else {
@ -1018,7 +1018,7 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports)
FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports)
{
if (!mem || memsize<SIZEOFBLENDERHEADER) {
BKE_report(reports, RPT_ERROR, (mem)? "Unable to read": "Unable to open");
BKE_report(reports, RPT_WARNING, (mem)? "Unable to read": "Unable to open");
return NULL;
}
else {
@ -1035,7 +1035,7 @@ FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports)
FileData *blo_openblendermemfile(MemFile *memfile, ReportList *reports)
{
if (!memfile) {
BKE_report(reports, RPT_ERROR, "Unable to open blend <memory>");
BKE_report(reports, RPT_WARNING, "Unable to open blend <memory>");
return NULL;
}
else {
@ -1720,7 +1720,7 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
/* Legacy Data Support (for Version Patching) ----------------------------- */
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void lib_link_ipo(FileData *fd, Main *main)
{
Ipo *ipo;
@ -1737,7 +1737,7 @@ static void lib_link_ipo(FileData *fd, Main *main)
}
}
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void direct_link_ipo(FileData *fd, Ipo *ipo)
{
IpoCurve *icu;
@ -1751,7 +1751,7 @@ static void direct_link_ipo(FileData *fd, Ipo *ipo)
}
}
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void lib_link_nlastrips(FileData *fd, ID *id, ListBase *striplist)
{
bActionStrip *strip;
@ -1766,7 +1766,7 @@ static void lib_link_nlastrips(FileData *fd, ID *id, ListBase *striplist)
}
}
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void direct_link_nlastrips(FileData *fd, ListBase *strips)
{
bActionStrip *strip;
@ -1777,7 +1777,7 @@ static void direct_link_nlastrips(FileData *fd, ListBase *strips)
link_list(fd, &strip->modifiers);
}
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void lib_link_constraint_channels(FileData *fd, ID *id, ListBase *chanbase)
{
bConstraintChannel *chan;
@ -1948,12 +1948,12 @@ static void lib_link_action(FileData *fd, Main *main)
if (act->id.flag & LIB_NEED_LINK) {
act->id.flag -= LIB_NEED_LINK;
// XXX depreceated - old animation system <<<
// XXX deprecated - old animation system <<<
for (chan=act->chanbase.first; chan; chan=chan->next) {
chan->ipo = newlibadr_us(fd, act->id.lib, chan->ipo);
lib_link_constraint_channels(fd, &act->id, &chan->constraintChannels);
}
// >>> XXX depreceated - old animation system
// >>> XXX deprecated - old animation system
lib_link_fcurves(fd, &act->id, &act->curves);
}
@ -1962,21 +1962,21 @@ static void lib_link_action(FileData *fd, Main *main)
static void direct_link_action(FileData *fd, bAction *act)
{
bActionChannel *achan; // XXX depreceated - old animation system
bActionChannel *achan; // XXX deprecated - old animation system
bActionGroup *agrp;
link_list(fd, &act->curves);
link_list(fd, &act->chanbase); // XXX depreceated - old animation system
link_list(fd, &act->chanbase); // XXX deprecated - old animation system
link_list(fd, &act->groups);
link_list(fd, &act->markers);
// XXX depreceated - old animation system <<<
// XXX deprecated - old animation system <<<
for (achan = act->chanbase.first; achan; achan=achan->next) {
achan->grp = newdataadr(fd, achan->grp);
link_list(fd, &achan->constraintChannels);
}
// >>> XXX depreceated - old animation system
// >>> XXX deprecated - old animation system
direct_link_fcurves(fd, &act->curves);
@ -2489,7 +2489,7 @@ static void lib_link_constraints(FileData *fd, ID *id, ListBase *conlist)
con->type = CONSTRAINT_TYPE_NULL;
}
/* own ipo, all constraints have it */
con->ipo = newlibadr_us(fd, id->lib, con->ipo); // XXX depreceated - old animation system
con->ipo = newlibadr_us(fd, id->lib, con->ipo); // XXX deprecated - old animation system
}
/* relink all ID-blocks used by the constraints */
@ -2648,7 +2648,7 @@ static void lib_link_camera(FileData *fd, Main *main)
if (ca->id.flag & LIB_NEED_LINK) {
if (ca->adt) lib_link_animdata(fd, &ca->id, ca->adt);
ca->ipo = newlibadr_us(fd, ca->id.lib, ca->ipo); // XXX depreceated - old animation system
ca->ipo = newlibadr_us(fd, ca->id.lib, ca->ipo); // XXX deprecated - old animation system
ca->dof_ob = newlibadr_us(fd, ca->id.lib, ca->dof_ob);
@ -2684,7 +2684,7 @@ static void lib_link_lamp(FileData *fd, Main *main)
}
}
la->ipo = newlibadr_us(fd, la->id.lib, la->ipo); // XXX depreceated - old animation system
la->ipo = newlibadr_us(fd, la->id.lib, la->ipo); // XXX deprecated - old animation system
if (la->nodetree)
lib_link_ntree(fd, &la->id, la->nodetree);
@ -2741,7 +2741,7 @@ static void lib_link_key(FileData *fd, Main *main)
if (key->id.flag & LIB_NEED_LINK) {
if (key->adt) lib_link_animdata(fd, &key->id, key->adt);
key->ipo = newlibadr_us(fd, key->id.lib, key->ipo); // XXX depreceated - old animation system
key->ipo = newlibadr_us(fd, key->id.lib, key->ipo); // XXX deprecated - old animation system
key->from = newlibadr(fd, key->id.lib, key->from);
key->id.flag -= LIB_NEED_LINK;
@ -2811,7 +2811,7 @@ static void lib_link_mball(FileData *fd, Main *main)
for (a = 0; a < mb->totcol; a++)
mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]);
mb->ipo = newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX depreceated - old animation system
mb->ipo = newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX deprecated - old animation system
mb->id.flag -= LIB_NEED_LINK;
}
@ -2847,7 +2847,7 @@ static void lib_link_world(FileData *fd, Main *main)
if (wrld->id.flag & LIB_NEED_LINK) {
if (wrld->adt) lib_link_animdata(fd, &wrld->id, wrld->adt);
wrld->ipo = newlibadr_us(fd, wrld->id.lib, wrld->ipo); // XXX depreceated - old animation system
wrld->ipo = newlibadr_us(fd, wrld->id.lib, wrld->ipo); // XXX deprecated - old animation system
for (a=0; a < MAX_MTEX; a++) {
mtex = wrld->mtex[a];
@ -3048,7 +3048,7 @@ static void lib_link_curve(FileData *fd, Main *main)
cu->vfonti = newlibadr_us(fd, cu->id.lib, cu->vfonti);
cu->vfontbi = newlibadr_us(fd, cu->id.lib, cu->vfontbi);
cu->ipo = newlibadr_us(fd, cu->id.lib, cu->ipo); // XXX depreceated - old animation system
cu->ipo = newlibadr_us(fd, cu->id.lib, cu->ipo); // XXX deprecated - old animation system
cu->key = newlibadr_us(fd, cu->id.lib, cu->key);
cu->id.flag -= LIB_NEED_LINK;
@ -3348,7 +3348,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
for (part = main->particle.first; part; part = part->id.next) {
if (part->id.flag & LIB_NEED_LINK) {
if (part->adt) lib_link_animdata(fd, &part->id, part->adt);
part->ipo = newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system
part->ipo = newlibadr_us(fd, part->id.lib, part->ipo); // XXX deprecated - old animation system
part->dup_ob = newlibadr(fd, part->id.lib, part->dup_ob);
part->dup_group = newlibadr(fd, part->id.lib, part->dup_group);
@ -3938,7 +3938,7 @@ static void lib_link_latt(FileData *fd, Main *main)
if (lt->id.flag & LIB_NEED_LINK) {
if (lt->adt) lib_link_animdata(fd, &lt->id, lt->adt);
lt->ipo = newlibadr_us(fd, lt->id.lib, lt->ipo); // XXX depreceated - old animation system
lt->ipo = newlibadr_us(fd, lt->id.lib, lt->ipo); // XXX deprecated - old animation system
lt->key = newlibadr_us(fd, lt->id.lib, lt->key);
lt->id.flag -= LIB_NEED_LINK;
@ -3992,10 +3992,10 @@ static void lib_link_object(FileData *fd, Main *main)
if (ob->id.properties) IDP_LibLinkProperty(ob->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
if (ob->adt) lib_link_animdata(fd, &ob->id, ob->adt);
// XXX depreceated - old animation system <<<
// XXX deprecated - old animation system <<<
ob->ipo = newlibadr_us(fd, ob->id.lib, ob->ipo);
ob->action = newlibadr_us(fd, ob->id.lib, ob->action);
// >>> XXX depreceated - old animation system
// >>> XXX deprecated - old animation system
ob->parent = newlibadr(fd, ob->id.lib, ob->parent);
ob->track = newlibadr(fd, ob->id.lib, ob->track);
@ -4074,10 +4074,10 @@ static void lib_link_object(FileData *fd, Main *main)
lib_link_pose(fd, ob, ob->pose);
lib_link_constraints(fd, &ob->id, &ob->constraints);
// XXX depreceated - old animation system <<<
// XXX deprecated - old animation system <<<
lib_link_constraint_channels(fd, &ob->id, &ob->constraintChannels);
lib_link_nlastrips(fd, &ob->id, &ob->nlastrips);
// >>> XXX depreceated - old animation system
// >>> XXX deprecated - old animation system
for (paf = ob->effect.first; paf; paf = paf->next) {
if (paf->type == EFF_PARTICLE) {
@ -4538,10 +4538,10 @@ static void direct_link_object(FileData *fd, Object *ob)
direct_link_motionpath(fd, ob->mpath);
link_list(fd, &ob->defbase);
// XXX depreceated - old animation system <<<
// XXX deprecated - old animation system <<<
direct_link_nlastrips(fd, &ob->nlastrips);
link_list(fd, &ob->constraintChannels);
// >>> XXX depreceated - old animation system
// >>> XXX deprecated - old animation system
ob->mat= newdataadr(fd, ob->mat);
test_pointer_array(fd, (void **)&ob->mat);
@ -4783,7 +4783,7 @@ static void lib_link_scene(FileData *fd, Main *main)
base->object = newlibadr_us(fd, sce->id.lib, base->object);
if (base->object == NULL) {
BKE_reportf_wrap(fd->reports, RPT_ERROR,
BKE_reportf_wrap(fd->reports, RPT_WARNING,
"LIB ERROR: Object lost from scene:'%s\'",
sce->id.name + 2);
BLI_remlink(&sce->base, base);
@ -6144,7 +6144,7 @@ static void lib_link_sound(FileData *fd, Main *main)
for (sound = main->sound.first; sound; sound = sound->id.next) {
if (sound->id.flag & LIB_NEED_LINK) {
sound->id.flag -= LIB_NEED_LINK;
sound->ipo = newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system
sound->ipo = newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX deprecated - old animation system
sound_load(main, sound);
}
@ -8254,7 +8254,7 @@ static void lib_link_all(FileData *fd, Main *main)
lib_link_material(fd, main);
lib_link_texture(fd, main);
lib_link_image(fd, main);
lib_link_ipo(fd, main); // XXX depreceated... still needs to be maintained for version patches still
lib_link_ipo(fd, main); // XXX deprecated... still needs to be maintained for version patches still
lib_link_key(fd, main);
lib_link_world(fd, main);
lib_link_lamp(fd, main);
@ -8591,7 +8591,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void expand_ipo(FileData *fd, Main *mainvar, Ipo *ipo)
{
IpoCurve *icu;
@ -8601,7 +8601,7 @@ static void expand_ipo(FileData *fd, Main *mainvar, Ipo *ipo)
}
}
// XXX depreceated - old animation system
// XXX deprecated - old animation system
static void expand_constraint_channels(FileData *fd, Main *mainvar, ListBase *chanbase)
{
bConstraintChannel *chan;
@ -8657,7 +8657,7 @@ static void expand_action(FileData *fd, Main *mainvar, bAction *act)
{
bActionChannel *chan;
// XXX depreceated - old animation system --------------
// XXX deprecated - old animation system --------------
for (chan=act->chanbase.first; chan; chan=chan->next) {
expand_doit(fd, mainvar, chan->ipo);
expand_constraint_channels(fd, mainvar, &chan->constraintChannels);
@ -8747,7 +8747,7 @@ static void expand_group(FileData *fd, Main *mainvar, Group *group)
static void expand_key(FileData *fd, Main *mainvar, Key *key)
{
expand_doit(fd, mainvar, key->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, key->ipo); // XXX deprecated - old animation system
if (key->adt)
expand_animdata(fd, mainvar, key->adt);
@ -8773,7 +8773,7 @@ static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
static void expand_texture(FileData *fd, Main *mainvar, Tex *tex)
{
expand_doit(fd, mainvar, tex->ima);
expand_doit(fd, mainvar, tex->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, tex->ipo); // XXX deprecated - old animation system
if (tex->adt)
expand_animdata(fd, mainvar, tex->adt);
@ -8799,7 +8799,7 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma)
}
}
expand_doit(fd, mainvar, ma->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, ma->ipo); // XXX deprecated - old animation system
if (ma->adt)
expand_animdata(fd, mainvar, ma->adt);
@ -8822,7 +8822,7 @@ static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la)
}
}
expand_doit(fd, mainvar, la->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, la->ipo); // XXX deprecated - old animation system
if (la->adt)
expand_animdata(fd, mainvar, la->adt);
@ -8833,7 +8833,7 @@ static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la)
static void expand_lattice(FileData *fd, Main *mainvar, Lattice *lt)
{
expand_doit(fd, mainvar, lt->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, lt->ipo); // XXX deprecated - old animation system
expand_doit(fd, mainvar, lt->key);
if (lt->adt)
@ -8852,7 +8852,7 @@ static void expand_world(FileData *fd, Main *mainvar, World *wrld)
}
}
expand_doit(fd, mainvar, wrld->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, wrld->ipo); // XXX deprecated - old animation system
if (wrld->adt)
expand_animdata(fd, mainvar, wrld->adt);
@ -8887,7 +8887,7 @@ static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
expand_doit(fd, mainvar, cu->vfonti);
expand_doit(fd, mainvar, cu->vfontbi);
expand_doit(fd, mainvar, cu->key);
expand_doit(fd, mainvar, cu->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, cu->ipo); // XXX deprecated - old animation system
expand_doit(fd, mainvar, cu->bevobj);
expand_doit(fd, mainvar, cu->taperobj);
expand_doit(fd, mainvar, cu->textoncurve);
@ -8976,10 +8976,10 @@ static void expand_constraints(FileData *fd, Main *mainvar, ListBase *lb)
id_loop_constraints(lb, expand_constraint_cb, &ced);
/* depreceated manual expansion stuff */
/* deprecated manual expansion stuff */
for (curcon = lb->first; curcon; curcon = curcon->next) {
if (curcon->ipo)
expand_doit(fd, mainvar, curcon->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, curcon->ipo); // XXX deprecated - old animation system
}
}
@ -9061,7 +9061,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
expand_doit(fd, mainvar, ob->gpd);
// XXX depreceated - old animation system (for version patching only)
// XXX deprecated - old animation system (for version patching only)
expand_doit(fd, mainvar, ob->ipo);
expand_doit(fd, mainvar, ob->action);
@ -9072,7 +9072,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
expand_doit(fd, mainvar, strip->act);
expand_doit(fd, mainvar, strip->ipo);
}
// XXX depreceated - old animation system (for version patching only)
// XXX deprecated - old animation system (for version patching only)
if (ob->adt)
expand_animdata(fd, mainvar, ob->adt);
@ -9251,7 +9251,7 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
static void expand_camera(FileData *fd, Main *mainvar, Camera *ca)
{
expand_doit(fd, mainvar, ca->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, ca->ipo); // XXX deprecated - old animation system
if (ca->adt)
expand_animdata(fd, mainvar, ca->adt);
@ -9267,7 +9267,7 @@ static void expand_speaker(FileData *fd, Main *mainvar, Speaker *spk)
static void expand_sound(FileData *fd, Main *mainvar, bSound *snd)
{
expand_doit(fd, mainvar, snd->ipo); // XXX depreceated - old animation system
expand_doit(fd, mainvar, snd->ipo); // XXX deprecated - old animation system
}
static void expand_movieclip(FileData *fd, Main *mainvar, MovieClip *clip)
@ -9390,7 +9390,7 @@ static void expand_main(FileData *fd, Main *mainvar)
expand_armature(fd, mainvar, (bArmature *)id);
break;
case ID_AC:
expand_action(fd, mainvar, (bAction *)id); // XXX depreceated - old animation system
expand_action(fd, mainvar, (bAction *)id); // XXX deprecated - old animation system
break;
case ID_GR:
expand_group(fd, mainvar, (Group *)id);
@ -9402,7 +9402,7 @@ static void expand_main(FileData *fd, Main *mainvar)
expand_brush(fd, mainvar, (Brush *)id);
break;
case ID_IP:
expand_ipo(fd, mainvar, (Ipo *)id); // XXX depreceated - old animation system
expand_ipo(fd, mainvar, (Ipo *)id); // XXX deprecated - old animation system
break;
case ID_PA:
expand_particlesettings(fd, mainvar, (ParticleSettings *)id);
@ -9844,7 +9844,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
else mainptr->curlib->filedata = NULL;
if (fd == NULL) {
BKE_reportf_wrap(basefd->reports, RPT_ERROR,
BKE_reportf_wrap(basefd->reports, RPT_WARNING,
"Can't find lib '%s'",
mainptr->curlib->filepath);
}
@ -9863,7 +9863,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
append_id_part(fd, mainptr, id, &realid);
if (!realid) {
BKE_reportf_wrap(fd->reports, RPT_ERROR,
BKE_reportf_wrap(fd->reports, RPT_WARNING,
"LIB ERROR: %s:'%s' missing from '%s'",
BKE_idcode_to_name(GS(id->name)),
id->name+2, mainptr->curlib->filepath);
@ -9895,7 +9895,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
idn = id->next;
if (id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
BKE_reportf_wrap(basefd->reports, RPT_ERROR,
BKE_reportf_wrap(basefd->reports, RPT_WARNING,
"LIB ERROR: %s:'%s' unread libblock missing from '%s'",
BKE_idcode_to_name(GS(id->name)), id->name + 2, mainptr->curlib->filepath);
change_idid_adr(mainlist, basefd, id, NULL);

@ -665,7 +665,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
/* Verts' pointers, only edge pointers... */
if (eptr_map) {
BM_ITER_MESH (ve, &iter, bm, BM_VERTS_OF_MESH) {
/* printf("Vert e: %p -> %p\n", ve->e, BLI_ghash_lookup(eptr_map, (const void*)ve->e));*/
/* printf("Vert e: %p -> %p\n", ve->e, BLI_ghash_lookup(eptr_map, (const void *)ve->e));*/
ve->e = BLI_ghash_lookup(eptr_map, (const void *)ve->e);
}
}
@ -675,20 +675,20 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
if (vptr_map || eptr_map) {
BM_ITER_MESH (ed, &iter, bm, BM_EDGES_OF_MESH) {
if (vptr_map) {
/* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, (const void*)ed->v1));*/
/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void*)ed->v2));*/
/* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, (const void *)ed->v1));*/
/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void* )ed->v2));*/
ed->v1 = BLI_ghash_lookup(vptr_map, (const void *)ed->v1);
ed->v2 = BLI_ghash_lookup(vptr_map, (const void *)ed->v2);
}
if (eptr_map) {
/* printf("Edge v1_disk_link prev: %p -> %p\n", ed->v1_disk_link.prev,*/
/* BLI_ghash_lookup(eptr_map, (const void*)ed->v1_disk_link.prev));*/
/* BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.prev));*/
/* printf("Edge v1_disk_link next: %p -> %p\n", ed->v1_disk_link.next,*/
/* BLI_ghash_lookup(eptr_map, (const void*)ed->v1_disk_link.next));*/
/* BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.next));*/
/* printf("Edge v2_disk_link prev: %p -> %p\n", ed->v2_disk_link.prev,*/
/* BLI_ghash_lookup(eptr_map, (const void*)ed->v2_disk_link.prev));*/
/* BLI_ghash_lookup(eptr_map, (const void *)ed->v2_disk_link.prev));*/
/* printf("Edge v2_disk_link next: %p -> %p\n", ed->v2_disk_link.next,*/
/* BLI_ghash_lookup(eptr_map, (const void*)ed->v2_disk_link.next));*/
/* BLI_ghash_lookup(eptr_map, (const void *)ed->v2_disk_link.next));*/
ed->v1_disk_link.prev = BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.prev);
ed->v1_disk_link.next = BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.next);
ed->v2_disk_link.prev = BLI_ghash_lookup(eptr_map, (const void *)ed->v2_disk_link.prev);
@ -701,15 +701,15 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
BM_ITER_MESH (fa, &iter, bm, BM_FACES_OF_MESH) {
BM_ITER_ELEM (lo, &iterl, fa, BM_LOOPS_OF_FACE) {
if (vptr_map) {
/* printf("Loop v: %p -> %p\n", lo->v, BLI_ghash_lookup(vptr_map, (const void*)lo->v));*/
/* printf("Loop v: %p -> %p\n", lo->v, BLI_ghash_lookup(vptr_map, (const void *)lo->v));*/
lo->v = BLI_ghash_lookup(vptr_map, (const void *)lo->v);
}
if (eptr_map) {
/* printf("Loop e: %p -> %p\n", lo->e, BLI_ghash_lookup(eptr_map, (const void*)lo->e));*/
/* printf("Loop e: %p -> %p\n", lo->e, BLI_ghash_lookup(eptr_map, (const void *)lo->e));*/
lo->e = BLI_ghash_lookup(eptr_map, (const void *)lo->e);
}
if (fptr_map) {
/* printf("Loop f: %p -> %p\n", lo->f, BLI_ghash_lookup(fptr_map, (const void*)lo->f));*/
/* printf("Loop f: %p -> %p\n", lo->f, BLI_ghash_lookup(fptr_map, (const void *)lo->f));*/
lo->f = BLI_ghash_lookup(fptr_map, (const void *)lo->f);
}
}

@ -380,8 +380,9 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
/* compute summed length between vertices in forward direction */
len = 0.0f;
for (j = 0; j < lenv2; j++)
len += len_v3v3(vv1[clamp_index(i+j, lenv1)]->co, vv2[j]->co);
for (j = 0; j < lenv2; j++) {
len += len_v3v3(vv1[clamp_index(i + j, lenv1)]->co, vv2[j]->co);
}
if (len < min) {
min = len;
@ -390,8 +391,9 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
/* compute summed length between vertices in backward direction */
len = 0.0f;
for (j = 0; j < lenv2; j++)
len += len_v3v3(vv1[clamp_index(i-j, lenv1)]->co, vv2[j]->co);
for (j = 0; j < lenv2; j++) {
len += len_v3v3(vv1[clamp_index(i - j, lenv1)]->co, vv2[j]->co);
}
if (len < min) {
min = len;

@ -1223,7 +1223,7 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op)
v4 = BM_vert_in_edge(edges2[i - 1], edges2[i]->v1) ? edges2[i]->v2 : edges2[i]->v1;
}
/* if there is ever bowtie quads between two edges the problem is here! [#30367] */
/* if there is ever bow-tie quads between two edges the problem is here! [#30367] */
#if 0
normal_tri_v3(dvec1, v1->co, v2->co, v4->co);
normal_tri_v3(dvec2, v1->co, v4->co, v3->co);

@ -163,8 +163,8 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do
};
if (lcol[0]) {
if (!compare_rgb_uchar((unsigned char*)&lcol[0]->r, (unsigned char*)&lcol[2]->r, T2QCOL_LIMIT) ||
!compare_rgb_uchar((unsigned char*)&lcol[1]->r, (unsigned char*)&lcol[3]->r, T2QCOL_LIMIT))
if (!compare_rgb_uchar((unsigned char *)&lcol[0]->r, (unsigned char *)&lcol[2]->r, T2QCOL_LIMIT) ||
!compare_rgb_uchar((unsigned char *)&lcol[1]->r, (unsigned char *)&lcol[3]->r, T2QCOL_LIMIT))
{
return FALSE;
}

@ -309,7 +309,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
phid /= 2;
for (a = 0; a <= tot; a++) {
/* Going in this direction, then edge extruding, makes normals face outward */
vec[0] = -dia *sinf(phi);
vec[0] = -dia * sinf(phi);
vec[1] = 0.0;
vec[2] = dia * cosf(phi);
eve = BM_vert_create(bm, vec, NULL);
@ -354,7 +354,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
{
float len, len2, vec2[3];
len = 2 *dia *sinf(phid / 2.0f);
len = 2 *dia * sinf(phid / 2.0f);
/* length of one segment in shortest parallen */
vec[0] = dia * sinf(phid);
@ -517,16 +517,16 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
phi = 0;
if (cap_ends) {
vec[0] = vec[1] = 0.0f;
vec[2] = 0.0;
zero_v3(vec);
mul_m4_v3(mat, vec);
cent1 = BM_vert_create(bm, vec, NULL);
BMO_elem_flag_enable(bm, cent1, VERT_MARK);
}
for (a = 0; a < segs; a++, phi += phid) {
/* Going this way ends up with normal(s) upward */
vec[0] = -dia *sinf(phi);
vec[0] = -dia * sinf(phi);
vec[1] = dia * cosf(phi);
vec[2] = 0.0f;
mul_m4_v3(mat, vec);

@ -53,6 +53,9 @@
#define ELE_INNER 8
#define ELE_SPLIT 16
/* see bug [#32665], 0.00005 means a we get face splits at a little under 1.0 degrees */
#define FLT_FACE_SPLIT_EPSILON 0.00005
/*
* NOTE: beauty has been renamed to flag!
*/
@ -823,16 +826,12 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
/* make sure the two edges have a valid angle to each other */
if (totesel == 2 && BM_edge_share_vert_count(e1, e2)) {
float angle;
sub_v3_v3v3(vec1, e1->v2->co, e1->v1->co);
sub_v3_v3v3(vec2, e2->v2->co, e2->v1->co);
normalize_v3(vec1);
normalize_v3(vec2);
angle = dot_v3v3(vec1, vec2);
angle = fabsf(angle);
if (fabsf(angle - 1.0f) < 0.01f) {
if (fabsf(dot_v3v3(vec1, vec2)) > 1.0f - FLT_FACE_SPLIT_EPSILON) {
totesel = 0;
}
}

@ -210,7 +210,7 @@ void DocumentImporter::finish()
}
mesh_importer.optimize_material_assignements();
mesh_importer.optimize_material_assignments();
armature_importer.set_tags_map(this->uid_tags_map);
armature_importer.make_armatures(mContext);

@ -1061,7 +1061,7 @@ std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh)
*
* During import all materials have been assigned to Object.
* Now we iterate over the imported objects and optimize
* the assignements as follows:
* the assignments as follows:
*
* for each imported geometry:
* if number of users is 1:
@ -1075,7 +1075,7 @@ std::vector<Object *> MeshImporter::get_all_users_of(Mesh *reference_mesh)
* adjust all other users accordingly.
*
**/
void MeshImporter::optimize_material_assignements()
void MeshImporter::optimize_material_assignments()
{
for (std::vector<Object *>::iterator it = imported_objects.begin();
it != imported_objects.end(); ++it)
@ -1119,7 +1119,7 @@ void MeshImporter::optimize_material_assignements()
* come along with different materials. So we first create the objects
* and assign the materials to Object, then in a later cleanup we decide
* which materials shall be moved to the created geometries. Also see
* optimize_material_assignements() above.
* optimize_material_assignments() above.
*/
MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial,
std::map<COLLADAFW::UniqueId, Material *>& uid_material_map,

@ -106,10 +106,10 @@ private:
#endif
void set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
COLLADAFW::IndexList& index_list, unsigned int *tris_indices);
COLLADAFW::IndexList& index_list, unsigned int *tris_indices);
void set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
COLLADAFW::IndexList& index_list, int index, bool quad);
COLLADAFW::IndexList& index_list, int index, bool quad);
#ifdef COLLADA_DEBUG
void print_index_list(COLLADAFW::IndexList& index_list);
@ -132,7 +132,7 @@ private:
CustomData create_edge_custom_data(EdgeHash *eh);
void allocate_face_data(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris);
void allocate_face_data(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris);
// TODO: import uv set names
void read_faces(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris);
@ -153,22 +153,22 @@ public:
virtual Object *get_object_by_geom_uid(const COLLADAFW::UniqueId& geom_uid);
MTex *assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture,
Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
MTex *color_texture);
Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map,
MTex *color_texture);
void optimize_material_assignements();
void optimize_material_assignments();
MTFace *assign_material_to_geom(COLLADAFW::MaterialBinding cmaterial,
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
Object *ob, const COLLADAFW::UniqueId *geom_uid,
MTex **color_texture, char *layername, MTFace *texture_face,
std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
Object *ob, const COLLADAFW::UniqueId *geom_uid,
MTex **color_texture, char *layername, MTFace *texture_face,
std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
Object *create_mesh_object(COLLADAFW::Node *node, COLLADAFW::InstanceGeometry *geom,
bool isController,
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map);
bool isController,
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map);
// create a mesh storing a pointer in a map so it can be retrieved later by geometry UID
bool write_geometry(const COLLADAFW::Geometry* geom);

@ -49,7 +49,8 @@ void ExecutionSystemHelper::addbNodeTree(ExecutionSystem &system, int nodes_star
/* add all nodes of the tree to the node list */
bNode *node = (bNode *)tree->nodes.first;
while (node != NULL) {
addNode(nodes, node, isActiveGroup, system.getContext().isFastCalculation());
Node *nnode = addNode(nodes, node, isActiveGroup, system.getContext().isFastCalculation());
nnode->setbNodeGroup(groupnode);
node = (bNode *)node->next;
}

@ -54,6 +54,12 @@ private:
*/
bool m_inActiveGroup;
/**
* @brief The group node this node belongs to.
* @note: used to find the links in the current subtree for muting nodes
*/
bNode* m_bNodeGroup;
public:
Node(bNode *editorNode, bool create_sockets = true);
@ -134,6 +140,9 @@ public:
* @param socket
*/
OutputSocket *findOutputSocketBybNodeSocket(bNodeSocket *socket);
inline void setbNodeGroup(bNode* group) {this->m_bNodeGroup = group;}
inline bNode* getbNodeGroup() {return this->m_bNodeGroup;}
protected:
void addPreviewOperation(ExecutionSystem *system, CompositorContext *context, InputSocket *inputSocket);
void addPreviewOperation(ExecutionSystem *system, CompositorContext *context, OutputSocket *outputSocket);

@ -111,11 +111,18 @@ void MuteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
if ((editorNode->flag & NODE_MUTED) && editorNode->typeinfo->internal_connect) {
vector<InputSocket *> &inputsockets = this->getInputSockets();
vector<OutputSocket *> relinkedsockets;
bNodeTree *editorTree = (bNodeTree *) context->getbNodeTree();
bNodeTree *editorTree;
SocketMap socketMap;
ListBase intlinks;
bNodeLink *link;
if (this->getbNodeGroup()) {
editorTree = (bNodeTree *) getbNodeGroup()->id;
}
else {
editorTree = (bNodeTree *) context->getbNodeTree();
}
intlinks = editorNode->typeinfo->internal_connect(editorTree, editorNode);
this->fillSocketMap<OutputSocket>(outputsockets, socketMap);

@ -138,7 +138,8 @@ void OutputSingleLayerOperation::deinitExecution()
ibuf->mall |= IB_rectfloat;
ibuf->dither = this->m_rd->dither_intensity;
IMB_display_buffer_to_imbuf_rect(ibuf, m_viewSettings, m_displaySettings);
IMB_colormanagement_imbuf_for_write(ibuf, TRUE, FALSE, m_viewSettings, m_displaySettings,
this->m_format);
BKE_makepicstring(filename, this->m_path, bmain->name, this->m_rd->cfra, this->m_format->imtype,
(this->m_rd->scemode & R_EXTENSION), true);

@ -504,7 +504,7 @@ static int ed_markers_poll_markers_exist(bContext *C)
* "custom"/third-tier invoke() callback supplied as the last arg (which would normally
* be the operator's invoke() callback elsewhere)
*
* < invoke_func: (fn(bContext*, wmOperator*, wmEvent*)=int) "standard" invoke function
* < invoke_func: (fn(bContext *, wmOperator *, wmEvent *)=int) "standard" invoke function
* that operator would otherwise have used. If NULL, the operator's standard
* exec() callback will be called instead in the appropriate places.
*/

@ -4842,7 +4842,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable_cb);
/* create an array of pointers to the deform groups that
* coorespond to the skinnable bones (creating them
* correspond to the skinnable bones (creating them
* as necessary. */
dgrouplist = MEM_callocN(numbones * sizeof(bDeformGroup *), "dgrouplist");
dgroupflip = MEM_callocN(numbones * sizeof(bDeformGroup *), "dgroupflip");

@ -757,8 +757,8 @@ void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, short only3d)
{
bGPdata *gpd;
int dflag = 0;
rcti rect;
RegionView3D *rv3d = ar->regiondata;
int offsx, offsy, winx, winy;
/* check that we have grease-pencil stuff to draw */
gpd = gpencil_data_get_active_v3d(scene); // XXX
@ -769,19 +769,23 @@ void draw_gpencil_view3d(Scene *scene, View3D *v3d, ARegion *ar, short only3d)
if ((rv3d->persp == RV3D_CAMOB) && !(G.f & G_RENDER_OGL)) {
rctf rectf;
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &rectf, TRUE); /* no shift */
BLI_rcti_rctf_copy(&rect, &rectf);
offsx = floorf(rectf.xmin + 0.5f);
offsy = floorf(rectf.ymin + 0.5f);
winx = floorf((rectf.xmax - rectf.xmin) + 0.5f);
winy = floorf((rectf.ymax - rectf.ymin) + 0.5f);
}
else {
rect.xmin = 0;
rect.ymin = 0;
rect.xmax = ar->winx;
rect.ymax = ar->winy;
offsx = 0;
offsy = 0;
winx = ar->winx;
winy = ar->winy;
}
/* draw it! */
if (only3d) dflag |= (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_NOSTATUS);
gp_draw_data(gpd, rect.xmin, rect.ymin, rect.xmax, rect.ymax, CFRA, dflag);
gp_draw_data(gpd, offsx, offsy, winx, winy, CFRA, dflag);
}
/* ************************************************** */

@ -1736,25 +1736,32 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, wmEvent *event)
//printf("\tGP - handle modal event...\n");
/* exit painting mode (and/or end current stroke) */
if (ELEM5(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY, RIGHTMOUSE)) {
/* exit painting mode (and/or end current stroke)
* NOTE: cannot do RIGHTMOUSE (as is standard for cancelling) as that would break polyline [#32647]
*/
if (ELEM4(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY)) {
/* exit() ends the current stroke before cleaning up */
//printf("\t\tGP - end of paint op + end of stroke\n");
p->status = GP_STATUS_DONE;
estate = OPERATOR_FINISHED;
}
/* toggle painting mode upon mouse-button movement */
if (event->type == LEFTMOUSE) {
/* toggle painting mode upon mouse-button movement
* - LEFTMOUSE = standard drawing (all) / straight line drawing (all) / polyline (toolbox only)
* - RIGHTMOUSE = polyline (hotkey) / eraser (all)
* (Disabling RIGHTMOUSE case here results in bugs like [#32647])
*/
if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE)) {
/* if painting, end stroke */
if (p->status == GP_STATUS_PAINTING) {
int sketch = 0;
/* basically, this should be mouse-button up = end stroke
* BUT what happens next depends on whether we 'painting sessions' is enabled
*/
sketch |= GPENCIL_SKETCH_SESSIONS_ON(p->scene);
/* polyline drawing is also 'sketching' -- all knots should be added during one session */
sketch |= p->paintmode == GP_PAINTMODE_DRAW_POLY;
sketch |= (p->paintmode == GP_PAINTMODE_DRAW_POLY);
if (sketch) {
/* end stroke only, and then wait to resume painting soon */

@ -79,6 +79,7 @@ struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em);
void EDBM_mesh_ensure_valid_dm_hack(struct Scene *scene, struct BMEditMesh *em);
void EDBM_mesh_normals_update(struct BMEditMesh *em);
void EDBM_mesh_clear(struct BMEditMesh *em);

@ -86,7 +86,7 @@ extern struct EnumPropertyItem prop_clear_parent_types[];
extern struct EnumPropertyItem prop_make_parent_types[];
int ED_object_parent_set(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob,
struct Object *par, int partype, int xmirror);
struct Object *par, int partype, int xmirror, int keep_transform);
void ED_object_parent_clear(struct Object *ob, int type);
struct Base *ED_object_scene_link(struct Scene *scene, struct Object *ob);

@ -954,12 +954,12 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
static float polar_to_x(float center, float diam, float ampli, float angle)
{
return center + diam *ampli *cosf(angle);
return center + diam *ampli * cosf(angle);
}
static float polar_to_y(float center, float diam, float ampli, float angle)
{
return center + diam *ampli *sinf(angle);
return center + diam *ampli * sinf(angle);
}
static void vectorscope_draw_target(float centerx, float centery, float diam, const float colf[3])

@ -852,7 +852,7 @@ static void ui_add_smart_controller(bContext *C, uiBut *from, uiBut *to)
RNA_pointer_create((ID *)ob, &RNA_Object, ob, &object_ptr);
WM_operator_properties_create(&props_ptr, "LOGIC_OT_controller_add");
RNA_string_set(&props_ptr, "object", ob->id.name+2);
RNA_string_set(&props_ptr, "object", ob->id.name + 2);
/* (3) add a new controller */
if (WM_operator_name_call(C, "LOGIC_OT_controller_add", WM_OP_EXEC_DEFAULT, &props_ptr) & OPERATOR_FINISHED) {
@ -1368,7 +1368,7 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
while (TRUE) {
/* XXX does not take zoom level into account */
cdist = startx + aspect_sqrt *BLF_width(fstyle->uifont_id, origstr + but->ofs);
cdist = startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr + but->ofs);
/* check if position is found */
if (cdist < x) {
@ -4707,8 +4707,8 @@ static int ui_but_menu(bContext *C, uiBut *but)
/* Property Operators */
/*Copy Property Value
*Paste Property Value */
/* Copy Property Value
* Paste Property Value */
if (length) {
uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Reset All to Default Values"),

@ -915,20 +915,41 @@ static void UI_OT_editsource(wmOperatorType *ot)
static void edittranslation_find_po_file(const char *root, const char *uilng, char *path, const size_t maxlen)
{
char tstr[32]; /* Should be more than enough! */
/* First, full lang code. */
BLI_snprintf(tstr, sizeof(tstr), "%s.po", uilng);
BLI_join_dirfile(path, maxlen, root, uilng);
BLI_join_dirfile(path, maxlen, path, tstr);
if (BLI_is_file(path))
return;
/* Now try without the second iso code part (_ES in es_ES). */
strncpy(tstr, uilng, 2);
BLI_strncpy(tstr + 2, uilng + 5, sizeof(tstr) - 2); /* Because of some codes like sr_SR@latin... */
BLI_join_dirfile(path, maxlen, root, tstr);
strcat(tstr, ".po");
BLI_join_dirfile(path, maxlen, path, tstr);
if (BLI_is_file(path))
return;
{
char *tc = NULL;
size_t szt = 0;
tstr[0] = '\0';
tc = strchr(uilng, '_');
if (tc) {
szt = tc - uilng;
if (szt < sizeof(tstr)) /* Paranoid, should always be true! */
BLI_strncpy(tstr, uilng, szt + 1); /* +1 for '\0' char! */
}
if (tstr[0]) {
/* Because of some codes like sr_SR@latin... */
tc = strchr(uilng, '@');
if (tc)
BLI_strncpy(tstr + szt, tc, sizeof(tstr) - szt);
BLI_join_dirfile(path, maxlen, root, tstr);
strcat(tstr, ".po");
BLI_join_dirfile(path, maxlen, path, tstr);
if (BLI_is_file(path))
return;
}
}
/* Else no po file! */
path[0] = '\0';
}
@ -967,7 +988,7 @@ static int edittranslation_exec(bContext *C, wmOperator *op)
}
/* Try to find a valid po file for current language... */
edittranslation_find_po_file(root, uilng, popath, FILE_MAX);
printf("po path: %s\n", popath);
/* printf("po path: %s\n", popath);*/
if (popath[0] == '\0') {
BKE_reportf(op->reports, RPT_ERROR, "No valid po found for language '%s' under %s.", uilng, root);
return OPERATOR_CANCELLED;
@ -1021,14 +1042,6 @@ static int edittranslation_exec(bContext *C, wmOperator *op)
}
}
#if 0
static int edittranslation_poll(bContext *UNUSED(C))
{
/* We need the i18n py addon to be enabled! */
return WM_operatortype_find(EDTSRC_I18N_OP_NAME, 0) ? TRUE : FALSE;
}
#endif
static void UI_OT_edittranslation_init(wmOperatorType *ot)
{
/* identifiers */
@ -1038,7 +1051,6 @@ static void UI_OT_edittranslation_init(wmOperatorType *ot)
/* callbacks */
ot->exec = edittranslation_exec;
/* ot->poll = edittranslation_poll;*/
}
#endif /* WITH_PYTHON */

@ -152,7 +152,7 @@ static void menudata_free(MenuData *md)
* if %xNN is given then NN is the return value if
* that option is selected otherwise the return value
* is the index of the option (starting with 1). %l
* indicates a seperator, sss%l indicates a label and
* indicates a separator, sss%l indicates a label and
* new column.
*
* \param str String to be parsed.
@ -2083,7 +2083,7 @@ static void square_picker(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, in
/* a HS circle, V slider, rgb/hsv/hex sliders */
static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, PropertyRNA *prop)
static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, PropertyRNA *prop, int show_picker)
{
static short colormode = 0; /* temp? 0=rgb, 1=hsv, 2=hex */
uiBut *bt;
@ -2144,8 +2144,10 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
uiBlockEndAlign(block);
bt = uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth + 10, -60, UI_UNIT_X, UI_UNIT_Y, NULL);
uiButSetFunc(bt, close_popup_cb, bt, NULL);
if (show_picker) {
bt = uiDefIconButO(block, BUT, "UI_OT_eyedropper", WM_OP_INVOKE_DEFAULT, ICON_EYEDROPPER, butwidth + 10, -60, UI_UNIT_X, UI_UNIT_Y, NULL);
uiButSetFunc(bt, close_popup_cb, bt, NULL);
}
/* RGB values */
uiBlockBeginAlign(block);
@ -2230,6 +2232,7 @@ uiBlock *ui_block_func_COLOR(bContext *C, uiPopupBlockHandle *handle, void *arg_
{
uiBut *but = arg_but;
uiBlock *block;
int show_picker = TRUE;
block = uiBeginBlock(C, handle->region, __func__, UI_EMBOSS);
@ -2239,11 +2242,19 @@ uiBlock *ui_block_func_COLOR(bContext *C, uiPopupBlockHandle *handle, void *arg_
}
}
if (but->block) {
/* if color block is invoked from a popup we wouldn't be able to set color properly
* this is because color picker will close popups first and then will try to figure
* out active button RNA, and of course it'll fail
*/
show_picker = (but->block->flag & UI_BLOCK_POPUP) == 0;
}
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
copy_v3_v3(handle->retvec, but->editvec);
uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop);
uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop, show_picker);
block->flag = UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_KEEP_OPEN | UI_BLOCK_OUT_1;
uiBoundsBlock(block, 10);

@ -1750,11 +1750,11 @@ static void curvemap_buttons_redraw(bContext *C, void *UNUSED(arg1), void *UNUSE
ED_region_tag_redraw(CTX_wm_region(C));
}
static void curvemap_buttons_update(bContext *UNUSED(C), void *UNUSED(arg1), void *cumap_v)
static void curvemap_buttons_update(bContext *C, void *arg1_v, void *cumap_v)
{
CurveMapping *cumap = cumap_v;
curvemapping_changed(cumap, TRUE);
rna_update_cb(C, arg1_v, NULL);
}
static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
@ -1901,9 +1901,9 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
if (cmp) {
uiLayoutRow(layout, TRUE);
uiBlockSetNFunc(block, curvemap_buttons_update, NULL, cumap);
uiDefButF(block, NUM, 0, "X", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, &cmp->x, 0.0f, 1.0f, 1, 5, "");
uiDefButF(block, NUM, 0, "Y", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, &cmp->y, 0.0f, 1.0f, 1, 5, "");
uiBlockSetNFunc(block, curvemap_buttons_update, MEM_dupallocN(cb), cumap);
bt = uiDefButF(block, NUM, 0, "X", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, &cmp->x, 0.0f, 1.0f, 1, 5, "");
bt = uiDefButF(block, NUM, 0, "Y", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y, &cmp->y, 0.0f, 1.0f, 1, 5, "");
}
/* black/white levels */

@ -1014,42 +1014,42 @@ static void ui_text_clip_cursor(uiFontStyle *fstyle, uiBut *but, rcti *rect)
if (fstyle->kerning == 1) /* for BLF_width */
BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT);
if ((but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr)) <= okwidth) {
/* define ofs dynamically */
if (but->ofs > but->pos)
but->ofs = but->pos;
if (BLF_width(fstyle->uifont_id, but->drawstr) <= okwidth)
but->ofs = 0;
}
else {
/* define ofs dynamically */
if (but->ofs > but->pos)
but->ofs = but->pos;
while (but->strwidth > okwidth) {
float width;
char buf[UI_MAX_DRAW_STR];
but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
/* copy draw string */
BLI_strncpy_utf8(buf, but->drawstr, sizeof(buf));
/* string position of cursor */
buf[but->pos] = 0;
width = BLF_width(fstyle->uifont_id, buf + but->ofs);
while (but->strwidth > okwidth) {
float width;
char buf[UI_MAX_DRAW_STR];
/* if cursor is at 20 pixels of right side button we clip left */
if (width > okwidth - 20) {
ui_text_clip_give_next_off(but);
}
else {
int len, bytes;
/* shift string to the left */
if (width < 20 && but->ofs > 0)
ui_text_clip_give_prev_off(but);
len = strlen(but->drawstr);
bytes = BLI_str_utf8_size(BLI_str_find_prev_char_utf8(but->drawstr, but->drawstr + len));
but->drawstr[len - bytes] = 0;
}
/* copy draw string */
BLI_strncpy_utf8(buf, but->drawstr, sizeof(buf));
/* string position of cursor */
buf[but->pos] = 0;
width = BLF_width(fstyle->uifont_id, buf + but->ofs);
but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
if (but->strwidth < 10) break;
/* if cursor is at 20 pixels of right side button we clip left */
if (width > okwidth - 20) {
ui_text_clip_give_next_off(but);
}
else {
int len, bytes;
/* shift string to the left */
if (width < 20 && but->ofs > 0)
ui_text_clip_give_prev_off(but);
len = strlen(but->drawstr);
bytes = BLI_str_utf8_size(BLI_str_find_prev_char_utf8(but->drawstr, but->drawstr + len));
but->drawstr[len - bytes] = 0;
}
but->strwidth = BLF_width(fstyle->uifont_id, but->drawstr + but->ofs);
if (but->strwidth < 10) break;
}
if (fstyle->kerning == 1) {

@ -907,6 +907,7 @@ void ui_theme_init_default(void)
rgba_char_args_set(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */
rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
rgba_char_args_set(btheme->tnode.movie, 155, 155, 155, 160); /* frame */
btheme->tnode.noodle_curving = 5;
/* space logic */
@ -1940,6 +1941,18 @@ void init_userdef_do_versions(void)
}
}
if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 22)) {
bTheme *btheme;
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
if (btheme->tipo.lastsel_point[3] == 0)
rgba_char_args_set(btheme->tipo.lastsel_point, 0xff, 0xff, 0xff, 255);
if (btheme->tv3d.skin_root[3] == 0)
rgba_char_args_set(btheme->tv3d.skin_root, 180, 77, 77, 255);
}
}
/* Freestyle color settings */
{
bTheme *btheme;
@ -1988,7 +2001,10 @@ void init_userdef_do_versions(void)
}
if (U.ndof_orbit_sensitivity == 0.0f) {
U.ndof_orbit_sensitivity = 1.0f;
U.ndof_orbit_sensitivity = U.ndof_sensitivity;
if (!(U.flag & USER_TRACKBALL))
U.ndof_flag |= NDOF_TURNTABLE;
}
if (U.tweak_threshold == 0)
U.tweak_threshold = 10;

@ -849,12 +849,12 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
float mval_faci = 1.0f - mval_fac;
float ofs = (mval_fac * dx) - (mval_faci * dx);
v2d->cur.xmin += ofs + dx;
v2d->cur.xmax += ofs - dx;
v2d->cur.xmin += ofs - dx;
v2d->cur.xmax += ofs + dx;
}
else {
v2d->cur.xmin += dx;
v2d->cur.xmax -= dx;
v2d->cur.xmin -= dx;
v2d->cur.xmax += dx;
}
}
}
@ -868,12 +868,12 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op)
float mval_faci = 1.0f - mval_fac;
float ofs = (mval_fac * dy) - (mval_faci * dy);
v2d->cur.ymin += ofs + dy;
v2d->cur.ymax += ofs - dy;
v2d->cur.ymin += ofs - dy;
v2d->cur.ymax += ofs + dy;
}
else {
v2d->cur.ymin += dy;
v2d->cur.ymax -= dy;
v2d->cur.ymin -= dy;
v2d->cur.ymax += dy;
}
}
}
@ -1044,8 +1044,14 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
}
/* set transform amount, and add current deltas to stored total delta (for redo) */
RNA_float_set(op->ptr, "deltax", dx);
RNA_float_set(op->ptr, "deltay", dy);
if (U.uiflag & USER_ZOOM_INVERT) {
RNA_float_set(op->ptr, "deltax", -dx);
RNA_float_set(op->ptr, "deltay", -dy);
}
else {
RNA_float_set(op->ptr, "deltax", dx);
RNA_float_set(op->ptr, "deltay", dy);
}
vzd->dx += dx;
vzd->dy += dy;
@ -1273,11 +1279,10 @@ void UI_view2d_smooth_view(bContext *C, ARegion *ar,
}
if (C && U.smooth_viewtx && fac > FLT_EPSILON) {
int changed = 0; /* zero means no difference */
int changed = FALSE;
if (BLI_rctf_compare(&sms.new_cur, &v2d->cur, FLT_EPSILON) == FALSE)
changed = 1;
changed=1;
changed = TRUE;
/* The new view is different from the old one
* so animate the view */
@ -1479,6 +1484,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
View2DScrollers *scrollers;
ARegion *ar = CTX_wm_region(C);
View2D *v2d = &ar->v2d;
rctf tot_cur_union;
float mask_size;
/* set custom-data for operator */
@ -1498,14 +1504,20 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
*/
scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
/* use a union of 'cur' & 'tot' incase the current view is far outside 'tot'.
* In this cases moving the scroll bars has far too little effect and the view can get stuck [#31476] */
tot_cur_union = v2d->tot;
BLI_rctf_union(&tot_cur_union, &v2d->cur);
if (in_scroller == 'h') {
/* horizontal scroller - calculate adjustment factor first */
mask_size = (float)BLI_rcti_size_x(&v2d->hor);
vsm->fac = BLI_rctf_size_x(&v2d->tot) / mask_size;
vsm->fac = BLI_rctf_size_x(&tot_cur_union) / mask_size;
/* get 'zone' (i.e. which part of scroller is activated) */
vsm->zone = mouse_in_scroller_handle(event->mval[0], v2d->hor.xmin, v2d->hor.xmax, scrollers->hor_min, scrollers->hor_max);
vsm->zone = mouse_in_scroller_handle(event->mval[0],
v2d->hor.xmin, v2d->hor.xmax,
scrollers->hor_min, scrollers->hor_max);
if ((v2d->keepzoom & V2D_LOCKZOOM_X) && ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
/* default to scroll, as handles not usable */
@ -1518,10 +1530,12 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
else {
/* vertical scroller - calculate adjustment factor first */
mask_size = (float)BLI_rcti_size_y(&v2d->vert);
vsm->fac = BLI_rctf_size_y(&v2d->tot) / mask_size;
vsm->fac = BLI_rctf_size_y(&tot_cur_union) / mask_size;
/* get 'zone' (i.e. which part of scroller is activated) */
vsm->zone = mouse_in_scroller_handle(event->mval[1], v2d->vert.ymin, v2d->vert.ymax, scrollers->vert_min, scrollers->vert_max);
vsm->zone = mouse_in_scroller_handle(event->mval[1],
v2d->vert.ymin, v2d->vert.ymax,
scrollers->vert_min, scrollers->vert_max);
if ((v2d->keepzoom & V2D_LOCKZOOM_Y) && ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) {
/* default to scroll, as handles not usable */
@ -1529,7 +1543,7 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event,
}
vsm->scrollbarwidth = scrollers->vert_max - scrollers->vert_min;
vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) + +ar->winrct.ymin;
vsm->scrollbar_orig = ((scrollers->vert_max + scrollers->vert_min) / 2) + ar->winrct.ymin;
}
UI_view2d_scrollers_free(scrollers);

@ -436,8 +436,8 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
ED_keymap_proportional_maskmode(keyconf, keymap);
/* geometry */
WM_keymap_add_item(keymap, "MASK_OT_add_vertex_slide", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "MASK_OT_add_feather_vertex_slide", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "MASK_OT_add_vertex_slide", ACTIONMOUSE, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "MASK_OT_add_feather_vertex_slide", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "MASK_OT_delete", XKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MASK_OT_delete", DELKEY, KM_PRESS, 0, 0);
@ -486,7 +486,7 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
/* shape */
WM_keymap_add_item(keymap, "MASK_OT_cyclic_toggle", CKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "MASK_OT_slide_point", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MASK_OT_slide_point", ACTIONMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MASK_OT_handle_type_set", VKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MASK_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
// WM_keymap_add_item(keymap, "MASK_OT_feather_weight_clear", SKEY, KM_PRESS, KM_ALT, 0);

Some files were not shown because too many files have changed in this diff Show More