forked from bartvdbraak/blender
Merging r42770 through r42799 from trunk into soc-2011-tomato
This commit is contained in:
commit
9774c93435
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "util_cuda.h"
|
#include "util_cuda.h"
|
||||||
#include "util_debug.h"
|
#include "util_debug.h"
|
||||||
|
#include "util_foreach.h"
|
||||||
#include "util_math.h"
|
#include "util_math.h"
|
||||||
#include "util_opencl.h"
|
#include "util_opencl.h"
|
||||||
#include "util_opengl.h"
|
#include "util_opengl.h"
|
||||||
@ -41,7 +42,31 @@ DeviceTask::DeviceTask(Type type_)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceTask::split(ThreadQueue<DeviceTask>& tasks, int num)
|
void DeviceTask::split_max_size(list<DeviceTask>& tasks, int max_size)
|
||||||
|
{
|
||||||
|
int num;
|
||||||
|
|
||||||
|
if(type == DISPLACE) {
|
||||||
|
num = (displace_w + max_size - 1)/max_size;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
max_size = max(1, max_size/w);
|
||||||
|
num = (h + max_size - 1)/max_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
split(tasks, num);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeviceTask::split(ThreadQueue<DeviceTask>& queue, int num)
|
||||||
|
{
|
||||||
|
list<DeviceTask> tasks;
|
||||||
|
split(tasks, num);
|
||||||
|
|
||||||
|
foreach(DeviceTask& task, tasks)
|
||||||
|
queue.push(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeviceTask::split(list<DeviceTask>& tasks, int num)
|
||||||
{
|
{
|
||||||
if(type == DISPLACE) {
|
if(type == DISPLACE) {
|
||||||
num = min(displace_w, num);
|
num = min(displace_w, num);
|
||||||
@ -55,7 +80,7 @@ void DeviceTask::split(ThreadQueue<DeviceTask>& tasks, int num)
|
|||||||
task.displace_x = tx;
|
task.displace_x = tx;
|
||||||
task.displace_w = tw;
|
task.displace_w = tw;
|
||||||
|
|
||||||
tasks.push(task);
|
tasks.push_back(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -70,7 +95,7 @@ void DeviceTask::split(ThreadQueue<DeviceTask>& tasks, int num)
|
|||||||
task.y = ty;
|
task.y = ty;
|
||||||
task.h = th;
|
task.h = th;
|
||||||
|
|
||||||
tasks.push(task);
|
tasks.push_back(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "device_memory.h"
|
#include "device_memory.h"
|
||||||
|
|
||||||
|
#include "util_list.h"
|
||||||
#include "util_string.h"
|
#include "util_string.h"
|
||||||
#include "util_thread.h"
|
#include "util_thread.h"
|
||||||
#include "util_types.h"
|
#include "util_types.h"
|
||||||
@ -67,7 +68,10 @@ public:
|
|||||||
int displace_x, displace_w;
|
int displace_x, displace_w;
|
||||||
|
|
||||||
DeviceTask(Type type = PATH_TRACE);
|
DeviceTask(Type type = PATH_TRACE);
|
||||||
|
|
||||||
|
void split(list<DeviceTask>& tasks, int num);
|
||||||
void split(ThreadQueue<DeviceTask>& tasks, int num);
|
void split(ThreadQueue<DeviceTask>& tasks, int num);
|
||||||
|
void split_max_size(list<DeviceTask>& tasks, int max_size);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Device */
|
/* Device */
|
||||||
|
@ -221,7 +221,7 @@ public:
|
|||||||
cuDeviceComputeCapability(&major, &minor, cuDevId);
|
cuDeviceComputeCapability(&major, &minor, cuDevId);
|
||||||
|
|
||||||
if(major <= 1 && minor <= 2) {
|
if(major <= 1 && minor <= 2) {
|
||||||
cuda_error(string_printf("CUDA device supported only with shader model 1.3 or up, found %d.%d.", major, minor));
|
cuda_error(string_printf("CUDA device supported only with compute capability 1.3 or up, found %d.%d.", major, minor));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -253,9 +253,9 @@ public:
|
|||||||
|
|
||||||
#if defined(WITH_CUDA_BINARIES) && defined(_WIN32)
|
#if defined(WITH_CUDA_BINARIES) && defined(_WIN32)
|
||||||
if(major <= 1 && minor <= 2)
|
if(major <= 1 && minor <= 2)
|
||||||
cuda_error(string_printf("CUDA device supported only with shader model 1.3 or up, found %d.%d.", major, minor));
|
cuda_error(string_printf("CUDA device supported only compute capability 1.3 or up, found %d.%d.", major, minor));
|
||||||
else
|
else
|
||||||
cuda_error(string_printf("CUDA binary kernel for this graphics card shader model (%d.%d) not found.", major, minor));
|
cuda_error(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
|
||||||
return "";
|
return "";
|
||||||
#else
|
#else
|
||||||
/* if not, find CUDA compiler */
|
/* if not, find CUDA compiler */
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "device_intern.h"
|
#include "device_intern.h"
|
||||||
|
|
||||||
|
#include "util_foreach.h"
|
||||||
#include "util_map.h"
|
#include "util_map.h"
|
||||||
#include "util_math.h"
|
#include "util_math.h"
|
||||||
#include "util_md5.h"
|
#include "util_md5.h"
|
||||||
@ -52,6 +53,7 @@ public:
|
|||||||
map<string, device_memory*> mem_map;
|
map<string, device_memory*> mem_map;
|
||||||
device_ptr null_mem;
|
device_ptr null_mem;
|
||||||
bool device_initialized;
|
bool device_initialized;
|
||||||
|
string platform_name;
|
||||||
|
|
||||||
const char *opencl_error_string(cl_int err)
|
const char *opencl_error_string(cl_int err)
|
||||||
{
|
{
|
||||||
@ -175,6 +177,10 @@ public:
|
|||||||
if(opencl_error(ciErr))
|
if(opencl_error(ciErr))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
char name[256];
|
||||||
|
clGetPlatformInfo(cpPlatform, CL_PLATFORM_NAME, sizeof(name), &name, NULL);
|
||||||
|
platform_name = name;
|
||||||
|
|
||||||
cxContext = clCreateContext(0, 1, &cdDevice, NULL, NULL, &ciErr);
|
cxContext = clCreateContext(0, 1, &cdDevice, NULL, NULL, &ciErr);
|
||||||
if(opencl_error(ciErr))
|
if(opencl_error(ciErr))
|
||||||
return;
|
return;
|
||||||
@ -191,7 +197,7 @@ public:
|
|||||||
{
|
{
|
||||||
char version[256];
|
char version[256];
|
||||||
|
|
||||||
int major, minor, req_major = 1, req_minor = 0;
|
int major, minor, req_major = 1, req_minor = 1;
|
||||||
|
|
||||||
clGetPlatformInfo(cpPlatform, CL_PLATFORM_VERSION, sizeof(version), &version, NULL);
|
clGetPlatformInfo(cpPlatform, CL_PLATFORM_VERSION, sizeof(version), &version, NULL);
|
||||||
|
|
||||||
@ -277,14 +283,11 @@ public:
|
|||||||
{
|
{
|
||||||
string build_options = " -cl-fast-relaxed-math ";
|
string build_options = " -cl-fast-relaxed-math ";
|
||||||
|
|
||||||
/* Full Shading only on NVIDIA cards at the moment */
|
/* full shading only on NVIDIA cards at the moment */
|
||||||
char vendor[256];
|
if(platform_name == "NVIDIA CUDA")
|
||||||
|
build_options += "-D__KERNEL_SHADING__ -D__MULTI_CLOSURE__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
|
||||||
clGetPlatformInfo(cpPlatform, CL_PLATFORM_NAME, sizeof(vendor), &vendor, NULL);
|
if(platform_name == "Apple")
|
||||||
string name = vendor;
|
build_options += " -D__CL_NO_FLOAT3__ ";
|
||||||
|
|
||||||
if(name == "NVIDIA CUDA")
|
|
||||||
build_options += "-D__KERNEL_SHADING__ -D__MULTI_CLOSURE__ ";
|
|
||||||
|
|
||||||
return build_options;
|
return build_options;
|
||||||
}
|
}
|
||||||
@ -657,12 +660,24 @@ public:
|
|||||||
opencl_assert(clFinish(cqCommandQueue));
|
opencl_assert(clFinish(cqCommandQueue));
|
||||||
}
|
}
|
||||||
|
|
||||||
void task_add(DeviceTask& task)
|
void task_add(DeviceTask& maintask)
|
||||||
{
|
{
|
||||||
if(task.type == DeviceTask::TONEMAP)
|
list<DeviceTask> tasks;
|
||||||
tonemap(task);
|
|
||||||
else if(task.type == DeviceTask::PATH_TRACE)
|
/* arbitrary limit to work around apple ATI opencl issue */
|
||||||
path_trace(task);
|
if(platform_name == "Apple")
|
||||||
|
maintask.split_max_size(tasks, 76800);
|
||||||
|
else
|
||||||
|
tasks.push_back(maintask);
|
||||||
|
|
||||||
|
DeviceTask task;
|
||||||
|
|
||||||
|
foreach(DeviceTask& task, tasks) {
|
||||||
|
if(task.type == DeviceTask::TONEMAP)
|
||||||
|
tonemap(task);
|
||||||
|
else if(task.type == DeviceTask::PATH_TRACE)
|
||||||
|
path_trace(task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void task_wait()
|
void task_wait()
|
||||||
|
@ -143,7 +143,7 @@ endif()
|
|||||||
#set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
|
#set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
|
||||||
#add_custom_command(
|
#add_custom_command(
|
||||||
# OUTPUT ${KERNEL_PREPROCESSED}
|
# OUTPUT ${KERNEL_PREPROCESSED}
|
||||||
# COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DWITH_OPENCL -o ${KERNEL_PREPROCESSED}
|
# COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -o ${KERNEL_PREPROCESSED}
|
||||||
# DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
|
# DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
|
||||||
#add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
|
#add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
|
||||||
#delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
|
#delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
|
||||||
|
@ -25,12 +25,21 @@
|
|||||||
/* no namespaces in opencl */
|
/* no namespaces in opencl */
|
||||||
#define CCL_NAMESPACE_BEGIN
|
#define CCL_NAMESPACE_BEGIN
|
||||||
#define CCL_NAMESPACE_END
|
#define CCL_NAMESPACE_END
|
||||||
#define WITH_OPENCL
|
|
||||||
|
#ifdef __CL_NO_FLOAT3__
|
||||||
|
#define float3 float4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __CL_NOINLINE__
|
||||||
|
#define __noinline __attribute__((noinline))
|
||||||
|
#else
|
||||||
|
#define __noinline
|
||||||
|
#endif
|
||||||
|
|
||||||
/* in opencl all functions are device functions, so leave this empty */
|
/* in opencl all functions are device functions, so leave this empty */
|
||||||
#define __device
|
#define __device
|
||||||
#define __device_inline
|
#define __device_inline __device
|
||||||
#define __device_noinline
|
#define __device_noinline __device __noinline
|
||||||
|
|
||||||
/* no assert in opencl */
|
/* no assert in opencl */
|
||||||
#define kernel_assert(cond)
|
#define kernel_assert(cond)
|
||||||
@ -68,7 +77,11 @@ __device float kernel_tex_interp_(__global float *data, int width, float x)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define make_float2(x, y) ((float2)(x, y))
|
#define make_float2(x, y) ((float2)(x, y))
|
||||||
|
#ifdef __CL_NO_FLOAT3__
|
||||||
|
#define make_float3(x, y, z) ((float4)(x, y, z, 0.0))
|
||||||
|
#else
|
||||||
#define make_float3(x, y, z) ((float3)(x, y, z))
|
#define make_float3(x, y, z) ((float3)(x, y, z))
|
||||||
|
#endif
|
||||||
#define make_float4(x, y, z, w) ((float4)(x, y, z, w))
|
#define make_float4(x, y, z, w) ((float4)(x, y, z, w))
|
||||||
#define make_int2(x, y) ((int2)(x, y))
|
#define make_int2(x, y) ((int2)(x, y))
|
||||||
#define make_int3(x, y, z) ((int3)(x, y, z))
|
#define make_int3(x, y, z) ((int3)(x, y, z))
|
||||||
|
@ -56,6 +56,12 @@ public:
|
|||||||
full_height = 0;
|
full_height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void get_offset_stride(int& offset, int& stride)
|
||||||
|
{
|
||||||
|
offset = -(full_x + full_y*width);
|
||||||
|
stride = width;
|
||||||
|
}
|
||||||
|
|
||||||
bool modified(const BufferParams& params)
|
bool modified(const BufferParams& params)
|
||||||
{
|
{
|
||||||
return !(full_x == params.full_x
|
return !(full_x == params.full_x
|
||||||
|
@ -515,10 +515,8 @@ void Session::update_scene()
|
|||||||
knows nothing about progressive or cropped rendering, it just gets the
|
knows nothing about progressive or cropped rendering, it just gets the
|
||||||
image dimensions passed in */
|
image dimensions passed in */
|
||||||
Camera *cam = scene->camera;
|
Camera *cam = scene->camera;
|
||||||
float progressive_x = tile_manager.state.width/(float)tile_manager.params.width;
|
int width = tile_manager.state.buffer.full_width;
|
||||||
float progressive_y = tile_manager.state.height/(float)tile_manager.params.height;
|
int height = tile_manager.state.buffer.full_height;
|
||||||
int width = tile_manager.params.full_width*progressive_x;
|
|
||||||
int height = tile_manager.params.full_height*progressive_y;
|
|
||||||
|
|
||||||
if(width != cam->width || height != cam->height) {
|
if(width != cam->width || height != cam->height) {
|
||||||
cam->width = width;
|
cam->width = width;
|
||||||
@ -574,16 +572,15 @@ void Session::path_trace(Tile& tile)
|
|||||||
/* add path trace task */
|
/* add path trace task */
|
||||||
DeviceTask task(DeviceTask::PATH_TRACE);
|
DeviceTask task(DeviceTask::PATH_TRACE);
|
||||||
|
|
||||||
task.x = tile_manager.state.full_x + tile.x;
|
task.x = tile_manager.state.buffer.full_x + tile.x;
|
||||||
task.y = tile_manager.state.full_y + tile.y;
|
task.y = tile_manager.state.buffer.full_y + tile.y;
|
||||||
task.w = tile.w;
|
task.w = tile.w;
|
||||||
task.h = tile.h;
|
task.h = tile.h;
|
||||||
task.buffer = buffers->buffer.device_pointer;
|
task.buffer = buffers->buffer.device_pointer;
|
||||||
task.rng_state = buffers->rng_state.device_pointer;
|
task.rng_state = buffers->rng_state.device_pointer;
|
||||||
task.sample = tile_manager.state.sample;
|
task.sample = tile_manager.state.sample;
|
||||||
task.resolution = tile_manager.state.resolution;
|
task.resolution = tile_manager.state.resolution;
|
||||||
task.offset = -(tile_manager.state.full_x + tile_manager.state.full_y*tile_manager.state.width);
|
tile_manager.state.buffer.get_offset_stride(task.offset, task.stride);
|
||||||
task.stride = tile_manager.state.width;
|
|
||||||
|
|
||||||
device->task_add(task);
|
device->task_add(task);
|
||||||
}
|
}
|
||||||
@ -593,16 +590,15 @@ void Session::tonemap()
|
|||||||
/* add tonemap task */
|
/* add tonemap task */
|
||||||
DeviceTask task(DeviceTask::TONEMAP);
|
DeviceTask task(DeviceTask::TONEMAP);
|
||||||
|
|
||||||
task.x = tile_manager.state.full_x;
|
task.x = tile_manager.state.buffer.full_x;
|
||||||
task.y = tile_manager.state.full_y;
|
task.y = tile_manager.state.buffer.full_y;
|
||||||
task.w = tile_manager.state.width;
|
task.w = tile_manager.state.buffer.width;
|
||||||
task.h = tile_manager.state.height;
|
task.h = tile_manager.state.buffer.height;
|
||||||
task.rgba = display->rgba.device_pointer;
|
task.rgba = display->rgba.device_pointer;
|
||||||
task.buffer = buffers->buffer.device_pointer;
|
task.buffer = buffers->buffer.device_pointer;
|
||||||
task.sample = tile_manager.state.sample;
|
task.sample = tile_manager.state.sample;
|
||||||
task.resolution = tile_manager.state.resolution;
|
task.resolution = tile_manager.state.resolution;
|
||||||
task.offset = -(tile_manager.state.full_x + tile_manager.state.full_y*tile_manager.state.width);
|
tile_manager.state.buffer.get_offset_stride(task.offset, task.stride);
|
||||||
task.stride = tile_manager.state.width;
|
|
||||||
|
|
||||||
if(task.w > 0 && task.h > 0) {
|
if(task.w > 0 && task.h > 0) {
|
||||||
device->task_add(task);
|
device->task_add(task);
|
||||||
|
@ -55,10 +55,7 @@ void TileManager::reset(BufferParams& params_, int samples_)
|
|||||||
|
|
||||||
samples = samples_;
|
samples = samples_;
|
||||||
|
|
||||||
state.full_x = 0;
|
state.buffer = BufferParams();
|
||||||
state.full_y = 0;
|
|
||||||
state.width = 0;
|
|
||||||
state.height = 0;
|
|
||||||
state.sample = -1;
|
state.sample = -1;
|
||||||
state.resolution = start_resolution;
|
state.resolution = start_resolution;
|
||||||
state.tiles.clear();
|
state.tiles.clear();
|
||||||
@ -92,10 +89,13 @@ void TileManager::set_tiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.full_x = params.full_x/resolution;
|
state.buffer.width = image_w;
|
||||||
state.full_y = params.full_y/resolution;
|
state.buffer.height = image_h;
|
||||||
state.width = image_w;
|
|
||||||
state.height = image_h;
|
state.buffer.full_x = params.full_x/resolution;
|
||||||
|
state.buffer.full_y = params.full_y/resolution;
|
||||||
|
state.buffer.full_width = max(1, params.full_width/resolution);
|
||||||
|
state.buffer.full_height = max(1, params.full_height/resolution);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TileManager::done()
|
bool TileManager::done()
|
||||||
|
@ -41,11 +41,9 @@ public:
|
|||||||
class TileManager {
|
class TileManager {
|
||||||
public:
|
public:
|
||||||
BufferParams params;
|
BufferParams params;
|
||||||
|
|
||||||
struct State {
|
struct State {
|
||||||
int full_x;
|
BufferParams buffer;
|
||||||
int full_y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int sample;
|
int sample;
|
||||||
int resolution;
|
int resolution;
|
||||||
list<Tile> tiles;
|
list<Tile> tiles;
|
||||||
|
@ -993,6 +993,7 @@ class VIEW3D_MT_object_game(Menu):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks")
|
layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks")
|
||||||
|
layout.operator("object.game_physics_copy", text="Copy Physics Properties")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ static const char *locales[] = {
|
|||||||
"Chinese (Traditional)_China.1252", "zh_TW",
|
"Chinese (Traditional)_China.1252", "zh_TW",
|
||||||
"russian", "ru_RU",
|
"russian", "ru_RU",
|
||||||
"croatian", "hr_HR",
|
"croatian", "hr_HR",
|
||||||
"serbian", "sr_RS",
|
"serbian", "sr",
|
||||||
"ukrainian", "uk_UA",
|
"ukrainian", "uk_UA",
|
||||||
"polish", "pl_PL",
|
"polish", "pl_PL",
|
||||||
"romanian", "ro_RO",
|
"romanian", "ro_RO",
|
||||||
@ -96,7 +96,8 @@ static const char *locales[] = {
|
|||||||
"korean", "ko_KR",
|
"korean", "ko_KR",
|
||||||
"nepali", "ne_NP",
|
"nepali", "ne_NP",
|
||||||
"persian", "fa_PE",
|
"persian", "fa_PE",
|
||||||
"indonesian", "id_ID"
|
"indonesian", "id_ID",
|
||||||
|
"serbian (latin)", "sr@latin",
|
||||||
};
|
};
|
||||||
|
|
||||||
void BLF_lang_init(void)
|
void BLF_lang_init(void)
|
||||||
|
@ -372,7 +372,10 @@ static MovieClip *movieclip_alloc(const char *name)
|
|||||||
BKE_tracking_init_settings(&clip->tracking);
|
BKE_tracking_init_settings(&clip->tracking);
|
||||||
|
|
||||||
clip->proxy.build_size_flag= IMB_PROXY_25;
|
clip->proxy.build_size_flag= IMB_PROXY_25;
|
||||||
clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN|IMB_TC_FREE_RUN|IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
|
clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN |
|
||||||
|
IMB_TC_FREE_RUN |
|
||||||
|
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN |
|
||||||
|
IMB_TC_RECORD_RUN_NO_GAPS;
|
||||||
clip->proxy.quality= 90;
|
clip->proxy.quality= 90;
|
||||||
|
|
||||||
return clip;
|
return clip;
|
||||||
|
45
source/blender/blenlib/BLI_md5.h
Normal file
45
source/blender/blenlib/BLI_md5.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BLI_MD5_H
|
||||||
|
#define BLI_MD5_H
|
||||||
|
|
||||||
|
/** \file BLI_md5.h
|
||||||
|
* \ingroup bli
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||||
|
result is always in little endian byte order, so that a byte-wise
|
||||||
|
output yields to the wanted ASCII representation of the message
|
||||||
|
digest. */
|
||||||
|
|
||||||
|
void *md5_buffer(const char *buffer, size_t len, void *resblock);
|
||||||
|
|
||||||
|
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||||
|
resulting message digest number will be written into the 16 bytes
|
||||||
|
beginning at RESBLOCK. */
|
||||||
|
|
||||||
|
int md5_stream(FILE *stream, void *resblock);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -71,6 +71,7 @@ set(SRC
|
|||||||
intern/math_rotation.c
|
intern/math_rotation.c
|
||||||
intern/math_vector.c
|
intern/math_vector.c
|
||||||
intern/math_vector_inline.c
|
intern/math_vector_inline.c
|
||||||
|
intern/md5.c
|
||||||
intern/noise.c
|
intern/noise.c
|
||||||
intern/path_util.c
|
intern/path_util.c
|
||||||
intern/pbvh.c
|
intern/pbvh.c
|
||||||
@ -117,6 +118,7 @@ set(SRC
|
|||||||
BLI_math_matrix.h
|
BLI_math_matrix.h
|
||||||
BLI_math_rotation.h
|
BLI_math_rotation.h
|
||||||
BLI_math_vector.h
|
BLI_math_vector.h
|
||||||
|
BLI_md5.h
|
||||||
BLI_memarena.h
|
BLI_memarena.h
|
||||||
BLI_mempool.h
|
BLI_mempool.h
|
||||||
BLI_noise.h
|
BLI_noise.h
|
||||||
|
@ -21,12 +21,82 @@
|
|||||||
|
|
||||||
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>. */
|
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>. */
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
# include <stdlib.h>
|
#if defined HAVE_LIMITS_H || defined _LIBC
|
||||||
# include <string.h>
|
# include <limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The following contortions are an attempt to use the C preprocessor
|
||||||
|
to determine an unsigned integral type that is 32 bits wide. An
|
||||||
|
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
||||||
|
doing that would require that the configure script compile and *run*
|
||||||
|
the resulting executable. Locally running cross-compiled executables
|
||||||
|
is usually not possible. */
|
||||||
|
|
||||||
|
#if defined __STDC__ && __STDC__
|
||||||
|
# define UINT_MAX_32_BITS 4294967295U
|
||||||
|
#else
|
||||||
|
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
||||||
|
This should be valid for all systems GNU cares about because
|
||||||
|
that doesn't include 16-bit systems, and only modern systems
|
||||||
|
(that certainly have <limits.h>) have 64+-bit integral types. */
|
||||||
|
|
||||||
|
#ifndef UINT_MAX
|
||||||
|
# define UINT_MAX UINT_MAX_32_BITS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if UINT_MAX == UINT_MAX_32_BITS
|
||||||
|
typedef unsigned int md5_uint32;
|
||||||
|
#else
|
||||||
|
# if USHRT_MAX == UINT_MAX_32_BITS
|
||||||
|
typedef unsigned short md5_uint32;
|
||||||
|
# else
|
||||||
|
# if ULONG_MAX == UINT_MAX_32_BITS
|
||||||
|
typedef unsigned long md5_uint32;
|
||||||
|
# else
|
||||||
|
/* The following line is intended to evoke an error.
|
||||||
|
Using #error is not portable enough. */
|
||||||
|
"Cannot determine unsigned 32-bit data type."
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Structure to save state of computation between the single steps. */
|
||||||
|
struct md5_ctx
|
||||||
|
{
|
||||||
|
md5_uint32 A;
|
||||||
|
md5_uint32 B;
|
||||||
|
md5_uint32 C;
|
||||||
|
md5_uint32 D;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following three functions are build up the low level used in
|
||||||
|
* the functions `md5_stream' and `md5_buffer'.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Initialize structure containing state of computation.
|
||||||
|
(RFC 1321, 3.3: Step 3) */
|
||||||
|
static void md5_init_ctx(struct md5_ctx *ctx);
|
||||||
|
|
||||||
|
/* Starting with the result of former calls of this function (or the
|
||||||
|
initialzation function update the context for the next LEN bytes
|
||||||
|
starting at BUFFER.
|
||||||
|
It is necessary that LEN is a multiple of 64!!! */
|
||||||
|
static void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ctx);
|
||||||
|
|
||||||
|
/* Put result from CTX in first 16 bytes following RESBUF. The result is
|
||||||
|
always in little endian byte order, so that a byte-wise output yields
|
||||||
|
to the wanted ASCII representation of the message digest. */
|
||||||
|
static void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf);
|
||||||
|
|
||||||
#include "md5.h"
|
|
||||||
|
|
||||||
#ifdef __BIG_ENDIAN__
|
#ifdef __BIG_ENDIAN__
|
||||||
# define SWAP(n) \
|
# define SWAP(n) \
|
||||||
@ -43,9 +113,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
|||||||
|
|
||||||
/* Initialize structure containing state of computation.
|
/* Initialize structure containing state of computation.
|
||||||
(RFC 1321, 3.3: Step 3) */
|
(RFC 1321, 3.3: Step 3) */
|
||||||
void
|
static void md5_init_ctx(struct md5_ctx *ctx)
|
||||||
md5_init_ctx (ctx)
|
|
||||||
struct md5_ctx *ctx;
|
|
||||||
{
|
{
|
||||||
ctx->A = 0x67452301;
|
ctx->A = 0x67452301;
|
||||||
ctx->B = 0xefcdab89;
|
ctx->B = 0xefcdab89;
|
||||||
@ -55,10 +123,7 @@ md5_init_ctx (ctx)
|
|||||||
|
|
||||||
/* Put result from CTX in first 16 bytes following RESBUF. The result must
|
/* Put result from CTX in first 16 bytes following RESBUF. The result must
|
||||||
be in little endian byte order. */
|
be in little endian byte order. */
|
||||||
void *
|
static void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf)
|
||||||
md5_read_ctx (ctx, resbuf)
|
|
||||||
const struct md5_ctx *ctx;
|
|
||||||
void *resbuf;
|
|
||||||
{
|
{
|
||||||
((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
|
((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
|
||||||
((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
|
((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
|
||||||
@ -71,10 +136,7 @@ md5_read_ctx (ctx, resbuf)
|
|||||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||||
resulting message digest number will be written into the 16 bytes
|
resulting message digest number will be written into the 16 bytes
|
||||||
beginning at RESBLOCK. */
|
beginning at RESBLOCK. */
|
||||||
int
|
int md5_stream(FILE *stream, void *resblock)
|
||||||
md5_stream (stream, resblock)
|
|
||||||
FILE *stream;
|
|
||||||
void *resblock;
|
|
||||||
{
|
{
|
||||||
/* Important: BLOCKSIZE must be a multiple of 64. */
|
/* Important: BLOCKSIZE must be a multiple of 64. */
|
||||||
#define BLOCKSIZE 4096
|
#define BLOCKSIZE 4096
|
||||||
@ -154,11 +216,7 @@ md5_stream (stream, resblock)
|
|||||||
result is always in little endian byte order, so that a byte-wise
|
result is always in little endian byte order, so that a byte-wise
|
||||||
output yields to the wanted ASCII representation of the message
|
output yields to the wanted ASCII representation of the message
|
||||||
digest. */
|
digest. */
|
||||||
void *
|
void *md5_buffer(const char *buffer, size_t len, void *resblock)
|
||||||
md5_buffer (buffer, len, resblock)
|
|
||||||
const char *buffer;
|
|
||||||
size_t len;
|
|
||||||
void *resblock;
|
|
||||||
{
|
{
|
||||||
struct md5_ctx ctx;
|
struct md5_ctx ctx;
|
||||||
char restbuf[64 + 72];
|
char restbuf[64 + 72];
|
||||||
@ -207,11 +265,7 @@ md5_buffer (buffer, len, resblock)
|
|||||||
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
||||||
It is assumed that LEN % 64 == 0. */
|
It is assumed that LEN % 64 == 0. */
|
||||||
|
|
||||||
void
|
void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
|
||||||
md5_process_block (buffer, len, ctx)
|
|
||||||
const void *buffer;
|
|
||||||
size_t len;
|
|
||||||
struct md5_ctx *ctx;
|
|
||||||
{
|
{
|
||||||
md5_uint32 correct_words[16];
|
md5_uint32 correct_words[16];
|
||||||
const md5_uint32 *words = buffer;
|
const md5_uint32 *words = buffer;
|
@ -32,6 +32,7 @@ set(INC
|
|||||||
../nodes
|
../nodes
|
||||||
../render/extern/include
|
../render/extern/include
|
||||||
../../../intern/guardedalloc
|
../../../intern/guardedalloc
|
||||||
|
../imbuf
|
||||||
)
|
)
|
||||||
|
|
||||||
set(INC_SYS
|
set(INC_SYS
|
||||||
|
@ -5,7 +5,7 @@ sources = env.Glob('intern/*.c')
|
|||||||
|
|
||||||
incs = '. #/intern/guardedalloc ../blenlib ../blenkernel'
|
incs = '. #/intern/guardedalloc ../blenlib ../blenkernel'
|
||||||
incs += ' ../makesdna ../editors/include'
|
incs += ' ../makesdna ../editors/include'
|
||||||
incs += ' ../render/extern/include ../makesrna ../nodes'
|
incs += ' ../render/extern/include ../makesrna ../nodes ../imbuf'
|
||||||
|
|
||||||
incs += ' ' + env['BF_ZLIB_INC']
|
incs += ' ' + env['BF_ZLIB_INC']
|
||||||
|
|
||||||
|
@ -139,6 +139,8 @@
|
|||||||
#include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
|
#include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
|
||||||
#include "BKE_sound.h"
|
#include "BKE_sound.h"
|
||||||
|
|
||||||
|
#include "IMB_imbuf.h" // for proxy / timecode versioning stuff
|
||||||
|
|
||||||
#include "NOD_socket.h"
|
#include "NOD_socket.h"
|
||||||
|
|
||||||
//XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes
|
//XXX #include "BIF_butspace.h" // badlevel, for do_versions, patching event codes
|
||||||
@ -12609,10 +12611,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
clip->aspy= 1.0f;
|
clip->aspy= 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: a bit hacky, probably include imbuf and use real constants are nicer */
|
clip->proxy.build_tc_flag= IMB_TC_RECORD_RUN |
|
||||||
clip->proxy.build_tc_flag= 7;
|
IMB_TC_FREE_RUN |
|
||||||
|
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN;
|
||||||
|
|
||||||
if(clip->proxy.build_size_flag==0)
|
if(clip->proxy.build_size_flag==0)
|
||||||
clip->proxy.build_size_flag= 1;
|
clip->proxy.build_size_flag= IMB_PROXY_25;
|
||||||
|
|
||||||
if(clip->proxy.quality==0)
|
if(clip->proxy.quality==0)
|
||||||
clip->proxy.quality= 90;
|
clip->proxy.quality= 90;
|
||||||
@ -12760,6 +12764,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
MovieTracking *tracking= &clip->tracking;
|
MovieTracking *tracking= &clip->tracking;
|
||||||
MovieTrackingObject *tracking_object= tracking->objects.first;
|
MovieTrackingObject *tracking_object= tracking->objects.first;
|
||||||
|
|
||||||
|
clip->proxy.build_tc_flag|= IMB_TC_RECORD_RUN_NO_GAPS;
|
||||||
|
|
||||||
if(!tracking->settings.object_distance)
|
if(!tracking->settings.object_distance)
|
||||||
tracking->settings.object_distance= 1.0f;
|
tracking->settings.object_distance= 1.0f;
|
||||||
|
|
||||||
|
@ -253,7 +253,8 @@ typedef struct MirrTopoStore_t {
|
|||||||
} MirrTopoStore_t;
|
} MirrTopoStore_t;
|
||||||
|
|
||||||
int ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
|
int ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
|
||||||
void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
|
void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
|
||||||
|
const short skip_em_vert_array_init);
|
||||||
void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
|
void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -1901,7 +1901,7 @@ void ui_set_but_soft_range(uiBut *but, double value)
|
|||||||
if(softmin < (double)but->hardmin)
|
if(softmin < (double)but->hardmin)
|
||||||
softmin= (double)but->hardmin;
|
softmin= (double)but->hardmin;
|
||||||
}
|
}
|
||||||
else if(value_max-1e-10 > softmax) {
|
if(value_max-1e-10 > softmax) {
|
||||||
if(value_max < 0.0)
|
if(value_max < 0.0)
|
||||||
softmax= -soft_range_round_down(-value_max, -softmax);
|
softmax= -soft_range_round_down(-value_max, -softmax);
|
||||||
else
|
else
|
||||||
|
@ -5247,7 +5247,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
|
|||||||
highlight when not in a popup menu, we remove because data used in
|
highlight when not in a popup menu, we remove because data used in
|
||||||
button below popup might have been removed by action of popup. Needs
|
button below popup might have been removed by action of popup. Needs
|
||||||
a more reliable solution... */
|
a more reliable solution... */
|
||||||
if(state != BUTTON_STATE_HIGHLIGHT || but->block->handle)
|
if(state != BUTTON_STATE_HIGHLIGHT || (but->block->flag & UI_BLOCK_LOOP))
|
||||||
ui_check_but(but);
|
ui_check_but(but);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1795,7 +1795,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
|
|||||||
{
|
{
|
||||||
/* gouraud triangle fan */
|
/* gouraud triangle fan */
|
||||||
float radstep, ang= 0.0f;
|
float radstep, ang= 0.0f;
|
||||||
float centx, centy, radius;
|
float centx, centy, radius, cursor_radius;
|
||||||
float rgb[3], hsvo[3], hsv[3], col[3], colcent[3];
|
float rgb[3], hsvo[3], hsv[3], col[3], colcent[3];
|
||||||
int a, tot= 32;
|
int a, tot= 32;
|
||||||
int color_profile = but->block->color_profile;
|
int color_profile = but->block->color_profile;
|
||||||
@ -1864,12 +1864,12 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect)
|
|||||||
ang= 2.0f*(float)M_PI*hsvo[0] + 0.5f*(float)M_PI;
|
ang= 2.0f*(float)M_PI*hsvo[0] + 0.5f*(float)M_PI;
|
||||||
|
|
||||||
if(but->flag & UI_BUT_COLOR_CUBIC)
|
if(but->flag & UI_BUT_COLOR_CUBIC)
|
||||||
radius= (1.0f - powf(1.0f - hsvo[1], 3.0f)) *radius;
|
cursor_radius = (1.0f - powf(1.0f - hsvo[1], 3.0f));
|
||||||
else
|
else
|
||||||
radius= hsvo[1] * radius;
|
cursor_radius = hsvo[1];
|
||||||
|
|
||||||
|
radius= CLAMPIS(cursor_radius, 0.0f, 1.0f) * radius;
|
||||||
ui_hsv_cursor(centx + cosf(-ang)*radius, centy + sinf(-ang)*radius);
|
ui_hsv_cursor(centx + cosf(-ang)*radius, centy + sinf(-ang)*radius);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************ custom buttons, old stuff ************** */
|
/* ************ custom buttons, old stuff ************** */
|
||||||
|
@ -823,22 +823,22 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
|||||||
|
|
||||||
typedef int MirrTopoHash_t;
|
typedef int MirrTopoHash_t;
|
||||||
|
|
||||||
typedef struct MirrTopoPair_t {
|
typedef struct MirrTopoVert_t {
|
||||||
MirrTopoHash_t hash;
|
MirrTopoHash_t hash;
|
||||||
int v_index;
|
int v_index;
|
||||||
} MirrTopoPair_t;
|
} MirrTopoVert_t;
|
||||||
|
|
||||||
static int MirrTopo_long_sort(const void *l1, const void *l2)
|
static int mirrtopo_hash_sort(const void *l1, const void *l2)
|
||||||
{
|
{
|
||||||
if ((MirrTopoHash_t)(intptr_t)l1 > (MirrTopoHash_t)(intptr_t)l2 ) return 1;
|
if ((MirrTopoHash_t)(intptr_t)l1 > (MirrTopoHash_t)(intptr_t)l2 ) return 1;
|
||||||
else if ((MirrTopoHash_t)(intptr_t)l1 < (MirrTopoHash_t)(intptr_t)l2 ) return -1;
|
else if ((MirrTopoHash_t)(intptr_t)l1 < (MirrTopoHash_t)(intptr_t)l2 ) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int MirrTopo_item_sort(const void *v1, const void *v2)
|
static int mirrtopo_vert_sort(const void *v1, const void *v2)
|
||||||
{
|
{
|
||||||
if (((MirrTopoPair_t *)v1)->hash > ((MirrTopoPair_t *)v2)->hash ) return 1;
|
if (((MirrTopoVert_t *)v1)->hash > ((MirrTopoVert_t *)v2)->hash ) return 1;
|
||||||
else if (((MirrTopoPair_t *)v1)->hash < ((MirrTopoPair_t *)v2)->hash ) return -1;
|
else if (((MirrTopoVert_t *)v1)->hash < ((MirrTopoVert_t *)v2)->hash ) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,12 +848,12 @@ int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *
|
|||||||
int totedge;
|
int totedge;
|
||||||
|
|
||||||
if (me->edit_mesh) {
|
if (me->edit_mesh) {
|
||||||
totvert= me->edit_mesh->totvert;
|
totvert = me->edit_mesh->totvert;
|
||||||
totedge= me->edit_mesh->totedge;
|
totedge = me->edit_mesh->totedge;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
totvert= me->totvert;
|
totvert = me->totvert;
|
||||||
totedge= me->totedge;
|
totedge = me->totedge;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (mesh_topo_store->index_lookup==NULL) ||
|
if( (mesh_topo_store->index_lookup==NULL) ||
|
||||||
@ -869,33 +869,36 @@ int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store)
|
void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
|
||||||
|
const short skip_em_vert_array_init)
|
||||||
{
|
{
|
||||||
MEdge *medge;
|
MEdge *medge;
|
||||||
EditMesh *em= me->edit_mesh;
|
EditMesh *em = me->edit_mesh;
|
||||||
void **eve_tmp_back= NULL; /* some of the callers are using eve->tmp so restore after */
|
void **eve_tmp_back = NULL; /* some of the callers are using eve->tmp so restore after */
|
||||||
|
|
||||||
/* editmode*/
|
/* editmode*/
|
||||||
EditEdge *eed;
|
EditEdge *eed;
|
||||||
|
|
||||||
int a, last;
|
int a, last;
|
||||||
int totvert, totedge;
|
int totvert, totedge;
|
||||||
int totUnique= -1, totUniqueOld= -1;
|
int tot_unique = -1, tot_unique_prev = -1;
|
||||||
|
|
||||||
MirrTopoHash_t *MirrTopoHash = NULL;
|
MirrTopoHash_t *topo_hash = NULL;
|
||||||
MirrTopoHash_t *MirrTopoHash_Prev = NULL;
|
MirrTopoHash_t *topo_hash_prev = NULL;
|
||||||
MirrTopoPair_t *MirrTopoPairs;
|
MirrTopoVert_t *topo_pairs;
|
||||||
|
|
||||||
|
intptr_t *index_lookup; /* direct access to mesh_topo_store->index_lookup */
|
||||||
|
|
||||||
/* reallocate if needed */
|
/* reallocate if needed */
|
||||||
ED_mesh_mirrtopo_free(mesh_topo_store);
|
ED_mesh_mirrtopo_free(mesh_topo_store);
|
||||||
|
|
||||||
mesh_topo_store->prev_ob_mode= ob_mode;
|
mesh_topo_store->prev_ob_mode = ob_mode;
|
||||||
|
|
||||||
if(em) {
|
if(em) {
|
||||||
EditVert *eve;
|
EditVert *eve;
|
||||||
totvert= 0;
|
totvert = 0;
|
||||||
eve_tmp_back= MEM_callocN( em->totvert * sizeof(void *), "TopoMirr" );
|
eve_tmp_back = MEM_mallocN(em->totvert * sizeof(void *), "TopoMirr");
|
||||||
for(eve= em->verts.first; eve; eve= eve->next) {
|
for(eve = em->verts.first; eve; eve = eve->next) {
|
||||||
eve_tmp_back[totvert]= eve->tmp.p;
|
eve_tmp_back[totvert]= eve->tmp.p;
|
||||||
eve->tmp.l = totvert++;
|
eve->tmp.l = totvert++;
|
||||||
}
|
}
|
||||||
@ -904,130 +907,139 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
|
|||||||
totvert = me->totvert;
|
totvert = me->totvert;
|
||||||
}
|
}
|
||||||
|
|
||||||
MirrTopoHash = MEM_callocN( totvert * sizeof(MirrTopoHash_t), "TopoMirr" );
|
topo_hash = MEM_callocN(totvert * sizeof(MirrTopoHash_t), "TopoMirr");
|
||||||
|
|
||||||
/* Initialize the vert-edge-user counts used to detect unique topology */
|
/* Initialize the vert-edge-user counts used to detect unique topology */
|
||||||
if(em) {
|
if(em) {
|
||||||
totedge= 0;
|
totedge = 0;
|
||||||
|
|
||||||
for(eed=em->edges.first; eed; eed= eed->next, totedge++) {
|
for(eed=em->edges.first; eed; eed = eed->next, totedge++) {
|
||||||
MirrTopoHash[eed->v1->tmp.l]++;
|
topo_hash[eed->v1->tmp.l]++;
|
||||||
MirrTopoHash[eed->v2->tmp.l]++;
|
topo_hash[eed->v2->tmp.l]++;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
totedge= me->totedge;
|
else {
|
||||||
|
totedge = me->totedge;
|
||||||
|
|
||||||
for(a=0, medge=me->medge; a < me->totedge; a++, medge++) {
|
for(a=0, medge=me->medge; a < me->totedge; a++, medge++) {
|
||||||
MirrTopoHash[medge->v1]++;
|
topo_hash[medge->v1]++;
|
||||||
MirrTopoHash[medge->v2]++;
|
topo_hash[medge->v2]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MirrTopoHash_Prev = MEM_dupallocN( MirrTopoHash );
|
topo_hash_prev = MEM_dupallocN(topo_hash);
|
||||||
|
|
||||||
totUniqueOld = -1;
|
tot_unique_prev = -1;
|
||||||
while(1) {
|
while(1) {
|
||||||
/* use the number of edges per vert to give verts unique topology IDs */
|
/* use the number of edges per vert to give verts unique topology IDs */
|
||||||
|
|
||||||
if(em) {
|
if(em) {
|
||||||
for(eed=em->edges.first; eed; eed= eed->next) {
|
for(eed=em->edges.first; eed; eed = eed->next) {
|
||||||
MirrTopoHash[eed->v1->tmp.l] += MirrTopoHash_Prev[eed->v2->tmp.l];
|
topo_hash[eed->v1->tmp.l] += topo_hash_prev[eed->v2->tmp.l];
|
||||||
MirrTopoHash[eed->v2->tmp.l] += MirrTopoHash_Prev[eed->v1->tmp.l];
|
topo_hash[eed->v2->tmp.l] += topo_hash_prev[eed->v1->tmp.l];
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
|
for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
|
||||||
/* This can make really big numbers, wrapping around here is fine */
|
/* This can make really big numbers, wrapping around here is fine */
|
||||||
MirrTopoHash[medge->v1] += MirrTopoHash_Prev[medge->v2];
|
topo_hash[medge->v1] += topo_hash_prev[medge->v2];
|
||||||
MirrTopoHash[medge->v2] += MirrTopoHash_Prev[medge->v1];
|
topo_hash[medge->v2] += topo_hash_prev[medge->v1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(MirrTopoHash_Prev, MirrTopoHash, sizeof(MirrTopoHash_t) * totvert);
|
memcpy(topo_hash_prev, topo_hash, sizeof(MirrTopoHash_t) * totvert);
|
||||||
|
|
||||||
/* sort so we can count unique values */
|
/* sort so we can count unique values */
|
||||||
qsort(MirrTopoHash_Prev, totvert, sizeof(MirrTopoHash_t), MirrTopo_long_sort);
|
qsort(topo_hash_prev, totvert, sizeof(MirrTopoHash_t), mirrtopo_hash_sort);
|
||||||
|
|
||||||
totUnique = 1; /* account for skiping the first value */
|
tot_unique = 1; /* account for skiping the first value */
|
||||||
for(a=1; a<totvert; a++) {
|
for(a=1; a<totvert; a++) {
|
||||||
if (MirrTopoHash_Prev[a-1] != MirrTopoHash_Prev[a]) {
|
if (topo_hash_prev[a-1] != topo_hash_prev[a]) {
|
||||||
totUnique++;
|
tot_unique++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totUnique <= totUniqueOld) {
|
if (tot_unique <= tot_unique_prev) {
|
||||||
/* Finish searching for unique valus when 1 loop dosnt give a
|
/* Finish searching for unique valus when 1 loop dosnt give a
|
||||||
* higher number of unique values compared to the previous loop */
|
* higher number of unique values compared to the previous loop */
|
||||||
break;
|
break;
|
||||||
} else {
|
}
|
||||||
totUniqueOld = totUnique;
|
else {
|
||||||
|
tot_unique_prev = tot_unique;
|
||||||
}
|
}
|
||||||
/* Copy the hash calculated this iter, so we can use them next time */
|
/* Copy the hash calculated this iter, so we can use them next time */
|
||||||
memcpy(MirrTopoHash_Prev, MirrTopoHash, sizeof(MirrTopoHash_t) * totvert);
|
memcpy(topo_hash_prev, topo_hash, sizeof(MirrTopoHash_t) * totvert);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restore eve->tmp.* */
|
/* restore eve->tmp.* */
|
||||||
if(eve_tmp_back) {
|
if(eve_tmp_back) {
|
||||||
EditVert *eve;
|
EditVert *eve;
|
||||||
totvert= 0;
|
totvert = 0;
|
||||||
for(eve= em->verts.first; eve; eve= eve->next) {
|
for(eve = em->verts.first; eve; eve = eve->next) {
|
||||||
eve->tmp.p= eve_tmp_back[totvert++];
|
eve->tmp.p = eve_tmp_back[totvert++];
|
||||||
}
|
}
|
||||||
|
|
||||||
MEM_freeN(eve_tmp_back);
|
MEM_freeN(eve_tmp_back);
|
||||||
eve_tmp_back= NULL;
|
eve_tmp_back = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Hash/Index pairs are needed for sorting to find index pairs */
|
/* Hash/Index pairs are needed for sorting to find index pairs */
|
||||||
MirrTopoPairs= MEM_callocN( sizeof(MirrTopoPair_t) * totvert, "MirrTopoPairs");
|
topo_pairs = MEM_callocN( sizeof(MirrTopoVert_t) * totvert, "MirrTopoPairs");
|
||||||
|
|
||||||
/* since we are looping through verts, initialize these values here too */
|
/* since we are looping through verts, initialize these values here too */
|
||||||
mesh_topo_store->index_lookup = MEM_mallocN( totvert * sizeof(long), "mesh_topo_lookup" );
|
index_lookup = MEM_mallocN(totvert * sizeof(*index_lookup), "mesh_topo_lookup");
|
||||||
|
|
||||||
if(em) {
|
if(em) {
|
||||||
EM_init_index_arrays(em,1,0,0);
|
if (skip_em_vert_array_init == FALSE) {
|
||||||
|
EM_init_index_arrays(em, 1, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for(a=0; a<totvert; a++) {
|
for(a=0; a<totvert; a++) {
|
||||||
MirrTopoPairs[a].hash= MirrTopoHash[a];
|
topo_pairs[a].hash = topo_hash[a];
|
||||||
MirrTopoPairs[a].v_index = a;
|
topo_pairs[a].v_index = a;
|
||||||
|
|
||||||
/* initialize lookup */
|
/* initialize lookup */
|
||||||
mesh_topo_store->index_lookup[a] = -1;
|
index_lookup[a] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
qsort(MirrTopoPairs, totvert, sizeof(MirrTopoPair_t), MirrTopo_item_sort);
|
qsort(topo_pairs, totvert, sizeof(MirrTopoVert_t), mirrtopo_vert_sort);
|
||||||
|
|
||||||
/* Since the loop starts at 2, we must define the last index where the hash's differ */
|
/* Since the loop starts at 2, we must define the last index where the hash's differ */
|
||||||
last = ((totvert >= 2) && (MirrTopoPairs[0].hash == MirrTopoPairs[1].hash)) ? 0 : 1;
|
last = ((totvert >= 2) && (topo_pairs[0].hash == topo_pairs[1].hash)) ? 0 : 1;
|
||||||
|
|
||||||
/* Get the pairs out of the sorted hashes, note, totvert+1 means we can use the previous 2,
|
/* Get the pairs out of the sorted hashes, note, totvert+1 means we can use the previous 2,
|
||||||
* but you cant ever access the last 'a' index of MirrTopoPairs */
|
* but you cant ever access the last 'a' index of MirrTopoPairs */
|
||||||
for(a=2; a <= totvert; a++) {
|
for(a=2; a <= totvert; a++) {
|
||||||
/* printf("I %d %ld %d\n", (a-last), MirrTopoPairs[a ].hash, MirrTopoPairs[a ].vIndex ); */
|
/* printf("I %d %ld %d\n", (a-last), MirrTopoPairs[a ].hash, MirrTopoPairs[a ].vIndex ); */
|
||||||
if ((a==totvert) || (MirrTopoPairs[a-1].hash != MirrTopoPairs[a].hash)) {
|
if ((a==totvert) || (topo_pairs[a-1].hash != topo_pairs[a].hash)) {
|
||||||
if (a-last==2) {
|
if (a-last==2) {
|
||||||
if(em) {
|
if(em) {
|
||||||
mesh_topo_store->index_lookup[MirrTopoPairs[a-1].v_index] = (intptr_t)EM_get_vert_for_index(MirrTopoPairs[a-2].v_index);
|
index_lookup[topo_pairs[a-1].v_index] = (intptr_t)EM_get_vert_for_index(topo_pairs[a-2].v_index);
|
||||||
mesh_topo_store->index_lookup[MirrTopoPairs[a-2].v_index] = (intptr_t)EM_get_vert_for_index(MirrTopoPairs[a-1].v_index);
|
index_lookup[topo_pairs[a-2].v_index] = (intptr_t)EM_get_vert_for_index(topo_pairs[a-1].v_index);
|
||||||
} else {
|
}
|
||||||
mesh_topo_store->index_lookup[MirrTopoPairs[a-1].v_index] = MirrTopoPairs[a-2].v_index;
|
else {
|
||||||
mesh_topo_store->index_lookup[MirrTopoPairs[a-2].v_index] = MirrTopoPairs[a-1].v_index;
|
index_lookup[topo_pairs[a-1].v_index] = topo_pairs[a-2].v_index;
|
||||||
|
index_lookup[topo_pairs[a-2].v_index] = topo_pairs[a-1].v_index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last= a;
|
last = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(em) {
|
if(em) {
|
||||||
EM_free_index_arrays();
|
if (skip_em_vert_array_init == FALSE) {
|
||||||
|
EM_free_index_arrays();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MEM_freeN( MirrTopoPairs );
|
MEM_freeN(topo_pairs);
|
||||||
MirrTopoPairs = NULL;
|
topo_pairs = NULL;
|
||||||
|
|
||||||
MEM_freeN( MirrTopoHash );
|
MEM_freeN(topo_hash);
|
||||||
MEM_freeN( MirrTopoHash_Prev );
|
MEM_freeN(topo_hash_prev);
|
||||||
|
|
||||||
|
mesh_topo_store->index_lookup = index_lookup;
|
||||||
mesh_topo_store->prev_vert_tot = totvert;
|
mesh_topo_store->prev_vert_tot = totvert;
|
||||||
mesh_topo_store->prev_edge_tot = totedge;
|
mesh_topo_store->prev_edge_tot = totedge;
|
||||||
}
|
}
|
||||||
|
@ -861,7 +861,7 @@ int mesh_mirrtopo_table(Object *ob, char mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(mode=='s') { /* start table */
|
else if(mode=='s') { /* start table */
|
||||||
ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store);
|
ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store, FALSE);
|
||||||
}
|
}
|
||||||
else if(mode=='e') { /* end table */
|
else if(mode=='e') { /* end table */
|
||||||
ED_mesh_mirrtopo_free(&mesh_topo_store);
|
ED_mesh_mirrtopo_free(&mesh_topo_store);
|
||||||
|
@ -2178,3 +2178,51 @@ void OBJECT_OT_logic_bricks_copy(wmOperatorType *ot)
|
|||||||
/* flags */
|
/* flags */
|
||||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
|
{
|
||||||
|
Object *ob=ED_object_active_context(C);
|
||||||
|
|
||||||
|
CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) {
|
||||||
|
if(ob != ob_iter) {
|
||||||
|
ob_iter->gameflag = ob->gameflag;
|
||||||
|
ob_iter->gameflag2 = ob->gameflag2;
|
||||||
|
ob_iter->inertia = ob->inertia;
|
||||||
|
ob_iter->formfactor = ob->formfactor;;
|
||||||
|
ob_iter->damping = ob->damping;
|
||||||
|
ob_iter->rdamping = ob->rdamping;
|
||||||
|
ob_iter->min_vel = ob->min_vel;
|
||||||
|
ob_iter->max_vel = ob->max_vel;
|
||||||
|
ob_iter->obstacleRad = ob->obstacleRad;
|
||||||
|
ob_iter->mass = ob->mass;
|
||||||
|
ob_iter->anisotropicFriction[0] = ob->anisotropicFriction[0];
|
||||||
|
ob_iter->anisotropicFriction[1] = ob->anisotropicFriction[1];
|
||||||
|
ob_iter->anisotropicFriction[2] = ob->anisotropicFriction[2];
|
||||||
|
ob_iter->collision_boundtype = ob->collision_boundtype;
|
||||||
|
ob_iter->margin = ob->margin;
|
||||||
|
ob_iter->bsoft = copy_bulletsoftbody(ob->bsoft);
|
||||||
|
if(ob->restrictflag & OB_RESTRICT_RENDER)
|
||||||
|
ob_iter->restrictflag |= OB_RESTRICT_RENDER;
|
||||||
|
else
|
||||||
|
ob_iter->restrictflag &= ~OB_RESTRICT_RENDER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CTX_DATA_END;
|
||||||
|
|
||||||
|
return OPERATOR_FINISHED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot)
|
||||||
|
{
|
||||||
|
/* identifiers */
|
||||||
|
ot->name= "Copy Game Physics Properties to Selected";
|
||||||
|
ot->description = "Copy game physics properties to other selected objects";
|
||||||
|
ot->idname= "OBJECT_OT_game_physics_copy";
|
||||||
|
|
||||||
|
/* api callbacks */
|
||||||
|
ot->exec= game_physics_copy_exec;
|
||||||
|
ot->poll= ED_operator_object_active_editable;
|
||||||
|
|
||||||
|
/* flags */
|
||||||
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||||
|
}
|
||||||
|
@ -92,6 +92,7 @@ void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
|
|||||||
void OBJECT_OT_game_property_copy(struct wmOperatorType *ot);
|
void OBJECT_OT_game_property_copy(struct wmOperatorType *ot);
|
||||||
void OBJECT_OT_game_property_clear(struct wmOperatorType *ot);
|
void OBJECT_OT_game_property_clear(struct wmOperatorType *ot);
|
||||||
void OBJECT_OT_logic_bricks_copy(struct wmOperatorType *ot);
|
void OBJECT_OT_logic_bricks_copy(struct wmOperatorType *ot);
|
||||||
|
void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot);
|
||||||
|
|
||||||
/* object_select.c */
|
/* object_select.c */
|
||||||
void OBJECT_OT_select_all(struct wmOperatorType *ot);
|
void OBJECT_OT_select_all(struct wmOperatorType *ot);
|
||||||
|
@ -643,7 +643,7 @@ static int modifier_add_exec(bContext *C, wmOperator *op)
|
|||||||
static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
|
static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
|
||||||
{
|
{
|
||||||
Object *ob= ED_object_active_context(C);
|
Object *ob= ED_object_active_context(C);
|
||||||
EnumPropertyItem *item= NULL, *md_item;
|
EnumPropertyItem *item= NULL, *md_item, *group_item= NULL;
|
||||||
ModifierTypeInfo *mti;
|
ModifierTypeInfo *mti;
|
||||||
int totitem= 0, a;
|
int totitem= 0, a;
|
||||||
|
|
||||||
@ -663,6 +663,17 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr)
|
|||||||
(ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh))))
|
(ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh))))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
group_item= md_item;
|
||||||
|
md_item= NULL;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(group_item) {
|
||||||
|
RNA_enum_item_add(&item, &totitem, group_item);
|
||||||
|
group_item= NULL;
|
||||||
|
}
|
||||||
|
|
||||||
RNA_enum_item_add(&item, &totitem, md_item);
|
RNA_enum_item_add(&item, &totitem, md_item);
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,7 @@ void ED_operatortypes_object(void)
|
|||||||
WM_operatortype_append(OBJECT_OT_game_property_copy);
|
WM_operatortype_append(OBJECT_OT_game_property_copy);
|
||||||
WM_operatortype_append(OBJECT_OT_game_property_clear);
|
WM_operatortype_append(OBJECT_OT_game_property_clear);
|
||||||
WM_operatortype_append(OBJECT_OT_logic_bricks_copy);
|
WM_operatortype_append(OBJECT_OT_logic_bricks_copy);
|
||||||
|
WM_operatortype_append(OBJECT_OT_game_physics_copy);
|
||||||
|
|
||||||
WM_operatortype_append(OBJECT_OT_shape_key_add);
|
WM_operatortype_append(OBJECT_OT_shape_key_add);
|
||||||
WM_operatortype_append(OBJECT_OT_shape_key_remove);
|
WM_operatortype_append(OBJECT_OT_shape_key_remove);
|
||||||
|
@ -53,7 +53,6 @@ set(SRC
|
|||||||
intern/indexer_dv.c
|
intern/indexer_dv.c
|
||||||
intern/iris.c
|
intern/iris.c
|
||||||
intern/jpeg.c
|
intern/jpeg.c
|
||||||
intern/md5.c
|
|
||||||
intern/metadata.c
|
intern/metadata.c
|
||||||
intern/module.c
|
intern/module.c
|
||||||
intern/moviecache.c
|
intern/moviecache.c
|
||||||
@ -96,7 +95,6 @@ set(SRC
|
|||||||
intern/dds/Stream.h
|
intern/dds/Stream.h
|
||||||
intern/dds/dds_api.h
|
intern/dds/dds_api.h
|
||||||
intern/imbuf.h
|
intern/imbuf.h
|
||||||
intern/md5.h
|
|
||||||
intern/openexr/openexr_api.h
|
intern/openexr/openexr_api.h
|
||||||
intern/openexr/openexr_multi.h
|
intern/openexr/openexr_multi.h
|
||||||
|
|
||||||
|
@ -1,119 +0,0 @@
|
|||||||
/** \file blender/imbuf/intern/md5.h
|
|
||||||
* \ingroup imbuf
|
|
||||||
*/
|
|
||||||
/* md5.h - Declaration of functions and data types used for MD5 sum
|
|
||||||
computing library functions.
|
|
||||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
||||||
|
|
||||||
#ifndef _MD5_H
|
|
||||||
#define _MD5_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#if defined HAVE_LIMITS_H || defined _LIBC
|
|
||||||
# include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The following contortions are an attempt to use the C preprocessor
|
|
||||||
to determine an unsigned integral type that is 32 bits wide. An
|
|
||||||
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
|
|
||||||
doing that would require that the configure script compile and *run*
|
|
||||||
the resulting executable. Locally running cross-compiled executables
|
|
||||||
is usually not possible. */
|
|
||||||
|
|
||||||
#if defined __STDC__ && __STDC__
|
|
||||||
# define UINT_MAX_32_BITS 4294967295U
|
|
||||||
#else
|
|
||||||
# define UINT_MAX_32_BITS 0xFFFFFFFF
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
|
|
||||||
This should be valid for all systems GNU cares about because
|
|
||||||
that doesn't include 16-bit systems, and only modern systems
|
|
||||||
(that certainly have <limits.h>) have 64+-bit integral types. */
|
|
||||||
|
|
||||||
#ifndef UINT_MAX
|
|
||||||
# define UINT_MAX UINT_MAX_32_BITS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UINT_MAX == UINT_MAX_32_BITS
|
|
||||||
typedef unsigned int md5_uint32;
|
|
||||||
#else
|
|
||||||
# if USHRT_MAX == UINT_MAX_32_BITS
|
|
||||||
typedef unsigned short md5_uint32;
|
|
||||||
# else
|
|
||||||
# if ULONG_MAX == UINT_MAX_32_BITS
|
|
||||||
typedef unsigned long md5_uint32;
|
|
||||||
# else
|
|
||||||
/* The following line is intended to evoke an error.
|
|
||||||
Using #error is not portable enough. */
|
|
||||||
"Cannot determine unsigned 32-bit data type."
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef __P
|
|
||||||
#if defined (__STDC__) && __STDC__
|
|
||||||
#define __P(x) x
|
|
||||||
#else
|
|
||||||
#define __P(x) ()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Structure to save state of computation between the single steps. */
|
|
||||||
struct md5_ctx
|
|
||||||
{
|
|
||||||
md5_uint32 A;
|
|
||||||
md5_uint32 B;
|
|
||||||
md5_uint32 C;
|
|
||||||
md5_uint32 D;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following three functions are build up the low level used in
|
|
||||||
* the functions `md5_stream' and `md5_buffer'.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Initialize structure containing state of computation.
|
|
||||||
(RFC 1321, 3.3: Step 3) */
|
|
||||||
void md5_init_ctx __P ((struct md5_ctx *ctx));
|
|
||||||
|
|
||||||
/* Starting with the result of former calls of this function (or the
|
|
||||||
initialzation function update the context for the next LEN bytes
|
|
||||||
starting at BUFFER.
|
|
||||||
It is necessary that LEN is a multiple of 64!!! */
|
|
||||||
void md5_process_block __P ((const void *buffer, size_t len,
|
|
||||||
struct md5_ctx *ctx));
|
|
||||||
|
|
||||||
/* Put result from CTX in first 16 bytes following RESBUF. The result is
|
|
||||||
always in little endian byte order, so that a byte-wise output yields
|
|
||||||
to the wanted ASCII representation of the message digest. */
|
|
||||||
void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
|
|
||||||
|
|
||||||
|
|
||||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
|
||||||
resulting message digest number will be written into the 16 bytes
|
|
||||||
beginning at RESBLOCK. */
|
|
||||||
int md5_stream __P ((FILE *stream, void *resblock));
|
|
||||||
|
|
||||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
|
||||||
result is always in little endian byte order, so that a byte-wise
|
|
||||||
output yields to the wanted ASCII representation of the message
|
|
||||||
digest. */
|
|
||||||
void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -32,17 +32,18 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "BKE_utildefines.h"
|
|
||||||
#include "BLI_blenlib.h"
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
|
#include "BLI_blenlib.h"
|
||||||
|
#include "BLI_md5.h"
|
||||||
|
|
||||||
|
#include "BKE_utildefines.h"
|
||||||
|
|
||||||
#include "IMB_imbuf_types.h"
|
#include "IMB_imbuf_types.h"
|
||||||
#include "IMB_imbuf.h"
|
#include "IMB_imbuf.h"
|
||||||
#include "IMB_thumbs.h"
|
#include "IMB_thumbs.h"
|
||||||
#include "IMB_metadata.h"
|
#include "IMB_metadata.h"
|
||||||
|
|
||||||
#include "md5.h"
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -78,6 +78,7 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna)
|
|||||||
{IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"},
|
{IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"},
|
||||||
{IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"},
|
{IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"},
|
||||||
{IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "Interpolate a global timestamp using the record date and time written by recording device"},
|
{IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)", "Interpolate a global timestamp using the record date and time written by recording device"},
|
||||||
|
{IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps", "Record run, but ignore timecode, changes in framerate or dropouts"},
|
||||||
{0, NULL, 0, NULL, NULL}};
|
{0, NULL, 0, NULL, NULL}};
|
||||||
|
|
||||||
srna = RNA_def_struct(brna, "MovieClipProxy", NULL);
|
srna = RNA_def_struct(brna, "MovieClipProxy", NULL);
|
||||||
|
@ -2607,40 +2607,43 @@ static void rna_def_userdef_system(BlenderRNA *brna)
|
|||||||
/* hardcoded here, could become dynamic somehow */
|
/* hardcoded here, could become dynamic somehow */
|
||||||
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
|
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
|
||||||
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
|
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
|
||||||
|
/* Note: As this list is in alphabetical order, and not defined order,
|
||||||
|
* here is the highest define currently in use: 28 (serbian latin). */
|
||||||
static EnumPropertyItem language_items[] = {
|
static EnumPropertyItem language_items[] = {
|
||||||
{0, "", 0, "Nearly done", ""},
|
{ 0, "", 0, "Nearly done", ""},
|
||||||
{0, "DEFAULT", 0, "Default (Default)", ""},
|
{ 0, "DEFAULT", 0, "Default (Default)", ""},
|
||||||
{1, "ENGLISH", 0, "English (English)", "en_US"},
|
{ 1, "ENGLISH", 0, "English (English)", "en_US"},
|
||||||
{8, "FRENCH", 0, "French (Français)", "fr_FR"},
|
{ 8, "FRENCH", 0, "French (Français)", "fr_FR"},
|
||||||
{4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
|
{ 4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
|
||||||
{15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
|
{15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
|
||||||
{13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
|
{13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
|
||||||
{9, "SPANISH", 0, "Spanish (Español)", "es"},
|
{ 9, "SPANISH", 0, "Spanish (Español)", "es"},
|
||||||
{14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"},
|
{14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"},
|
||||||
{0, "", 0, "In progress", ""},
|
{ 0, "", 0, "In progress", ""},
|
||||||
{2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
|
|
||||||
{3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"},
|
|
||||||
{5, "GERMAN", 0, "German (Deutsch)", "de_DE"},
|
|
||||||
{6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"},
|
|
||||||
{7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
|
|
||||||
{10, "CATALAN", 0, "Catalan (Català)", "ca_AD"},
|
|
||||||
{11, "CZECH", 0, "Czech (Český)", "cs_CZ"},
|
|
||||||
{12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"},
|
|
||||||
{16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"},
|
|
||||||
{17, "SERBIAN", 0, "Serbian (Српском језику)", "sr_RS"},
|
|
||||||
{18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
|
|
||||||
{19, "POLISH", 0, "Polish (Polski)", "pl_PL"},
|
|
||||||
{20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"},
|
|
||||||
/* using the utf8 flipped form of Arabic (العربية) */
|
/* using the utf8 flipped form of Arabic (العربية) */
|
||||||
{21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
|
{21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
|
||||||
|
{12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"},
|
||||||
{22, "BULGARIAN", 0, "Bulgarian (Български)", "bg_BG"},
|
{22, "BULGARIAN", 0, "Bulgarian (Български)", "bg_BG"},
|
||||||
|
{10, "CATALAN", 0, "Catalan (Català)", "ca_AD"},
|
||||||
|
{16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"},
|
||||||
|
{11, "CZECH", 0, "Czech (Český)", "cs_CZ"},
|
||||||
|
{ 3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"},
|
||||||
|
{ 6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"},
|
||||||
|
{ 5, "GERMAN", 0, "German (Deutsch)", "de_DE"},
|
||||||
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
|
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
|
||||||
|
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
|
||||||
|
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
|
||||||
{24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},
|
{24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},
|
||||||
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
|
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
|
||||||
/* using the utf8 flipped form of Persian (فارسی) */
|
/* using the utf8 flipped form of Persian (فارسی) */
|
||||||
{26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_PE"},
|
{26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_PE"},
|
||||||
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
|
{19, "POLISH", 0, "Polish (Polski)", "pl_PL"},
|
||||||
{0, NULL, 0, NULL, NULL}};
|
{20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"},
|
||||||
|
{17, "SERBIAN", 0, "Serbian (Српски)", "sr"},
|
||||||
|
{28, "SERBIAN_LATIN", 0, "Serbian latin (Srpski latinica)", "sr@latin"},
|
||||||
|
{ 7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
|
||||||
|
{18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
|
||||||
|
{ 0, NULL, 0, NULL, NULL}};
|
||||||
|
|
||||||
srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
|
srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
|
||||||
RNA_def_struct_sdna(srna, "UserDef");
|
RNA_def_struct_sdna(srna, "UserDef");
|
||||||
|
@ -1576,7 +1576,7 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vector_CreatePyObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1));
|
return Vector_CreatePyObject(tvec, ((MatrixObject *)v2)->num_col, Py_NEW, Py_TYPE(vec1));
|
||||||
}
|
}
|
||||||
else if (QuaternionObject_Check(v2)) {
|
else if (QuaternionObject_Check(v2)) {
|
||||||
/* VEC * QUAT */
|
/* VEC * QUAT */
|
||||||
@ -2603,7 +2603,7 @@ if len(unique) != len(items):
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* ROW VECTOR Multiplication - Vector X Matrix
|
/* ROW VECTOR Multiplication - Vector X Matrix
|
||||||
* [x][y][z] * [1][4][7]
|
* [x][y][z] * [1][4][7]
|
||||||
* [2][5][8]
|
* [2][5][8]
|
||||||
* [3][6][9]
|
* [3][6][9]
|
||||||
* vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
|
* vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
|
||||||
@ -2611,7 +2611,7 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
|
|||||||
{
|
{
|
||||||
float vec_cpy[MAX_DIMENSIONS];
|
float vec_cpy[MAX_DIMENSIONS];
|
||||||
double dot = 0.0f;
|
double dot = 0.0f;
|
||||||
int x, y, z= 0, vec_size= vec->size;
|
int row, col, z= 0, vec_size= vec->size;
|
||||||
|
|
||||||
if (mat->num_row != vec_size) {
|
if (mat->num_row != vec_size) {
|
||||||
if (mat->num_row == 4 && vec_size != 3) {
|
if (mat->num_row == 4 && vec_size != 3) {
|
||||||
@ -2632,9 +2632,9 @@ static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *v
|
|||||||
|
|
||||||
rvec[3] = 1.0f;
|
rvec[3] = 1.0f;
|
||||||
//muliplication
|
//muliplication
|
||||||
for (x = 0; x < mat->num_col; x++) {
|
for (col = 0; col < mat->num_col; col++) {
|
||||||
for (y = 0; y < mat->num_row; y++) {
|
for (row = 0; row < mat->num_row; row++) {
|
||||||
dot += MATRIX_ITEM(mat, y, x) * vec_cpy[y];
|
dot += MATRIX_ITEM(mat, row, col) * vec_cpy[row];
|
||||||
}
|
}
|
||||||
rvec[z++] = (float)dot;
|
rvec[z++] = (float)dot;
|
||||||
dot = 0.0f;
|
dot = 0.0f;
|
||||||
|
@ -775,11 +775,11 @@ endif()
|
|||||||
bf_nodes
|
bf_nodes
|
||||||
bf_gpu
|
bf_gpu
|
||||||
bf_blenloader
|
bf_blenloader
|
||||||
|
bf_imbuf
|
||||||
bf_blenlib
|
bf_blenlib
|
||||||
bf_intern_ghost
|
bf_intern_ghost
|
||||||
bf_intern_string
|
bf_intern_string
|
||||||
bf_blenpluginapi
|
bf_blenpluginapi
|
||||||
bf_imbuf
|
|
||||||
bf_avi
|
bf_avi
|
||||||
bf_imbuf_cineon
|
bf_imbuf_cineon
|
||||||
bf_imbuf_openexr
|
bf_imbuf_openexr
|
||||||
|
Loading…
Reference in New Issue
Block a user