forked from bartvdbraak/blender
Merging r50522 through r50572 from trunk into soc-2011-tomato
This commit is contained in:
parent
4f9ee399c0
commit
de7a57a242
@ -27,7 +27,10 @@ macro(list_insert_after
|
|||||||
list_id item_check item_add
|
list_id item_check item_add
|
||||||
)
|
)
|
||||||
set(_index)
|
set(_index)
|
||||||
list(FIND ${list_id} "${item_check}" _index)
|
list(FIND "${list_id}" "${item_check}" _index)
|
||||||
|
if("${_index}" MATCHES "-1")
|
||||||
|
message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
|
||||||
|
endif()
|
||||||
math(EXPR _index "${_index} + 1")
|
math(EXPR _index "${_index} + 1")
|
||||||
list(INSERT ${list_id} "${_index}" ${item_add})
|
list(INSERT ${list_id} "${_index}" ${item_add})
|
||||||
unset(_index)
|
unset(_index)
|
||||||
@ -37,7 +40,10 @@ macro(list_insert_before
|
|||||||
list_id item_check item_add
|
list_id item_check item_add
|
||||||
)
|
)
|
||||||
set(_index)
|
set(_index)
|
||||||
list(FIND ${list_id} "${item_check}" _index)
|
list(FIND "${list_id}" "${item_check}" _index)
|
||||||
|
if("${_index}" MATCHES "-1")
|
||||||
|
message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
|
||||||
|
endif()
|
||||||
list(INSERT ${list_id} "${_index}" ${item_add})
|
list(INSERT ${list_id} "${_index}" ${item_add})
|
||||||
unset(_index)
|
unset(_index)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
5
extern/libmv/third_party/ceres/SConscript
vendored
5
extern/libmv/third_party/ceres/SConscript
vendored
@ -25,6 +25,11 @@ defs.append('CERES_RESTRICT_SCHUR_SPECIALIZATION')
|
|||||||
|
|
||||||
incs = '. ../../ ../../../Eigen3 ./include ./internal ../gflags'
|
incs = '. ../../ ../../../Eigen3 ./include ./internal ../gflags'
|
||||||
|
|
||||||
|
# work around broken hashtable in 10.5 SDK
|
||||||
|
if env['OURPLATFORM'] == 'darwin' and env['WITH_BF_BOOST']:
|
||||||
|
incs += ' ' + env['BF_BOOST_INC']
|
||||||
|
defs.append('CERES_HASH_BOOST')
|
||||||
|
|
||||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||||
incs += ' ../msinttypes'
|
incs += ' ../msinttypes'
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
#ifndef CERES_INTERNAL_COLLECTIONS_PORT_H_
|
#ifndef CERES_INTERNAL_COLLECTIONS_PORT_H_
|
||||||
#define CERES_INTERNAL_COLLECTIONS_PORT_H_
|
#define CERES_INTERNAL_COLLECTIONS_PORT_H_
|
||||||
|
|
||||||
|
#ifdef CERES_HASH_BOOST
|
||||||
|
#include <boost/tr1/unordered_map.hpp>
|
||||||
|
#include <boost/tr1/unordered_set.hpp>
|
||||||
|
#else
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1700
|
#if defined(_MSC_VER) && _MSC_VER <= 1700
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
@ -40,6 +44,8 @@
|
|||||||
#include <tr1/unordered_map>
|
#include <tr1/unordered_map>
|
||||||
#include <tr1/unordered_set>
|
#include <tr1/unordered_set>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "ceres/integral_types.h"
|
#include "ceres/integral_types.h"
|
||||||
#include "ceres/internal/port.h"
|
#include "ceres/internal/port.h"
|
||||||
@ -118,7 +124,11 @@ CERES_HASH_NAMESPACE_START
|
|||||||
|
|
||||||
// Hasher for STL pairs. Requires hashers for both members to be defined.
|
// Hasher for STL pairs. Requires hashers for both members to be defined.
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
#ifdef CERES_HASH_BOOST
|
||||||
|
struct hash {
|
||||||
|
#else
|
||||||
struct hash<pair<T, T> > {
|
struct hash<pair<T, T> > {
|
||||||
|
#endif
|
||||||
size_t operator()(const pair<T, T>& p) const {
|
size_t operator()(const pair<T, T>& p) const {
|
||||||
size_t h1 = hash<T>()(p.first);
|
size_t h1 = hash<T>()(p.first);
|
||||||
size_t h2 = hash<T>()(p.second);
|
size_t h2 = hash<T>()(p.second);
|
||||||
|
@ -53,19 +53,20 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
|
|||||||
|
|
||||||
scene = context.scene
|
scene = context.scene
|
||||||
cscene = scene.cycles
|
cscene = scene.cycles
|
||||||
|
device_type = context.user_preferences.system.compute_device_type
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = cscene.device == 'CPU'
|
sub.enabled = (device_type == 'NONE' or cscene.device == 'CPU')
|
||||||
sub.prop(cscene, "progressive")
|
sub.prop(cscene, "progressive")
|
||||||
|
|
||||||
sub = col.column(align=True)
|
sub = col.column(align=True)
|
||||||
sub.prop(cscene, "seed")
|
sub.prop(cscene, "seed")
|
||||||
sub.prop(cscene, "sample_clamp")
|
sub.prop(cscene, "sample_clamp")
|
||||||
|
|
||||||
if cscene.progressive or cscene.device != 'CPU':
|
if cscene.progressive or (device_type != 'NONE' and cscene.device == 'GPU'):
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.label(text="Samples:")
|
col.label(text="Samples:")
|
||||||
sub = col.column(align=True)
|
sub = col.column(align=True)
|
||||||
|
@ -372,6 +372,12 @@ void BlenderSession::synchronize()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if the session is still resetting the device come back later */
|
||||||
|
if(session->resetting()) {
|
||||||
|
tag_update();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* increase samples, but never decrease */
|
/* increase samples, but never decrease */
|
||||||
session->set_samples(session_params.samples);
|
session->set_samples(session_params.samples);
|
||||||
session->set_pause(BlenderSync::get_session_pause(b_scene, background));
|
session->set_pause(BlenderSync::get_session_pause(b_scene, background));
|
||||||
|
@ -115,6 +115,7 @@ public:
|
|||||||
virtual void task_add(DeviceTask& task) = 0;
|
virtual void task_add(DeviceTask& task) = 0;
|
||||||
virtual void task_wait() = 0;
|
virtual void task_wait() = 0;
|
||||||
virtual void task_cancel() = 0;
|
virtual void task_cancel() = 0;
|
||||||
|
virtual bool task_cancelled() = 0;
|
||||||
|
|
||||||
/* opengl drawing */
|
/* opengl drawing */
|
||||||
virtual void draw_pixels(device_memory& mem, int y, int w, int h,
|
virtual void draw_pixels(device_memory& mem, int y, int w, int h,
|
||||||
|
@ -273,6 +273,11 @@ public:
|
|||||||
{
|
{
|
||||||
task_pool.cancel();
|
task_pool.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool task_cancelled()
|
||||||
|
{
|
||||||
|
return task_pool.cancelled();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Device *device_cpu_create(DeviceInfo& info, int threads)
|
Device *device_cpu_create(DeviceInfo& info, int threads)
|
||||||
|
@ -892,6 +892,11 @@ public:
|
|||||||
{
|
{
|
||||||
task_pool.cancel();
|
task_pool.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool task_cancelled()
|
||||||
|
{
|
||||||
|
return task_pool.cancelled();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Device *device_cuda_create(DeviceInfo& info, bool background)
|
Device *device_cuda_create(DeviceInfo& info, bool background)
|
||||||
|
@ -312,6 +312,14 @@ public:
|
|||||||
foreach(SubDevice& sub, devices)
|
foreach(SubDevice& sub, devices)
|
||||||
sub.device->task_cancel();
|
sub.device->task_cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool task_cancelled()
|
||||||
|
{
|
||||||
|
foreach(SubDevice& sub, devices)
|
||||||
|
if (sub.device->task_cancelled())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Device *device_multi_create(DeviceInfo& info, bool background)
|
Device *device_multi_create(DeviceInfo& info, bool background)
|
||||||
|
@ -724,6 +724,11 @@ public:
|
|||||||
{
|
{
|
||||||
task_pool.cancel();
|
task_pool.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool task_cancelled()
|
||||||
|
{
|
||||||
|
return task_pool.cancelled();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Device *device_opencl_create(DeviceInfo& info, bool background)
|
Device *device_opencl_create(DeviceInfo& info, bool background)
|
||||||
@ -734,29 +739,31 @@ Device *device_opencl_create(DeviceInfo& info, bool background)
|
|||||||
void device_opencl_info(vector<DeviceInfo>& devices)
|
void device_opencl_info(vector<DeviceInfo>& devices)
|
||||||
{
|
{
|
||||||
vector<cl_device_id> device_ids;
|
vector<cl_device_id> device_ids;
|
||||||
cl_uint num_devices;
|
cl_uint num_devices = 0;
|
||||||
cl_platform_id platform_id;
|
vector<cl_platform_id> platform_ids;
|
||||||
cl_uint num_platforms;
|
cl_uint num_platforms = 0;
|
||||||
|
|
||||||
/* get devices */
|
/* get devices */
|
||||||
if(clGetPlatformIDs(0, NULL, &num_platforms) != CL_SUCCESS || num_platforms == 0)
|
if(clGetPlatformIDs(0, NULL, &num_platforms) != CL_SUCCESS || num_platforms == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
platform_ids.resize(num_platforms);
|
||||||
|
|
||||||
if(clGetPlatformIDs(1, &platform_id, NULL) != CL_SUCCESS)
|
if(clGetPlatformIDs(num_platforms, &platform_ids[0], NULL) != CL_SUCCESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU|CL_DEVICE_TYPE_ACCELERATOR, 0, NULL, &num_devices) != CL_SUCCESS)
|
if(clGetDeviceIDs(platform_ids[0], CL_DEVICE_TYPE_GPU|CL_DEVICE_TYPE_ACCELERATOR, 0, NULL, &num_devices) != CL_SUCCESS || num_devices == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
device_ids.resize(num_devices);
|
device_ids.resize(num_devices);
|
||||||
|
|
||||||
if(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU|CL_DEVICE_TYPE_ACCELERATOR, num_devices, &device_ids[0], NULL) != CL_SUCCESS)
|
if(clGetDeviceIDs(platform_ids[0], CL_DEVICE_TYPE_GPU|CL_DEVICE_TYPE_ACCELERATOR, num_devices, &device_ids[0], NULL) != CL_SUCCESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* add devices */
|
/* add devices */
|
||||||
for(int num = 0; num < num_devices; num++) {
|
for(int num = 0; num < num_devices; num++) {
|
||||||
cl_device_id device_id = device_ids[num];
|
cl_device_id device_id = device_ids[num];
|
||||||
char name[1024];
|
char name[1024] = "\0";
|
||||||
|
|
||||||
if(clGetDeviceInfo(device_id, CL_DEVICE_NAME, sizeof(name), &name, NULL) != CL_SUCCESS)
|
if(clGetDeviceInfo(device_id, CL_DEVICE_NAME, sizeof(name), &name, NULL) != CL_SUCCESS)
|
||||||
continue;
|
continue;
|
||||||
|
@ -140,6 +140,12 @@ void Session::reset_gpu(BufferParams& buffer_params, int samples)
|
|||||||
pause_cond.notify_all();
|
pause_cond.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::resetting_gpu() const
|
||||||
|
{
|
||||||
|
/* no need to wait for gpu device */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Session::draw_gpu(BufferParams& buffer_params)
|
bool Session::draw_gpu(BufferParams& buffer_params)
|
||||||
{
|
{
|
||||||
/* block for buffer access */
|
/* block for buffer access */
|
||||||
@ -290,6 +296,11 @@ void Session::reset_cpu(BufferParams& buffer_params, int samples)
|
|||||||
pause_cond.notify_all();
|
pause_cond.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::resetting_cpu() const
|
||||||
|
{
|
||||||
|
return device->task_cancelled();
|
||||||
|
}
|
||||||
|
|
||||||
bool Session::draw_cpu(BufferParams& buffer_params)
|
bool Session::draw_cpu(BufferParams& buffer_params)
|
||||||
{
|
{
|
||||||
thread_scoped_lock display_lock(display_mutex);
|
thread_scoped_lock display_lock(display_mutex);
|
||||||
@ -584,6 +595,14 @@ void Session::reset(BufferParams& buffer_params, int samples)
|
|||||||
reset_cpu(buffer_params, samples);
|
reset_cpu(buffer_params, samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::resetting() const
|
||||||
|
{
|
||||||
|
if(device_use_gl)
|
||||||
|
return resetting_gpu();
|
||||||
|
else
|
||||||
|
return resetting_cpu();
|
||||||
|
}
|
||||||
|
|
||||||
void Session::set_samples(int samples)
|
void Session::set_samples(int samples)
|
||||||
{
|
{
|
||||||
if(samples != params.samples) {
|
if(samples != params.samples) {
|
||||||
|
@ -116,6 +116,7 @@ public:
|
|||||||
|
|
||||||
bool ready_to_reset();
|
bool ready_to_reset();
|
||||||
void reset(BufferParams& params, int samples);
|
void reset(BufferParams& params, int samples);
|
||||||
|
bool resetting() const;
|
||||||
void set_samples(int samples);
|
void set_samples(int samples);
|
||||||
void set_pause(bool pause);
|
void set_pause(bool pause);
|
||||||
|
|
||||||
@ -139,10 +140,12 @@ protected:
|
|||||||
void run_cpu();
|
void run_cpu();
|
||||||
bool draw_cpu(BufferParams& params);
|
bool draw_cpu(BufferParams& params);
|
||||||
void reset_cpu(BufferParams& params, int samples);
|
void reset_cpu(BufferParams& params, int samples);
|
||||||
|
bool resetting_cpu() const;
|
||||||
|
|
||||||
void run_gpu();
|
void run_gpu();
|
||||||
bool draw_gpu(BufferParams& params);
|
bool draw_gpu(BufferParams& params);
|
||||||
void reset_gpu(BufferParams& params, int samples);
|
void reset_gpu(BufferParams& params, int samples);
|
||||||
|
bool resetting_gpu() const;
|
||||||
|
|
||||||
bool acquire_tile(Device *tile_device, RenderTile& tile);
|
bool acquire_tile(Device *tile_device, RenderTile& tile);
|
||||||
void update_tile_sample(RenderTile& tile);
|
void update_tile_sample(RenderTile& tile);
|
||||||
|
@ -235,8 +235,10 @@ int clLibraryInit()
|
|||||||
__clewEnqueueBarrier = (PFNCLENQUEUEBARRIER )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier");
|
__clewEnqueueBarrier = (PFNCLENQUEUEBARRIER )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier");
|
||||||
__clewGetExtensionFunctionAddress = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress");
|
__clewGetExtensionFunctionAddress = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress");
|
||||||
|
|
||||||
if(__clewGetPlatformIDs == NULL)
|
if(__clewGetPlatformIDs == NULL) return 0;
|
||||||
return 0;
|
if(__clewGetPlatformInfo == NULL) return 0;
|
||||||
|
if(__clewGetDeviceIDs == NULL) return 0;
|
||||||
|
if(__clewGetDeviceInfo == NULL) return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,8 @@ TaskPool::~TaskPool()
|
|||||||
|
|
||||||
void TaskPool::push(Task *task, bool front)
|
void TaskPool::push(Task *task, bool front)
|
||||||
{
|
{
|
||||||
|
thread_scoped_lock num_lock(num_mutex);
|
||||||
|
|
||||||
TaskScheduler::Entry entry;
|
TaskScheduler::Entry entry;
|
||||||
|
|
||||||
entry.task = task;
|
entry.task = task;
|
||||||
@ -102,22 +104,17 @@ void TaskPool::wait_work()
|
|||||||
|
|
||||||
void TaskPool::cancel()
|
void TaskPool::cancel()
|
||||||
{
|
{
|
||||||
|
thread_scoped_lock num_lock(num_mutex);
|
||||||
|
|
||||||
do_cancel = true;
|
do_cancel = true;
|
||||||
|
|
||||||
TaskScheduler::clear(this);
|
TaskScheduler::clear(this);
|
||||||
|
|
||||||
{
|
|
||||||
thread_scoped_lock num_lock(num_mutex);
|
|
||||||
|
|
||||||
while(num)
|
|
||||||
num_cond.wait(num_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
do_cancel = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskPool::stop()
|
void TaskPool::stop()
|
||||||
{
|
{
|
||||||
|
thread_scoped_lock num_lock(num_mutex);
|
||||||
|
|
||||||
TaskScheduler::clear(this);
|
TaskScheduler::clear(this);
|
||||||
|
|
||||||
assert(num == 0);
|
assert(num == 0);
|
||||||
@ -130,20 +127,20 @@ bool TaskPool::cancelled()
|
|||||||
|
|
||||||
void TaskPool::num_decrease(int done)
|
void TaskPool::num_decrease(int done)
|
||||||
{
|
{
|
||||||
num_mutex.lock();
|
|
||||||
num -= done;
|
num -= done;
|
||||||
|
|
||||||
assert(num >= 0);
|
assert(num >= 0);
|
||||||
if(num == 0)
|
|
||||||
|
if(num == 0) {
|
||||||
|
do_cancel = false;
|
||||||
|
|
||||||
num_cond.notify_all();
|
num_cond.notify_all();
|
||||||
|
}
|
||||||
num_mutex.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskPool::num_increase()
|
void TaskPool::num_increase()
|
||||||
{
|
{
|
||||||
thread_scoped_lock num_lock(num_mutex);
|
|
||||||
num++;
|
num++;
|
||||||
|
|
||||||
num_cond.notify_all();
|
num_cond.notify_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +236,11 @@ void TaskScheduler::thread_run(int thread_id)
|
|||||||
delete entry.task;
|
delete entry.task;
|
||||||
|
|
||||||
/* notify pool task was done */
|
/* notify pool task was done */
|
||||||
entry.pool->num_decrease(1);
|
{
|
||||||
|
/* not called from TaskPool, have to explicitly lock the mutex here */
|
||||||
|
thread_scoped_lock num_lock(entry.pool->num_mutex);
|
||||||
|
entry.pool->num_decrease(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,8 +146,14 @@ class PlayRenderedAnim(Operator):
|
|||||||
# launch it
|
# launch it
|
||||||
print("Executing command:\n %r" % " ".join(cmd))
|
print("Executing command:\n %r" % " ".join(cmd))
|
||||||
|
|
||||||
|
# workaround for boost 1.46, can be eventually removed. bug: [#32350]
|
||||||
|
env_copy = os.environ.copy()
|
||||||
|
if preset == 'INTERNAL':
|
||||||
|
env_copy["LC_ALL"] = "C"
|
||||||
|
# end workaround
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.Popen(cmd)
|
subprocess.Popen(cmd, env=env_copy)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.report({'ERROR'},
|
self.report({'ERROR'},
|
||||||
"Couldn't run external animation player with command "
|
"Couldn't run external animation player with command "
|
||||||
|
@ -847,28 +847,35 @@ class WM_OT_doc_view_manual(Operator):
|
|||||||
doc_id = doc_id
|
doc_id = doc_id
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _find_reference(rna_id, url_mapping):
|
def _find_reference(rna_id, url_mapping, verbose=True):
|
||||||
print("online manual check for: '%s'... " % rna_id)
|
if verbose:
|
||||||
|
print("online manual check for: '%s'... " % rna_id)
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
for pattern, url_suffix in url_mapping:
|
for pattern, url_suffix in url_mapping:
|
||||||
if fnmatch(rna_id, pattern):
|
if fnmatch(rna_id, pattern):
|
||||||
print(" match found: '%s' --> '%s'" % (pattern, url_suffix))
|
if verbose:
|
||||||
|
print(" match found: '%s' --> '%s'" % (pattern, url_suffix))
|
||||||
return url_suffix
|
return url_suffix
|
||||||
print("match not found")
|
if verbose:
|
||||||
|
print("match not found")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _lookup_rna_url(rna_id, verbose=True):
|
||||||
|
url = None
|
||||||
|
for prefix, url_manual_mapping in bpy.utils.manual_map():
|
||||||
|
rna_ref = WM_OT_doc_view_manual._find_reference(rna_id, url_manual_mapping, verbose=verbose)
|
||||||
|
if rna_ref is not None:
|
||||||
|
url = prefix + rna_ref
|
||||||
|
break
|
||||||
|
return url
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
rna_id = _wm_doc_get_id(self.doc_id, do_url=False)
|
rna_id = _wm_doc_get_id(self.doc_id, do_url=False)
|
||||||
if rna_id is None:
|
if rna_id is None:
|
||||||
return {'PASS_THROUGH'}
|
return {'PASS_THROUGH'}
|
||||||
|
|
||||||
url = None
|
url = self._lookup_rna_url(rna_id)
|
||||||
|
|
||||||
for prefix, url_manual_mapping in bpy.utils.manual_map():
|
|
||||||
rna_ref = self._find_reference(rna_id, url_manual_mapping)
|
|
||||||
if rna_ref is not None:
|
|
||||||
url = prefix + rna_ref
|
|
||||||
break
|
|
||||||
|
|
||||||
if url is None:
|
if url is None:
|
||||||
self.report({'WARNING'}, "No reference available %r, "
|
self.report({'WARNING'}, "No reference available %r, "
|
||||||
|
@ -65,6 +65,7 @@ int where_on_path(struct Object *ob, float ctime, float vec[4], float dir[3], fl
|
|||||||
/* ---------------------------------------------------- */
|
/* ---------------------------------------------------- */
|
||||||
/* Dupli-Geometry */
|
/* Dupli-Geometry */
|
||||||
|
|
||||||
|
struct ListBase *object_duplilist_ex(struct Scene *sce, struct Object *ob, int update);
|
||||||
struct ListBase *object_duplilist(struct Scene *sce, struct Object *ob);
|
struct ListBase *object_duplilist(struct Scene *sce, struct Object *ob);
|
||||||
void free_object_duplilist(struct ListBase *lb);
|
void free_object_duplilist(struct ListBase *lb);
|
||||||
int count_duplilist(struct Object *ob);
|
int count_duplilist(struct Object *ob);
|
||||||
|
@ -203,6 +203,10 @@ int BKE_image_scale(struct Image *image, int width, int height);
|
|||||||
/* check if texture has alpha (depth=32) */
|
/* check if texture has alpha (depth=32) */
|
||||||
int BKE_image_has_alpha(struct Image *image);
|
int BKE_image_has_alpha(struct Image *image);
|
||||||
|
|
||||||
|
void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *width, int *height);
|
||||||
|
void BKE_image_get_size_fl(struct Image *image, struct ImageUser *iuser, float size[2]);
|
||||||
|
void BKE_image_get_aspect(struct Image *image, float *aspx, float *aspy);
|
||||||
|
|
||||||
/* image_gen.c */
|
/* image_gen.c */
|
||||||
void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, const float color[4]);
|
void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, const float color[4]);
|
||||||
void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int height, int width);
|
void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int height, int width);
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
#ifndef __BKE_MASK_H__
|
#ifndef __BKE_MASK_H__
|
||||||
#define __BKE_MASK_H__
|
#define __BKE_MASK_H__
|
||||||
|
|
||||||
|
struct ImageUser;
|
||||||
|
struct Image;
|
||||||
struct ListBase;
|
struct ListBase;
|
||||||
struct Main;
|
struct Main;
|
||||||
struct Mask;
|
struct Mask;
|
||||||
@ -103,10 +105,12 @@ struct Mask *BKE_mask_copy(struct Mask *mask);
|
|||||||
void BKE_mask_free(struct Mask *mask);
|
void BKE_mask_free(struct Mask *mask);
|
||||||
void BKE_mask_unlink(struct Main *bmain, struct Mask *mask);
|
void BKE_mask_unlink(struct Main *bmain, struct Mask *mask);
|
||||||
|
|
||||||
void BKE_mask_coord_from_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2]);
|
|
||||||
void BKE_mask_coord_from_frame(float r_co[2], const float co[2], const float frame_size[2]);
|
void BKE_mask_coord_from_frame(float r_co[2], const float co[2], const float frame_size[2]);
|
||||||
void BKE_mask_coord_to_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2]);
|
void BKE_mask_coord_from_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2]);
|
||||||
|
void BKE_mask_coord_from_image(struct Image *image, struct ImageUser *iuser, float r_co[2], const float co[2]);
|
||||||
void BKE_mask_coord_to_frame(float r_co[2], const float co[2], const float frame_size[2]);
|
void BKE_mask_coord_to_frame(float r_co[2], const float co[2], const float frame_size[2]);
|
||||||
|
void BKE_mask_coord_to_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2]);
|
||||||
|
void BKE_mask_coord_to_image(struct Image *image, struct ImageUser *iuser, float r_co[2], const float co[2]);
|
||||||
|
|
||||||
/* parenting */
|
/* parenting */
|
||||||
|
|
||||||
|
@ -51,9 +51,10 @@ struct ImBuf *BKE_movieclip_get_postprocessed_ibuf(struct MovieClip *clip, struc
|
|||||||
struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag);
|
struct ImBuf *BKE_movieclip_get_stable_ibuf(struct MovieClip *clip, struct MovieClipUser *user, float loc[2], float *scale, float *angle, int postprocess_flag);
|
||||||
struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag, int cache_flag);
|
struct ImBuf *BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, struct MovieClipUser *user, int flag, int cache_flag);
|
||||||
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
|
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height);
|
||||||
int BKE_movieclip_get_duration(struct MovieClip *clip);
|
void BKE_movieclip_get_size_fl(struct MovieClip *clip, struct MovieClipUser *user, float size[2]);
|
||||||
void BKE_movieclip_aspect(struct MovieClip *clip, float *aspx, float *aspy);
|
int BKE_movieclip_get_duration(struct MovieClip *clip);
|
||||||
int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
|
void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy);
|
||||||
|
int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
|
||||||
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
|
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
|
||||||
|
|
||||||
void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes);
|
void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes);
|
||||||
|
@ -307,6 +307,7 @@ int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char
|
|||||||
|
|
||||||
int BKE_sequence_check_depend(struct Sequence *seq, struct Sequence *cur);
|
int BKE_sequence_check_depend(struct Sequence *seq, struct Sequence *cur);
|
||||||
void BKE_sequence_invalidate_cache(struct Scene *scene, struct Sequence *seq);
|
void BKE_sequence_invalidate_cache(struct Scene *scene, struct Sequence *seq);
|
||||||
|
void BKE_sequence_invalidate_deendent(struct Scene *scene, struct Sequence *seq);
|
||||||
void BKE_sequence_invalidate_cache_for_modifier(struct Scene *scene, struct Sequence *seq);
|
void BKE_sequence_invalidate_cache_for_modifier(struct Scene *scene, struct Sequence *seq);
|
||||||
|
|
||||||
void BKE_sequencer_update_sound_bounds_all(struct Scene *scene);
|
void BKE_sequencer_update_sound_bounds_all(struct Scene *scene);
|
||||||
|
@ -526,18 +526,12 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
|
|||||||
bPose *outPose;
|
bPose *outPose;
|
||||||
bPoseChannel *pchan;
|
bPoseChannel *pchan;
|
||||||
ListBase listb;
|
ListBase listb;
|
||||||
|
|
||||||
if (!src) {
|
if (!src) {
|
||||||
*dst = NULL;
|
*dst = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*dst == src) {
|
|
||||||
printf("BKE_pose_copy_data source and target are the same\n");
|
|
||||||
*dst = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
outPose = MEM_callocN(sizeof(bPose), "pose");
|
outPose = MEM_callocN(sizeof(bPose), "pose");
|
||||||
|
|
||||||
BLI_duplicatelist(&outPose->chanbase, &src->chanbase);
|
BLI_duplicatelist(&outPose->chanbase, &src->chanbase);
|
||||||
|
@ -74,7 +74,8 @@
|
|||||||
/* --------------------- */
|
/* --------------------- */
|
||||||
/* forward declarations */
|
/* forward declarations */
|
||||||
|
|
||||||
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index, int level, int animated);
|
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index,
|
||||||
|
int level, short animated, short update);
|
||||||
|
|
||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
/* Animation Visualization */
|
/* Animation Visualization */
|
||||||
@ -699,7 +700,7 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
|
|||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
/* Dupli-Geometry */
|
/* Dupli-Geometry */
|
||||||
|
|
||||||
static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], int lay, int index, int par_index, int type, int animated)
|
static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], int lay, int index, int par_index, int type, short animated)
|
||||||
{
|
{
|
||||||
DupliObject *dob = MEM_callocN(sizeof(DupliObject), "dupliobject");
|
DupliObject *dob = MEM_callocN(sizeof(DupliObject), "dupliobject");
|
||||||
|
|
||||||
@ -717,7 +718,8 @@ static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], i
|
|||||||
return dob;
|
return dob;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index, int level, int animated)
|
static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index,
|
||||||
|
int level, short animated, short update)
|
||||||
{
|
{
|
||||||
DupliObject *dob;
|
DupliObject *dob;
|
||||||
Group *group;
|
Group *group;
|
||||||
@ -731,8 +733,14 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_inde
|
|||||||
if (level > MAX_DUPLI_RECUR) return;
|
if (level > MAX_DUPLI_RECUR) return;
|
||||||
|
|
||||||
/* handles animated groups, and */
|
/* handles animated groups, and */
|
||||||
|
|
||||||
/* we need to check update for objects that are not in scene... */
|
/* we need to check update for objects that are not in scene... */
|
||||||
group_handle_recalc_and_update(scene, ob, group);
|
if (update) {
|
||||||
|
/* note: update is optional because we don't always need object
|
||||||
|
* transformations to be correct. Also fixes bug [#29616]. */
|
||||||
|
group_handle_recalc_and_update(scene, ob, group);
|
||||||
|
}
|
||||||
|
|
||||||
animated = animated || group_is_animated(ob, group);
|
animated = animated || group_is_animated(ob, group);
|
||||||
|
|
||||||
for (go = group->gobject.first; go; go = go->next) {
|
for (go = group->gobject.first; go; go = go->next) {
|
||||||
@ -764,14 +772,14 @@ static void group_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_inde
|
|||||||
|
|
||||||
if (go->ob->transflag & OB_DUPLI) {
|
if (go->ob->transflag & OB_DUPLI) {
|
||||||
copy_m4_m4(dob->ob->obmat, dob->mat);
|
copy_m4_m4(dob->ob->obmat, dob->mat);
|
||||||
object_duplilist_recursive(&group->id, scene, go->ob, lb, ob->obmat, par_index, level + 1, animated);
|
object_duplilist_recursive(&group->id, scene, go->ob, lb, ob->obmat, par_index, level + 1, animated, update);
|
||||||
copy_m4_m4(dob->ob->obmat, dob->omat);
|
copy_m4_m4(dob->ob->obmat, dob->omat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index, int level, int animated)
|
static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_index, int level, short animated)
|
||||||
{
|
{
|
||||||
extern int enable_cu_speed; /* object.c */
|
extern int enable_cu_speed; /* object.c */
|
||||||
Object copyob;
|
Object copyob;
|
||||||
@ -843,7 +851,8 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int par_ind
|
|||||||
typedef struct VertexDupliData {
|
typedef struct VertexDupliData {
|
||||||
ID *id; /* scene or group, for recursive loops */
|
ID *id; /* scene or group, for recursive loops */
|
||||||
int level;
|
int level;
|
||||||
int animated;
|
short animated;
|
||||||
|
short update;
|
||||||
ListBase *lb;
|
ListBase *lb;
|
||||||
float pmat[4][4];
|
float pmat[4][4];
|
||||||
float obmat[4][4]; /* Only used for dupliverts inside dupligroups, where the ob->obmat is modified */
|
float obmat[4][4]; /* Only used for dupliverts inside dupligroups, where the ob->obmat is modified */
|
||||||
@ -899,12 +908,13 @@ static void vertex_dupli__mapFunc(void *userData, int index, const float co[3],
|
|||||||
float tmpmat[4][4];
|
float tmpmat[4][4];
|
||||||
copy_m4_m4(tmpmat, vdd->ob->obmat);
|
copy_m4_m4(tmpmat, vdd->ob->obmat);
|
||||||
copy_m4_m4(vdd->ob->obmat, obmat); /* pretend we are really this mat */
|
copy_m4_m4(vdd->ob->obmat, obmat); /* pretend we are really this mat */
|
||||||
object_duplilist_recursive((ID *)vdd->id, vdd->scene, vdd->ob, vdd->lb, obmat, vdd->par_index, vdd->level + 1, vdd->animated);
|
object_duplilist_recursive((ID *)vdd->id, vdd->scene, vdd->ob, vdd->lb, obmat, vdd->par_index, vdd->level + 1, vdd->animated, vdd->update);
|
||||||
copy_m4_m4(vdd->ob->obmat, tmpmat);
|
copy_m4_m4(vdd->ob->obmat, tmpmat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int par_index, int level, int animated)
|
static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int par_index,
|
||||||
|
int level, short animated, short update)
|
||||||
{
|
{
|
||||||
Object *ob, *ob_iter;
|
Object *ob, *ob_iter;
|
||||||
Mesh *me = par->data;
|
Mesh *me = par->data;
|
||||||
@ -983,6 +993,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
|
|||||||
vdd.id = id;
|
vdd.id = id;
|
||||||
vdd.level = level;
|
vdd.level = level;
|
||||||
vdd.animated = animated;
|
vdd.animated = animated;
|
||||||
|
vdd.update = update;
|
||||||
vdd.lb = lb;
|
vdd.lb = lb;
|
||||||
vdd.ob = ob;
|
vdd.ob = ob;
|
||||||
vdd.scene = scene;
|
vdd.scene = scene;
|
||||||
@ -1027,7 +1038,8 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
|
|||||||
dm->release(dm);
|
dm->release(dm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int par_index, int level, int animated)
|
static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int par_index,
|
||||||
|
int level, short animated, short update)
|
||||||
{
|
{
|
||||||
Object *ob, *ob_iter;
|
Object *ob, *ob_iter;
|
||||||
Base *base = NULL;
|
Base *base = NULL;
|
||||||
@ -1197,7 +1209,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
|
|||||||
float tmpmat[4][4];
|
float tmpmat[4][4];
|
||||||
copy_m4_m4(tmpmat, ob->obmat);
|
copy_m4_m4(tmpmat, ob->obmat);
|
||||||
copy_m4_m4(ob->obmat, obmat); /* pretend we are really this mat */
|
copy_m4_m4(ob->obmat, obmat); /* pretend we are really this mat */
|
||||||
object_duplilist_recursive((ID *)id, scene, ob, lb, ob->obmat, par_index, level + 1, animated);
|
object_duplilist_recursive((ID *)id, scene, ob, lb, ob->obmat, par_index, level + 1, animated, update);
|
||||||
copy_m4_m4(ob->obmat, tmpmat);
|
copy_m4_m4(ob->obmat, tmpmat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1217,7 +1229,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
|
|||||||
dm->release(dm);
|
dm->release(dm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int UNUSED(par_index), ParticleSystem *psys, int level, int animated)
|
static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], int UNUSED(par_index), ParticleSystem *psys,
|
||||||
|
int level, short animated, short update)
|
||||||
{
|
{
|
||||||
GroupObject *go;
|
GroupObject *go;
|
||||||
Object *ob = NULL, **oblist = NULL, obcopy, *obcopylist = NULL;
|
Object *ob = NULL, **oblist = NULL, obcopy, *obcopylist = NULL;
|
||||||
@ -1300,7 +1313,9 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
|
|||||||
|
|
||||||
/* gather list of objects or single object */
|
/* gather list of objects or single object */
|
||||||
if (part->ren_as == PART_DRAW_GR) {
|
if (part->ren_as == PART_DRAW_GR) {
|
||||||
group_handle_recalc_and_update(scene, par, part->dup_group);
|
if (update) {
|
||||||
|
group_handle_recalc_and_update(scene, par, part->dup_group);
|
||||||
|
}
|
||||||
|
|
||||||
if (part->draw & PART_DRAW_COUNT_GR) {
|
if (part->draw & PART_DRAW_COUNT_GR) {
|
||||||
for (dw = part->dupliweights.first; dw; dw = dw->next)
|
for (dw = part->dupliweights.first; dw; dw = dw->next)
|
||||||
@ -1555,7 +1570,7 @@ static Object *find_family_object(Object **obar, char *family, char ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_index, int level, int animated)
|
static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_index, int level, short animated)
|
||||||
{
|
{
|
||||||
Object *ob, *obar[256] = {NULL};
|
Object *ob, *obar[256] = {NULL};
|
||||||
Curve *cu;
|
Curve *cu;
|
||||||
@ -1603,7 +1618,8 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int par_inde
|
|||||||
|
|
||||||
/* ------------- */
|
/* ------------- */
|
||||||
|
|
||||||
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index, int level, int animated)
|
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index,
|
||||||
|
int level, short animated, short update)
|
||||||
{
|
{
|
||||||
if ((ob->transflag & OB_DUPLI) == 0)
|
if ((ob->transflag & OB_DUPLI) == 0)
|
||||||
return;
|
return;
|
||||||
@ -1623,11 +1639,11 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
|
|||||||
if (ob->transflag & OB_DUPLIPARTS) {
|
if (ob->transflag & OB_DUPLIPARTS) {
|
||||||
ParticleSystem *psys = ob->particlesystem.first;
|
ParticleSystem *psys = ob->particlesystem.first;
|
||||||
for (; psys; psys = psys->next)
|
for (; psys; psys = psys->next)
|
||||||
new_particle_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, psys, level + 1, animated);
|
new_particle_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, psys, level + 1, animated, update);
|
||||||
}
|
}
|
||||||
else if (ob->transflag & OB_DUPLIVERTS) {
|
else if (ob->transflag & OB_DUPLIVERTS) {
|
||||||
if (ob->type == OB_MESH) {
|
if (ob->type == OB_MESH) {
|
||||||
vertex_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, animated);
|
vertex_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, animated, update);
|
||||||
}
|
}
|
||||||
else if (ob->type == OB_FONT) {
|
else if (ob->type == OB_FONT) {
|
||||||
if (GS(id->name) == ID_SCE) { /* TODO - support dupligroups */
|
if (GS(id->name) == ID_SCE) { /* TODO - support dupligroups */
|
||||||
@ -1637,7 +1653,7 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
|
|||||||
}
|
}
|
||||||
else if (ob->transflag & OB_DUPLIFACES) {
|
else if (ob->transflag & OB_DUPLIFACES) {
|
||||||
if (ob->type == OB_MESH)
|
if (ob->type == OB_MESH)
|
||||||
face_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, animated);
|
face_duplilist(duplilist, id, scene, ob, par_space_mat, par_index, level + 1, animated, update);
|
||||||
}
|
}
|
||||||
else if (ob->transflag & OB_DUPLIFRAMES) {
|
else if (ob->transflag & OB_DUPLIFRAMES) {
|
||||||
if (GS(id->name) == ID_SCE) { /* TODO - support dupligroups */
|
if (GS(id->name) == ID_SCE) { /* TODO - support dupligroups */
|
||||||
@ -1647,7 +1663,7 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
|
|||||||
else if (ob->transflag & OB_DUPLIGROUP) {
|
else if (ob->transflag & OB_DUPLIGROUP) {
|
||||||
DupliObject *dob;
|
DupliObject *dob;
|
||||||
|
|
||||||
group_duplilist(duplilist, scene, ob, par_index, level + 1, animated); /* now recursive */
|
group_duplilist(duplilist, scene, ob, par_index, level + 1, animated, update); /* now recursive */
|
||||||
|
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
for (dob = duplilist->first; dob; dob = dob->next)
|
for (dob = duplilist->first; dob; dob = dob->next)
|
||||||
@ -1659,14 +1675,22 @@ static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBas
|
|||||||
|
|
||||||
/* Returns a list of DupliObject
|
/* Returns a list of DupliObject
|
||||||
* note; group dupli's already set transform matrix. see note in group_duplilist() */
|
* note; group dupli's already set transform matrix. see note in group_duplilist() */
|
||||||
ListBase *object_duplilist(Scene *sce, Object *ob)
|
ListBase *object_duplilist_ex(Scene *sce, Object *ob, int update)
|
||||||
{
|
{
|
||||||
ListBase *duplilist = MEM_mallocN(sizeof(ListBase), "duplilist");
|
ListBase *duplilist = MEM_mallocN(sizeof(ListBase), "duplilist");
|
||||||
duplilist->first = duplilist->last = NULL;
|
duplilist->first = duplilist->last = NULL;
|
||||||
object_duplilist_recursive((ID *)sce, sce, ob, duplilist, NULL, 0, 0, 0);
|
object_duplilist_recursive((ID *)sce, sce, ob, duplilist, NULL, 0, 0, 0, update);
|
||||||
return duplilist;
|
return duplilist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* note: previously updating was always done, this is why it defaults to be on
|
||||||
|
* but there are likely places it can be called without updating */
|
||||||
|
ListBase *object_duplilist(Scene *sce, Object *ob)
|
||||||
|
{
|
||||||
|
return object_duplilist_ex(sce, ob, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void free_object_duplilist(ListBase *lb)
|
void free_object_duplilist(ListBase *lb)
|
||||||
{
|
{
|
||||||
DupliObject *dob;
|
DupliObject *dob;
|
||||||
|
@ -504,8 +504,8 @@ short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
|
|||||||
xmaxv = MAX3(xmaxv, bezt_last->vec[1][0], bezt_last->vec[2][0]);
|
xmaxv = MAX3(xmaxv, bezt_last->vec[1][0], bezt_last->vec[2][0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xminv = MIN2(xminv, bezt_first->vec[1][0]);
|
xminv = minf(xminv, bezt_first->vec[1][0]);
|
||||||
xmaxv = MAX2(xmaxv, bezt_last->vec[1][0]);
|
xmaxv = maxf(xmaxv, bezt_last->vec[1][0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -521,8 +521,8 @@ short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
|
|||||||
ymaxv = MAX4(ymaxv, bezt->vec[1][1], bezt->vec[0][1], bezt->vec[2][1]);
|
ymaxv = MAX4(ymaxv, bezt->vec[1][1], bezt->vec[0][1], bezt->vec[2][1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
yminv = MIN2(yminv, bezt->vec[1][1]);
|
yminv = minf(yminv, bezt->vec[1][1]);
|
||||||
ymaxv = MAX2(ymaxv, bezt->vec[1][1]);
|
ymaxv = maxf(ymaxv, bezt->vec[1][1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
foundvert = TRUE;
|
foundvert = TRUE;
|
||||||
@ -533,8 +533,8 @@ short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
|
|||||||
else if (fcu->fpt) {
|
else if (fcu->fpt) {
|
||||||
/* frame range can be directly calculated from end verts */
|
/* frame range can be directly calculated from end verts */
|
||||||
if (xmin || xmax) {
|
if (xmin || xmax) {
|
||||||
xminv = MIN2(xminv, fcu->fpt[0].vec[0]);
|
xminv = minf(xminv, fcu->fpt[0].vec[0]);
|
||||||
xmaxv = MAX2(xmaxv, fcu->fpt[fcu->totvert - 1].vec[0]);
|
xmaxv = maxf(xmaxv, fcu->fpt[fcu->totvert - 1].vec[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* only loop over keyframes to find extents for values if needed */
|
/* only loop over keyframes to find extents for values if needed */
|
||||||
@ -591,15 +591,15 @@ void calc_fcurve_range(FCurve *fcu, float *start, float *end,
|
|||||||
if (bezt_first) {
|
if (bezt_first) {
|
||||||
BLI_assert(bezt_last != NULL);
|
BLI_assert(bezt_last != NULL);
|
||||||
|
|
||||||
min = MIN2(min, bezt_first->vec[1][0]);
|
min = minf(min, bezt_first->vec[1][0]);
|
||||||
max = MAX2(max, bezt_last->vec[1][0]);
|
max = maxf(max, bezt_last->vec[1][0]);
|
||||||
|
|
||||||
foundvert = TRUE;
|
foundvert = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fcu->fpt) {
|
else if (fcu->fpt) {
|
||||||
min = MIN2(min, fcu->fpt[0].vec[0]);
|
min = minf(min, fcu->fpt[0].vec[0]);
|
||||||
max = MAX2(max, fcu->fpt[fcu->totvert - 1].vec[0]);
|
max = maxf(max, fcu->fpt[fcu->totvert - 1].vec[0]);
|
||||||
|
|
||||||
foundvert = TRUE;
|
foundvert = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2977,3 +2977,40 @@ int BKE_image_has_alpha(struct Image *image)
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BKE_image_get_size(Image *image, ImageUser *iuser, int *width, int *height)
|
||||||
|
{
|
||||||
|
ImBuf *ibuf = NULL;
|
||||||
|
void *lock;
|
||||||
|
|
||||||
|
ibuf = BKE_image_acquire_ibuf(image, iuser, &lock);
|
||||||
|
|
||||||
|
if (ibuf && ibuf->x > 0 && ibuf->y > 0) {
|
||||||
|
*width = ibuf->x;
|
||||||
|
*height = ibuf->y;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*width = IMG_SIZE_FALLBACK;
|
||||||
|
*height = IMG_SIZE_FALLBACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
BKE_image_release_ibuf(image, lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float size[2])
|
||||||
|
{
|
||||||
|
int width, height;
|
||||||
|
BKE_image_get_size(image, iuser, &width, &height);
|
||||||
|
|
||||||
|
size[0] = (float)width;
|
||||||
|
size[1] = (float)height;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BKE_image_get_aspect(Image *image, float *aspx, float *aspy)
|
||||||
|
{
|
||||||
|
*aspx = 1.0;
|
||||||
|
|
||||||
|
/* x is always 1 */
|
||||||
|
*aspy = image->aspy / image->aspx;
|
||||||
|
}
|
||||||
|
@ -691,8 +691,8 @@ static void cp_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const
|
|||||||
if (nu->bp) {
|
if (nu->bp) {
|
||||||
step = nu->pntsu * nu->pntsv;
|
step = nu->pntsu * nu->pntsv;
|
||||||
|
|
||||||
a1 = MAX2(a, start);
|
a1 = maxi(a, start);
|
||||||
a2 = MIN2(a + step, end);
|
a2 = mini(a + step, end);
|
||||||
|
|
||||||
if (a1 < a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BPOINT);
|
if (a1 < a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BPOINT);
|
||||||
}
|
}
|
||||||
@ -700,8 +700,8 @@ static void cp_cu_key(Curve *cu, Key *key, KeyBlock *actkb, KeyBlock *kb, const
|
|||||||
step = 3 * nu->pntsu;
|
step = 3 * nu->pntsu;
|
||||||
|
|
||||||
/* exception because keys prefer to work with complete blocks */
|
/* exception because keys prefer to work with complete blocks */
|
||||||
a1 = MAX2(a, start);
|
a1 = maxi(a, start);
|
||||||
a2 = MIN2(a + step, end);
|
a2 = mini(a + step, end);
|
||||||
|
|
||||||
if (a1 < a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BEZTRIPLE);
|
if (a1 < a2) cp_key(a1, a2, tot, out, key, actkb, kb, NULL, KEY_MODE_BEZTRIPLE);
|
||||||
}
|
}
|
||||||
@ -1217,7 +1217,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
|
|||||||
remain = step;
|
remain = step;
|
||||||
}
|
}
|
||||||
|
|
||||||
count = MIN2(remain, estep);
|
count = mini(remain, estep);
|
||||||
if (mode == KEY_MODE_BEZTRIPLE) {
|
if (mode == KEY_MODE_BEZTRIPLE) {
|
||||||
count += 3 - count % 3;
|
count += 3 - count % 3;
|
||||||
}
|
}
|
||||||
@ -1573,7 +1573,7 @@ void key_to_latt(KeyBlock *kb, Lattice *lt)
|
|||||||
fp = kb->data;
|
fp = kb->data;
|
||||||
|
|
||||||
tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
tot = lt->pntsu * lt->pntsv * lt->pntsw;
|
||||||
tot = MIN2(kb->totelem, tot);
|
tot = mini(kb->totelem, tot);
|
||||||
|
|
||||||
for (a = 0; a < tot; a++, fp += 3, bp++) {
|
for (a = 0; a < tot; a++, fp += 3, bp++) {
|
||||||
copy_v3_v3(bp->vec, fp);
|
copy_v3_v3(bp->vec, fp);
|
||||||
@ -1645,7 +1645,7 @@ void key_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb)
|
|||||||
|
|
||||||
tot = BKE_nurbList_verts_count(nurb);
|
tot = BKE_nurbList_verts_count(nurb);
|
||||||
|
|
||||||
tot = MIN2(kb->totelem, tot);
|
tot = mini(kb->totelem, tot);
|
||||||
|
|
||||||
while (nu && tot > 0) {
|
while (nu && tot > 0) {
|
||||||
|
|
||||||
@ -1713,7 +1713,7 @@ void key_to_mesh(KeyBlock *kb, Mesh *me)
|
|||||||
mvert = me->mvert;
|
mvert = me->mvert;
|
||||||
fp = kb->data;
|
fp = kb->data;
|
||||||
|
|
||||||
tot = MIN2(kb->totelem, me->totvert);
|
tot = mini(kb->totelem, me->totvert);
|
||||||
|
|
||||||
for (a = 0; a < tot; a++, fp += 3, mvert++) {
|
for (a = 0; a < tot; a++, fp += 3, mvert++) {
|
||||||
copy_v3_v3(mvert->co, fp);
|
copy_v3_v3(mvert->co, fp);
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
#include "BKE_sequencer.h"
|
#include "BKE_sequencer.h"
|
||||||
#include "BKE_tracking.h"
|
#include "BKE_tracking.h"
|
||||||
#include "BKE_movieclip.h"
|
#include "BKE_movieclip.h"
|
||||||
|
#include "BKE_image.h"
|
||||||
|
|
||||||
static MaskSplinePoint *mask_spline_point_next(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
|
static MaskSplinePoint *mask_spline_point_next(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
|
||||||
{
|
{
|
||||||
@ -1010,14 +1011,26 @@ void BKE_mask_coord_from_frame(float r_co[2], const float co[2], const float fra
|
|||||||
}
|
}
|
||||||
void BKE_mask_coord_from_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
|
void BKE_mask_coord_from_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
|
||||||
{
|
{
|
||||||
int width, height;
|
float aspx, aspy;
|
||||||
float frame_size[2];
|
float frame_size[2];
|
||||||
|
|
||||||
/* scaling for the clip */
|
/* scaling for the clip */
|
||||||
BKE_movieclip_get_size(clip, user, &width, &height);
|
BKE_movieclip_get_size_fl(clip, user, frame_size);
|
||||||
|
BKE_movieclip_get_aspect(clip, &aspx, &aspy);
|
||||||
|
|
||||||
frame_size[0] = (float)width;
|
frame_size[1] *= (aspy / aspx);
|
||||||
frame_size[1] = (float)height;
|
|
||||||
|
BKE_mask_coord_from_frame(r_co, co, frame_size);
|
||||||
|
}
|
||||||
|
void BKE_mask_coord_from_image(Image *image, ImageUser *iuser, float r_co[2], const float co[2])
|
||||||
|
{
|
||||||
|
float aspx, aspy;
|
||||||
|
float frame_size[2];
|
||||||
|
|
||||||
|
BKE_image_get_size_fl(image, iuser, frame_size);
|
||||||
|
BKE_image_get_aspect(image, &aspx, &aspy);
|
||||||
|
|
||||||
|
frame_size[1] *= (aspy / aspx);
|
||||||
|
|
||||||
BKE_mask_coord_from_frame(r_co, co, frame_size);
|
BKE_mask_coord_from_frame(r_co, co, frame_size);
|
||||||
}
|
}
|
||||||
@ -1040,14 +1053,27 @@ void BKE_mask_coord_to_frame(float r_co[2], const float co[2], const float frame
|
|||||||
}
|
}
|
||||||
void BKE_mask_coord_to_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
|
void BKE_mask_coord_to_movieclip(MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
|
||||||
{
|
{
|
||||||
int width, height;
|
float aspx, aspy;
|
||||||
float frame_size[2];
|
float frame_size[2];
|
||||||
|
|
||||||
/* scaling for the clip */
|
/* scaling for the clip */
|
||||||
BKE_movieclip_get_size(clip, user, &width, &height);
|
BKE_movieclip_get_size_fl(clip, user, frame_size);
|
||||||
|
BKE_movieclip_get_aspect(clip, &aspx, &aspy);
|
||||||
|
|
||||||
frame_size[0] = (float)width;
|
frame_size[1] /= (aspy / aspx);
|
||||||
frame_size[1] = (float)height;
|
|
||||||
|
BKE_mask_coord_to_frame(r_co, co, frame_size);
|
||||||
|
}
|
||||||
|
void BKE_mask_coord_to_image(Image *image, ImageUser *iuser, float r_co[2], const float co[2])
|
||||||
|
{
|
||||||
|
float aspx, aspy;
|
||||||
|
float frame_size[2];
|
||||||
|
|
||||||
|
/* scaling for the clip */
|
||||||
|
BKE_image_get_size_fl(image, iuser, frame_size);
|
||||||
|
BKE_image_get_aspect(image, &aspx, &aspy);
|
||||||
|
|
||||||
|
frame_size[1] /= (aspy / aspx);
|
||||||
|
|
||||||
BKE_mask_coord_to_frame(r_co, co, frame_size);
|
BKE_mask_coord_to_frame(r_co, co, frame_size);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,46 @@
|
|||||||
|
|
||||||
/** \file blender/blenkernel/intern/mask_rasterize.c
|
/** \file blender/blenkernel/intern/mask_rasterize.c
|
||||||
* \ingroup bke
|
* \ingroup bke
|
||||||
|
*
|
||||||
|
* This module exposes a rasterizer that works as a black box - implementation details are confined to this file,
|
||||||
|
*
|
||||||
|
* The basic method to access is:
|
||||||
|
* - create & initialize a handle from a #Mask datablock.
|
||||||
|
* - execute pixel lookups.
|
||||||
|
* - free the handle.
|
||||||
|
*
|
||||||
|
* This file is admittedly a bit confusticated, in quite few areas speed was chosen over readability,
|
||||||
|
* though it is commented - so shouldn't be so hard to see whats going on.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Implementation:
|
||||||
|
*
|
||||||
|
* To rasterize the mask its converted into geometry that use a ray-cast for each pixel lookup.
|
||||||
|
*
|
||||||
|
* Initially 'kdopbvh' was used but this ended up being too slow.
|
||||||
|
*
|
||||||
|
* To gain some extra speed we take advantage of a few shortcuts that can be made rasterizing masks specifically.
|
||||||
|
* - all triangles are known to be completely white - so no depth check is done on triangle intersection.
|
||||||
|
* - all quads are known to be feather outlines - the 1 and 0 depths are known by the vertex order in the quad,
|
||||||
|
* - there is no color - just a value for each mask pixel.
|
||||||
|
* - the mask spacial structure always maps to space 0-1 on X and Y axis.
|
||||||
|
* - bucketing is used to speed up lookups for geometry.
|
||||||
|
*
|
||||||
|
* Other Details:
|
||||||
|
* - used unsigned values all over for some extra speed on some arch's.
|
||||||
|
* - anti-aliasing is faked, just ensuring at least one pixel feather - avoids oversampling.
|
||||||
|
* - initializing the spacial structure doesn't need to be as optimized as pixel lookups are.
|
||||||
|
* - mask lookups need not be pixel aligned so any sub-pixel values from x/y (0 - 1), can be found.
|
||||||
|
* (perhaps masks can be used as a vector texture in 3D later on)
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Currently, to build the spacial structure we have to calculate the total number of faces ahead of time.
|
||||||
|
*
|
||||||
|
* This is getting a bit complicated with the addition of unfilled splines and end capping -
|
||||||
|
* If large changes are needed here we would be better off using an iterable
|
||||||
|
* BLI_mempool for triangles and converting to a contiguous array afterwards.
|
||||||
|
*
|
||||||
|
* - Campbell
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
@ -1009,6 +1009,14 @@ void BKE_movieclip_get_size(MovieClip *clip, MovieClipUser *user, int *width, in
|
|||||||
IMB_freeImBuf(ibuf);
|
IMB_freeImBuf(ibuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void BKE_movieclip_get_size_fl(MovieClip *clip, MovieClipUser *user, float size[2])
|
||||||
|
{
|
||||||
|
int width, height;
|
||||||
|
BKE_movieclip_get_size(clip, user, &width, &height);
|
||||||
|
|
||||||
|
size[0] = (float)width;
|
||||||
|
size[1] = (float)height;
|
||||||
|
}
|
||||||
|
|
||||||
int BKE_movieclip_get_duration(MovieClip *clip)
|
int BKE_movieclip_get_duration(MovieClip *clip)
|
||||||
{
|
{
|
||||||
@ -1019,9 +1027,9 @@ int BKE_movieclip_get_duration(MovieClip *clip)
|
|||||||
return clip->len;
|
return clip->len;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_movieclip_aspect(MovieClip *clip, float *aspx, float *aspy)
|
void BKE_movieclip_get_aspect(MovieClip *clip, float *aspx, float *aspy)
|
||||||
{
|
{
|
||||||
*aspx = *aspy = 1.0;
|
*aspx = 1.0;
|
||||||
|
|
||||||
/* x is always 1 */
|
/* x is always 1 */
|
||||||
*aspy = clip->aspy / clip->aspx / clip->tracking.camera.pixel_aspect;
|
*aspy = clip->aspy / clip->aspx / clip->tracking.camera.pixel_aspect;
|
||||||
|
@ -2700,7 +2700,7 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
|
|||||||
if (pid->cache->flag & PTCACHE_OUTDATED || (pid->cache->flag & PTCACHE_SIMULATION_VALID) == 0) {
|
if (pid->cache->flag & PTCACHE_OUTDATED || (pid->cache->flag & PTCACHE_SIMULATION_VALID) == 0) {
|
||||||
scene->physics_settings.quick_cache_step =
|
scene->physics_settings.quick_cache_step =
|
||||||
scene->physics_settings.quick_cache_step ?
|
scene->physics_settings.quick_cache_step ?
|
||||||
MIN2(scene->physics_settings.quick_cache_step, pid->cache->step) :
|
mini(scene->physics_settings.quick_cache_step, pid->cache->step) :
|
||||||
pid->cache->step;
|
pid->cache->step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1029,8 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
|
|||||||
if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
|
if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
|
||||||
ListBase *lb_dupli_ob;
|
ListBase *lb_dupli_ob;
|
||||||
|
|
||||||
if ((lb_dupli_ob=object_duplilist(scene, ob))) {
|
/* don't update the dupli groups, we only wan't their pid's */
|
||||||
|
if ((lb_dupli_ob = object_duplilist_ex(scene, ob, FALSE))) {
|
||||||
DupliObject *dob;
|
DupliObject *dob;
|
||||||
for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
|
for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
|
||||||
if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
|
if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
|
||||||
|
@ -3049,13 +3049,18 @@ int BKE_sequence_check_depend(Sequence *seq, Sequence *cur)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sequence_invalidate_cache(Scene *scene, Sequence *seq, int invalidate_preprocess)
|
static void sequence_invalidate_cache(Scene *scene, Sequence *seq, int invalidate_self, int invalidate_preprocess)
|
||||||
{
|
{
|
||||||
Editing *ed = scene->ed;
|
Editing *ed = scene->ed;
|
||||||
Sequence *cur;
|
Sequence *cur;
|
||||||
|
|
||||||
/* invalidate cache for current sequence */
|
/* invalidate cache for current sequence */
|
||||||
BKE_sequencer_cache_cleanup_sequence(seq);
|
if (invalidate_self)
|
||||||
|
BKE_sequencer_cache_cleanup_sequence(seq);
|
||||||
|
|
||||||
|
/* if invalidation is invoked from sequence free routine, effectdata would be NULL here */
|
||||||
|
if (seq->effectdata && seq->type == SEQ_TYPE_SPEED)
|
||||||
|
BKE_sequence_effect_speed_rebuild_map(scene, seq, TRUE);
|
||||||
|
|
||||||
if (invalidate_preprocess)
|
if (invalidate_preprocess)
|
||||||
BKE_sequencer_preprocessed_cache_cleanup_sequence(seq);
|
BKE_sequencer_preprocessed_cache_cleanup_sequence(seq);
|
||||||
@ -3076,12 +3081,17 @@ static void sequence_invalidate_cache(Scene *scene, Sequence *seq, int invalidat
|
|||||||
|
|
||||||
void BKE_sequence_invalidate_cache(Scene *scene, Sequence *seq)
|
void BKE_sequence_invalidate_cache(Scene *scene, Sequence *seq)
|
||||||
{
|
{
|
||||||
sequence_invalidate_cache(scene, seq, TRUE);
|
sequence_invalidate_cache(scene, seq, TRUE, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BKE_sequence_invalidate_deendent(Scene *scene, Sequence *seq)
|
||||||
|
{
|
||||||
|
sequence_invalidate_cache(scene, seq, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_sequence_invalidate_cache_for_modifier(Scene *scene, Sequence *seq)
|
void BKE_sequence_invalidate_cache_for_modifier(Scene *scene, Sequence *seq)
|
||||||
{
|
{
|
||||||
sequence_invalidate_cache(scene, seq, FALSE);
|
sequence_invalidate_cache(scene, seq, TRUE, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BKE_sequencer_free_imbuf(Scene *scene, ListBase *seqbase, int for_render)
|
void BKE_sequencer_free_imbuf(Scene *scene, ListBase *seqbase, int for_render)
|
||||||
|
@ -2229,7 +2229,7 @@ void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[
|
|||||||
t2 = mean_value_half_tan_v3(co, vmid, vnext);
|
t2 = mean_value_half_tan_v3(co, vmid, vnext);
|
||||||
|
|
||||||
len = len_v3v3(co, vmid);
|
len = len_v3v3(co, vmid);
|
||||||
w[i] = (t1 + t2) / len;
|
w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f;
|
||||||
totweight += w[i];
|
totweight += w[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2257,7 +2257,7 @@ void interp_weights_poly_v2(float *w, float v[][2], const int n, const float co[
|
|||||||
t2 = mean_value_half_tan_v2(co, vmid, vnext);
|
t2 = mean_value_half_tan_v2(co, vmid, vnext);
|
||||||
|
|
||||||
len = len_v2v2(co, vmid);
|
len = len_v2v2(co, vmid);
|
||||||
w[i] = (t1 + t2) / len;
|
w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f;
|
||||||
totweight += w[i];
|
totweight += w[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,6 +340,8 @@ BMFace *BM_face_create(BMesh *bm, BMVert **verts, BMEdge **edges, const int len,
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the element is valid.
|
* Check the element is valid.
|
||||||
*
|
*
|
||||||
@ -476,6 +478,8 @@ int bmesh_elem_check(void *element, const char htype)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* NDEBUG */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* low level function, only frees the vert,
|
* low level function, only frees the vert,
|
||||||
* doesn't change or adjust surrounding geometry
|
* doesn't change or adjust surrounding geometry
|
||||||
|
@ -123,12 +123,12 @@ void *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len)
|
|||||||
if (BM_iter_init(&iter, bm, itype, data) && iter.count > 0) {
|
if (BM_iter_init(&iter, bm, itype, data) && iter.count > 0) {
|
||||||
BMElem *ele;
|
BMElem *ele;
|
||||||
BMElem **array = MEM_mallocN(sizeof(ele) * iter.count, __func__);
|
BMElem **array = MEM_mallocN(sizeof(ele) * iter.count, __func__);
|
||||||
int i;
|
int i = 0;
|
||||||
|
|
||||||
*r_len = iter.count; /* set before iterating */
|
*r_len = iter.count; /* set before iterating */
|
||||||
|
|
||||||
for (ele = BM_iter_step(&iter), i = 0; ele; ele = BM_iter_step(&iter), i++) {
|
while ((ele = BM_iter_step(&iter))) {
|
||||||
array[i] = ele;
|
array[i++] = ele;
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
@ -37,21 +37,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* returns positive nonzero on error */
|
/* returns positive nonzero on error */
|
||||||
int bmesh_elem_check(void *element, const char htype);
|
|
||||||
|
|
||||||
#define BM_CHECK_ELEMENT(el) \
|
#ifdef NDEBUG
|
||||||
|
/* no error checking for release,
|
||||||
|
* it can take most of the CPU time when running some tools */
|
||||||
|
# define BM_CHECK_ELEMENT(el) (void)(el)
|
||||||
|
#else
|
||||||
|
int bmesh_elem_check(void *element, const char htype);
|
||||||
|
# define BM_CHECK_ELEMENT(el) \
|
||||||
if (bmesh_elem_check(el, ((BMHeader *)el)->htype)) { \
|
if (bmesh_elem_check(el, ((BMHeader *)el)->htype)) { \
|
||||||
printf("check_element failure, with code %i on line %i in file\n" \
|
printf("check_element failure, with code %i on line %i in file\n" \
|
||||||
" \"%s\"\n\n", \
|
" \"%s\"\n\n", \
|
||||||
bmesh_elem_check(el, ((BMHeader *)el)->htype), \
|
bmesh_elem_check(el, ((BMHeader *)el)->htype), \
|
||||||
__LINE__, __FILE__); \
|
__LINE__, __FILE__); \
|
||||||
}
|
} (void)0
|
||||||
|
#endif
|
||||||
#define BM_DISK_EDGE_LINK_GET(e, v) ( \
|
|
||||||
((v) == ((BMEdge *)(e))->v1) ? \
|
|
||||||
&((e)->v1_disk_link) : \
|
|
||||||
&((e)->v2_disk_link) \
|
|
||||||
)
|
|
||||||
|
|
||||||
int bmesh_radial_length(BMLoop *l);
|
int bmesh_radial_length(BMLoop *l);
|
||||||
int bmesh_disk_count(BMVert *v);
|
int bmesh_disk_count(BMVert *v);
|
||||||
|
@ -153,10 +153,22 @@ int bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
|
|||||||
* advantage is that no intrinsic properties of the data structures are dependent upon the
|
* advantage is that no intrinsic properties of the data structures are dependent upon the
|
||||||
* cycle order and all non-manifold conditions are represented trivially.
|
* cycle order and all non-manifold conditions are represented trivially.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
BLI_INLINE BMDiskLink *bmesh_disk_edge_link_from_vert(BMEdge *e, BMVert *v)
|
||||||
|
{
|
||||||
|
if (v == e->v1) {
|
||||||
|
return &e->v1_disk_link;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BLI_assert(v == e->v2);
|
||||||
|
return &e->v2_disk_link;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int bmesh_disk_edge_append(BMEdge *e, BMVert *v)
|
int bmesh_disk_edge_append(BMEdge *e, BMVert *v)
|
||||||
{
|
{
|
||||||
if (!v->e) {
|
if (!v->e) {
|
||||||
BMDiskLink *dl1 = BM_DISK_EDGE_LINK_GET(e, v);
|
BMDiskLink *dl1 = bmesh_disk_edge_link_from_vert(e, v);
|
||||||
|
|
||||||
v->e = e;
|
v->e = e;
|
||||||
dl1->next = dl1->prev = e;
|
dl1->next = dl1->prev = e;
|
||||||
@ -164,9 +176,9 @@ int bmesh_disk_edge_append(BMEdge *e, BMVert *v)
|
|||||||
else {
|
else {
|
||||||
BMDiskLink *dl1, *dl2, *dl3;
|
BMDiskLink *dl1, *dl2, *dl3;
|
||||||
|
|
||||||
dl1 = BM_DISK_EDGE_LINK_GET(e, v);
|
dl1 = bmesh_disk_edge_link_from_vert(e, v);
|
||||||
dl2 = BM_DISK_EDGE_LINK_GET(v->e, v);
|
dl2 = bmesh_disk_edge_link_from_vert(v->e, v);
|
||||||
dl3 = dl2->prev ? BM_DISK_EDGE_LINK_GET(dl2->prev, v) : NULL;
|
dl3 = dl2->prev ? bmesh_disk_edge_link_from_vert(dl2->prev, v) : NULL;
|
||||||
|
|
||||||
dl1->next = v->e;
|
dl1->next = v->e;
|
||||||
dl1->prev = dl2->prev;
|
dl1->prev = dl2->prev;
|
||||||
@ -183,14 +195,14 @@ void bmesh_disk_edge_remove(BMEdge *e, BMVert *v)
|
|||||||
{
|
{
|
||||||
BMDiskLink *dl1, *dl2;
|
BMDiskLink *dl1, *dl2;
|
||||||
|
|
||||||
dl1 = BM_DISK_EDGE_LINK_GET(e, v);
|
dl1 = bmesh_disk_edge_link_from_vert(e, v);
|
||||||
if (dl1->prev) {
|
if (dl1->prev) {
|
||||||
dl2 = BM_DISK_EDGE_LINK_GET(dl1->prev, v);
|
dl2 = bmesh_disk_edge_link_from_vert(dl1->prev, v);
|
||||||
dl2->next = dl1->next;
|
dl2->next = dl1->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dl1->next) {
|
if (dl1->next) {
|
||||||
dl2 = BM_DISK_EDGE_LINK_GET(dl1->next, v);
|
dl2 = bmesh_disk_edge_link_from_vert(dl1->next, v);
|
||||||
dl2->prev = dl1->prev;
|
dl2->prev = dl1->prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,6 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
j = 0;
|
|
||||||
if (vv1[0] == vv1[lenv1 - 1]) {
|
if (vv1[0] == vv1[lenv1 - 1]) {
|
||||||
lenv1--;
|
lenv1--;
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,8 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
|
|||||||
COLLADABU::NativeString(std::string(this->export_settings->filepath));
|
COLLADABU::NativeString(std::string(this->export_settings->filepath));
|
||||||
COLLADASW::StreamWriter sw(native_filename);
|
COLLADASW::StreamWriter sw(native_filename);
|
||||||
|
|
||||||
|
fprintf(stdout, "Collada export: %s\n", this->export_settings->filepath);
|
||||||
|
|
||||||
// open <collada>
|
// open <collada>
|
||||||
sw.startDocument();
|
sw.startDocument();
|
||||||
|
|
||||||
|
@ -132,14 +132,17 @@ void GeometryExporter::operator()(Object *ob)
|
|||||||
|
|
||||||
createLooseEdgeList(ob, me, geom_id, norind);
|
createLooseEdgeList(ob, me, geom_id, norind);
|
||||||
|
|
||||||
// XXX slow
|
// Only create Polylists if number of faces > 0
|
||||||
if (ob->totcol) {
|
if (me->totface > 0) {
|
||||||
for (int a = 0; a < ob->totcol; a++) {
|
// XXX slow
|
||||||
createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind);
|
if (ob->totcol) {
|
||||||
|
for (int a = 0; a < ob->totcol; a++) {
|
||||||
|
createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
createPolylist(0, has_uvs, has_color, ob, me, geom_id, norind);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
createPolylist(0, has_uvs, has_color, ob, me, geom_id, norind);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
closeMesh();
|
closeMesh();
|
||||||
@ -248,7 +251,7 @@ void GeometryExporter::createPolylist(short material_index,
|
|||||||
|
|
||||||
// no faces using this material
|
// no faces using this material
|
||||||
if (faces_in_polylist == 0) {
|
if (faces_in_polylist == 0) {
|
||||||
fprintf(stderr, "%s: no faces use material %d\n", id_name(ob).c_str(), material_index);
|
fprintf(stderr, "%s: material with index %d is not used.\n", id_name(ob).c_str(), material_index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,12 +119,15 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
|
|||||||
|
|
||||||
// This image is already located on the file system.
|
// This image is already located on the file system.
|
||||||
// But we want to create copies here.
|
// But we want to create copies here.
|
||||||
// To avoid overwroting images with same file name but
|
// To move images into the same export directory.
|
||||||
// differenet source locations
|
// Note: If an image is already located in the export folder,
|
||||||
|
// then skip the copy (as it would result in a file copy error).
|
||||||
|
|
||||||
if (BLI_copy(source_path, export_path) != 0) {
|
if (BLI_path_cmp(source_path, export_path) != 0) {
|
||||||
fprintf(stderr, "Collada export: Cannot copy image:\n source:%s\ndest :%s\n", source_path, export_path);
|
if (BLI_copy(source_path, export_path) != 0) {
|
||||||
return;
|
fprintf(stderr, "Collada export: Cannot copy image:\n source:%s\ndest :%s\n", source_path, export_path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_strncpy(export_path, export_file, sizeof(export_path));
|
BLI_strncpy(export_path, export_file, sizeof(export_path));
|
||||||
@ -132,7 +135,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// Do not make any vopies, but use the source path directly as reference
|
// Do not make any copies, but use the source path directly as reference
|
||||||
// to the original image
|
// to the original image
|
||||||
|
|
||||||
BLI_strncpy(export_path, source_path, sizeof(export_path));
|
BLI_strncpy(export_path, source_path, sizeof(export_path));
|
||||||
|
@ -124,19 +124,26 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unsigned int index;
|
rcti tempOutput;
|
||||||
vector<InputSocket *> &inputsockets = this->getInputSockets();
|
bool first = true;
|
||||||
|
for (int i = 0 ; i < getNumberOfInputSockets() ; i ++) {
|
||||||
for (index = 0; index < inputsockets.size(); index++) {
|
NodeOperation * inputOperation = this->getInputOperation(i);
|
||||||
InputSocket *inputsocket = inputsockets[index];
|
if (inputOperation && inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
|
||||||
if (inputsocket->isConnected()) {
|
if (first) {
|
||||||
NodeOperation *inputoperation = (NodeOperation *)inputsocket->getConnection()->getFromNode();
|
output->xmin = tempOutput.xmin;
|
||||||
bool result = inputoperation->determineDependingAreaOfInterest(input, readOperation, output);
|
output->ymin = tempOutput.ymin;
|
||||||
if (result) {
|
output->xmax = tempOutput.xmax;
|
||||||
return true;
|
output->ymax = tempOutput.ymax;
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
output->xmin = MIN2(output->xmin, tempOutput.xmin);
|
||||||
|
output->ymin = MIN2(output->ymin, tempOutput.ymin);
|
||||||
|
output->xmax = MAX2(output->xmax, tempOutput.xmax);
|
||||||
|
output->ymax = MAX2(output->ymax, tempOutput.ymax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return !first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,31 +37,6 @@ CombineChannelsOperation::CombineChannelsOperation() : NodeOperation()
|
|||||||
this->m_inputChannel4Operation = NULL;
|
this->m_inputChannel4Operation = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CombineChannelsOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
|
||||||
{
|
|
||||||
rcti tempOutput;
|
|
||||||
bool first = true;
|
|
||||||
for (int i = 0 ; i < 4 ; i ++) {
|
|
||||||
NodeOperation * inputOperation = this->getInputOperation(i);
|
|
||||||
if (inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
|
|
||||||
if (first) {
|
|
||||||
output->xmin = tempOutput.xmin;
|
|
||||||
output->ymin = tempOutput.ymin;
|
|
||||||
output->xmax = tempOutput.xmax;
|
|
||||||
output->ymax = tempOutput.ymax;
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
output->xmin = MIN2(output->xmin, tempOutput.xmin);
|
|
||||||
output->ymin = MIN2(output->ymin, tempOutput.ymin);
|
|
||||||
output->xmax = MAX2(output->xmax, tempOutput.xmax);
|
|
||||||
output->ymax = MAX2(output->ymax, tempOutput.ymax);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return !first;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CombineChannelsOperation::initExecution()
|
void CombineChannelsOperation::initExecution()
|
||||||
{
|
{
|
||||||
this->m_inputChannel1Operation = this->getInputSocketReader(0);
|
this->m_inputChannel1Operation = this->getInputSocketReader(0);
|
||||||
@ -82,7 +57,6 @@ void CombineChannelsOperation::deinitExecution()
|
|||||||
void CombineChannelsOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
void CombineChannelsOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
|
||||||
{
|
{
|
||||||
float input[4];
|
float input[4];
|
||||||
/// @todo: remove if statements
|
|
||||||
if (this->m_inputChannel1Operation) {
|
if (this->m_inputChannel1Operation) {
|
||||||
this->m_inputChannel1Operation->read(input, x, y, sampler);
|
this->m_inputChannel1Operation->read(input, x, y, sampler);
|
||||||
output[0] = input[0];
|
output[0] = input[0];
|
||||||
|
@ -37,8 +37,6 @@ public:
|
|||||||
|
|
||||||
void initExecution();
|
void initExecution();
|
||||||
void deinitExecution();
|
void deinitExecution();
|
||||||
|
|
||||||
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1019,6 +1019,7 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned
|
|||||||
static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
|
static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
|
||||||
{
|
{
|
||||||
ListBase *markers = ED_context_get_markers(C);
|
ListBase *markers = ED_context_get_markers(C);
|
||||||
|
ARegion *ar = CTX_wm_region(C);
|
||||||
View2D *v2d = UI_view2d_fromcontext(C);
|
View2D *v2d = UI_view2d_fromcontext(C);
|
||||||
float viewx;
|
float viewx;
|
||||||
int x, y, cfra;
|
int x, y, cfra;
|
||||||
@ -1026,8 +1027,8 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
|
|||||||
if (markers == NULL)
|
if (markers == NULL)
|
||||||
return OPERATOR_PASS_THROUGH;
|
return OPERATOR_PASS_THROUGH;
|
||||||
|
|
||||||
x = evt->x - CTX_wm_region(C)->winrct.xmin;
|
x = evt->x - ar->winrct.xmin;
|
||||||
y = evt->y - CTX_wm_region(C)->winrct.ymin;
|
y = evt->y - ar->winrct.ymin;
|
||||||
|
|
||||||
UI_view2d_region_to_view(v2d, x, y, &viewx, NULL);
|
UI_view2d_region_to_view(v2d, x, y, &viewx, NULL);
|
||||||
|
|
||||||
|
@ -61,9 +61,7 @@ void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float *a
|
|||||||
void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings);
|
void ED_space_image_paint_update(struct wmWindowManager *wm, struct ToolSettings *settings);
|
||||||
void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings);
|
void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct ToolSettings *settings);
|
||||||
|
|
||||||
void ED_image_get_size(struct Image *ima, int *width, int *height);
|
void ED_image_get_uv_aspect(struct Image *ima, struct ImageUser *iuser, float *aspx, float *aspy);
|
||||||
void ED_image_get_aspect(struct Image *ima, float *aspx, float *aspy);
|
|
||||||
void ED_image_get_uv_aspect(struct Image *ima, float *aspx, float *aspy);
|
|
||||||
void ED_image_mouse_pos(struct SpaceImage *sima, struct ARegion *ar, const int mval[2], float co[2]);
|
void ED_image_mouse_pos(struct SpaceImage *sima, struct ARegion *ar, const int mval[2], float co[2]);
|
||||||
void ED_image_point_pos(struct SpaceImage *sima, struct ARegion *ar, float x, float y, float *xr, float *yr);
|
void ED_image_point_pos(struct SpaceImage *sima, struct ARegion *ar, float x, float y, float *xr, float *yr);
|
||||||
void ED_image_point_pos__reverse(struct SpaceImage *sima, struct ARegion *ar, const float co[2], float r_co[2]);
|
void ED_image_point_pos__reverse(struct SpaceImage *sima, struct ARegion *ar, const float co[2], float r_co[2]);
|
||||||
|
@ -56,7 +56,8 @@ void ED_operatormacros_mask(void);
|
|||||||
void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type);
|
void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type);
|
||||||
void ED_mask_draw_region(struct Mask *mask, struct ARegion *ar,
|
void ED_mask_draw_region(struct Mask *mask, struct ARegion *ar,
|
||||||
const char draw_flag, const char draw_type,
|
const char draw_flag, const char draw_type,
|
||||||
int width, int height,
|
const int width_i, const int height_i,
|
||||||
|
const float aspx, const float aspy,
|
||||||
const short do_scale_applied, const short do_post_draw,
|
const short do_scale_applied, const short do_post_draw,
|
||||||
float stabmat[4][4],
|
float stabmat[4][4],
|
||||||
const bContext *C);
|
const bContext *C);
|
||||||
|
@ -187,16 +187,17 @@ typedef struct uiLayout uiLayout;
|
|||||||
* - bit 8: for 'bit'
|
* - bit 8: for 'bit'
|
||||||
* - bit 9-15: button type (now 6 bits, 64 types)
|
* - bit 9-15: button type (now 6 bits, 64 types)
|
||||||
* */
|
* */
|
||||||
|
typedef enum {
|
||||||
|
UI_BUT_POIN_CHAR = 32,
|
||||||
|
UI_BUT_POIN_SHORT = 64,
|
||||||
|
UI_BUT_POIN_INT = 96,
|
||||||
|
UI_BUT_POIN_FLOAT = 128,
|
||||||
|
/* UI_BUT_POIN_FUNCTION = 192, */ /*UNUSED*/
|
||||||
|
UI_BUT_POIN_BIT = 256 /* OR'd with a bit index*/
|
||||||
|
} eButPointerType;
|
||||||
|
|
||||||
#define CHA 32
|
/* button requires a pointer */
|
||||||
#define SHO 64
|
#define UI_BUT_POIN_TYPES (UI_BUT_POIN_FLOAT | UI_BUT_POIN_SHORT | UI_BUT_POIN_CHAR)
|
||||||
#define INT 96
|
|
||||||
#define FLO 128
|
|
||||||
/*#define FUN 192*/ /*UNUSED*/
|
|
||||||
#define BIT 256
|
|
||||||
|
|
||||||
/* button reqyires a pointer */
|
|
||||||
#define BUTPOIN (FLO | SHO | CHA)
|
|
||||||
|
|
||||||
/* assigned to but->type, OR'd with the flags above when passing args */
|
/* assigned to but->type, OR'd with the flags above when passing args */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -214,7 +215,7 @@ typedef enum {
|
|||||||
ICONROW = (12 << 9),
|
ICONROW = (12 << 9),
|
||||||
ICONTOG = (13 << 9),
|
ICONTOG = (13 << 9),
|
||||||
NUMSLI = (14 << 9),
|
NUMSLI = (14 << 9),
|
||||||
COL = (15 << 9),
|
COLOR = (15 << 9),
|
||||||
IDPOIN = (16 << 9),
|
IDPOIN = (16 << 9),
|
||||||
HSVSLI = (17 << 9),
|
HSVSLI = (17 << 9),
|
||||||
SCROLL = (18 << 9),
|
SCROLL = (18 << 9),
|
||||||
|
@ -761,7 +761,7 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
|
|||||||
* fun first pass on all buttons so first word chars always get first priority */
|
* fun first pass on all buttons so first word chars always get first priority */
|
||||||
|
|
||||||
for (but = block->buttons.first; but; but = but->next) {
|
for (but = block->buttons.first; but; but = but->next) {
|
||||||
if (!ELEM4(but->type, BUT, MENU, BLOCK, PULLDOWN) || (but->flag & UI_HIDDEN)) {
|
if (!ELEM5(but->type, BUT, BUTM, MENU, BLOCK, PULLDOWN) || (but->flag & UI_HIDDEN)) {
|
||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
else if (but->menu_key == '\0') {
|
else if (but->menu_key == '\0') {
|
||||||
@ -1151,7 +1151,7 @@ static void ui_is_but_sel(uiBut *but, double *value)
|
|||||||
if (*value == (double)but->hardmax) is_push = 1;
|
if (*value == (double)but->hardmax) is_push = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case COL:
|
case COLOR:
|
||||||
is_push = 2;
|
is_push = 2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1311,13 +1311,13 @@ void ui_get_but_vectorf(uiBut *but, float vec[3])
|
|||||||
vec[a] = RNA_property_float_get_index(&but->rnapoin, prop, a);
|
vec[a] = RNA_property_float_get_index(&but->rnapoin, prop, a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (but->pointype == CHA) {
|
else if (but->pointype == UI_BUT_POIN_CHAR) {
|
||||||
char *cp = (char *)but->poin;
|
char *cp = (char *)but->poin;
|
||||||
vec[0] = ((float)cp[0]) / 255.0f;
|
vec[0] = ((float)cp[0]) / 255.0f;
|
||||||
vec[1] = ((float)cp[1]) / 255.0f;
|
vec[1] = ((float)cp[1]) / 255.0f;
|
||||||
vec[2] = ((float)cp[2]) / 255.0f;
|
vec[2] = ((float)cp[2]) / 255.0f;
|
||||||
}
|
}
|
||||||
else if (but->pointype == FLO) {
|
else if (but->pointype == UI_BUT_POIN_FLOAT) {
|
||||||
float *fp = (float *)but->poin;
|
float *fp = (float *)but->poin;
|
||||||
copy_v3_v3(vec, fp);
|
copy_v3_v3(vec, fp);
|
||||||
}
|
}
|
||||||
@ -1357,13 +1357,13 @@ void ui_set_but_vectorf(uiBut *but, const float vec[3])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (but->pointype == CHA) {
|
else if (but->pointype == UI_BUT_POIN_CHAR) {
|
||||||
char *cp = (char *)but->poin;
|
char *cp = (char *)but->poin;
|
||||||
cp[0] = (char)(0.5f + vec[0] * 255.0f);
|
cp[0] = (char)(0.5f + vec[0] * 255.0f);
|
||||||
cp[1] = (char)(0.5f + vec[1] * 255.0f);
|
cp[1] = (char)(0.5f + vec[1] * 255.0f);
|
||||||
cp[2] = (char)(0.5f + vec[2] * 255.0f);
|
cp[2] = (char)(0.5f + vec[2] * 255.0f);
|
||||||
}
|
}
|
||||||
else if (but->pointype == FLO) {
|
else if (but->pointype == UI_BUT_POIN_FLOAT) {
|
||||||
float *fp = (float *)but->poin;
|
float *fp = (float *)but->poin;
|
||||||
copy_v3_v3(fp, vec);
|
copy_v3_v3(fp, vec);
|
||||||
}
|
}
|
||||||
@ -1371,7 +1371,7 @@ void ui_set_but_vectorf(uiBut *but, const float vec[3])
|
|||||||
|
|
||||||
int ui_is_but_float(uiBut *but)
|
int ui_is_but_float(uiBut *but)
|
||||||
{
|
{
|
||||||
if (but->pointype == FLO && but->poin)
|
if (but->pointype == UI_BUT_POIN_FLOAT && but->poin)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_FLOAT)
|
if (but->rnaprop && RNA_property_type(but->rnaprop) == PROP_FLOAT)
|
||||||
@ -1467,16 +1467,16 @@ double ui_get_but_val(uiBut *but)
|
|||||||
case 'V': value = hsv[2]; break;
|
case 'V': value = hsv[2]; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (but->pointype == CHA) {
|
else if (but->pointype == UI_BUT_POIN_CHAR) {
|
||||||
value = *(char *)but->poin;
|
value = *(char *)but->poin;
|
||||||
}
|
}
|
||||||
else if (but->pointype == SHO) {
|
else if (but->pointype == UI_BUT_POIN_SHORT) {
|
||||||
value = *(short *)but->poin;
|
value = *(short *)but->poin;
|
||||||
}
|
}
|
||||||
else if (but->pointype == INT) {
|
else if (but->pointype == UI_BUT_POIN_INT) {
|
||||||
value = *(int *)but->poin;
|
value = *(int *)but->poin;
|
||||||
}
|
}
|
||||||
else if (but->pointype == FLO) {
|
else if (but->pointype == UI_BUT_POIN_FLOAT) {
|
||||||
value = *(float *)but->poin;
|
value = *(float *)but->poin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1548,9 +1548,10 @@ void ui_set_but_val(uiBut *but, double value)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* first do rounding */
|
/* first do rounding */
|
||||||
if (but->pointype == CHA)
|
if (but->pointype == UI_BUT_POIN_CHAR) {
|
||||||
value = (char)floor(value + 0.5);
|
value = (char)floor(value + 0.5);
|
||||||
else if (but->pointype == SHO) {
|
}
|
||||||
|
else if (but->pointype == UI_BUT_POIN_SHORT) {
|
||||||
/* gcc 3.2.1 seems to have problems
|
/* gcc 3.2.1 seems to have problems
|
||||||
* casting a double like 32772.0 to
|
* casting a double like 32772.0 to
|
||||||
* a short so we cast to an int, then
|
* a short so we cast to an int, then
|
||||||
@ -1564,9 +1565,9 @@ void ui_set_but_val(uiBut *but, double value)
|
|||||||
gcckludge = (int) floor(value + 0.5);
|
gcckludge = (int) floor(value + 0.5);
|
||||||
value = (short)gcckludge;
|
value = (short)gcckludge;
|
||||||
}
|
}
|
||||||
else if (but->pointype == INT)
|
else if (but->pointype == UI_BUT_POIN_INT)
|
||||||
value = (int)floor(value + 0.5);
|
value = (int)floor(value + 0.5);
|
||||||
else if (but->pointype == FLO) {
|
else if (but->pointype == UI_BUT_POIN_FLOAT) {
|
||||||
float fval = (float)value;
|
float fval = (float)value;
|
||||||
if (fval >= -0.00001f && fval <= 0.00001f) fval = 0.0f; /* prevent negative zero */
|
if (fval >= -0.00001f && fval <= 0.00001f) fval = 0.0f; /* prevent negative zero */
|
||||||
value = fval;
|
value = fval;
|
||||||
@ -1575,13 +1576,13 @@ void ui_set_but_val(uiBut *but, double value)
|
|||||||
/* then set value with possible edit override */
|
/* then set value with possible edit override */
|
||||||
if (but->editval)
|
if (but->editval)
|
||||||
value = *but->editval = value;
|
value = *but->editval = value;
|
||||||
else if (but->pointype == CHA)
|
else if (but->pointype == UI_BUT_POIN_CHAR)
|
||||||
value = *((char *)but->poin) = (char)value;
|
value = *((char *)but->poin) = (char)value;
|
||||||
else if (but->pointype == SHO)
|
else if (but->pointype == UI_BUT_POIN_SHORT)
|
||||||
value = *((short *)but->poin) = (short)value;
|
value = *((short *)but->poin) = (short)value;
|
||||||
else if (but->pointype == INT)
|
else if (but->pointype == UI_BUT_POIN_INT)
|
||||||
value = *((int *)but->poin) = (int)value;
|
value = *((int *)but->poin) = (int)value;
|
||||||
else if (but->pointype == FLO)
|
else if (but->pointype == UI_BUT_POIN_FLOAT)
|
||||||
value = *((float *)but->poin) = (float)value;
|
value = *((float *)but->poin) = (float)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2620,7 +2621,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
|||||||
uiBut *but;
|
uiBut *but;
|
||||||
int slen;
|
int slen;
|
||||||
|
|
||||||
if (type & BUTPOIN) { /* a pointer is required */
|
if (type & UI_BUT_POIN_TYPES) { /* a pointer is required */
|
||||||
if (poin == NULL)
|
if (poin == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -2628,8 +2629,8 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
|
|||||||
but = MEM_callocN(sizeof(uiBut), "uiBut");
|
but = MEM_callocN(sizeof(uiBut), "uiBut");
|
||||||
|
|
||||||
but->type = type & BUTTYPE;
|
but->type = type & BUTTYPE;
|
||||||
but->pointype = type & BUTPOIN;
|
but->pointype = type & UI_BUT_POIN_TYPES;
|
||||||
but->bit = type & BIT;
|
but->bit = type & UI_BUT_POIN_BIT;
|
||||||
but->bitnr = type & 31;
|
but->bitnr = type & 31;
|
||||||
but->icon = ICON_NONE;
|
but->icon = ICON_NONE;
|
||||||
but->iconadd = 0;
|
but->iconadd = 0;
|
||||||
@ -3102,40 +3103,40 @@ static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, const c
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return uiDefBut(block, type | BIT | bitIdx, retval, str, x, y, width, height, poin, min, max, a1, a2, tip);
|
return uiDefBut(block, type | UI_BUT_POIN_BIT | bitIdx, retval, str, x, y, width, height, poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefBut(block, type | FLO, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefBut(block, type | UI_BUT_POIN_FLOAT, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefButBit(block, type | FLO, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefButBit(block, type | UI_BUT_POIN_FLOAT, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefBut(block, type | INT, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefBut(block, type | UI_BUT_POIN_INT, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefButBit(block, type | INT, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefButBit(block, type | UI_BUT_POIN_INT, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefBut(block, type | SHO, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefBut(block, type | UI_BUT_POIN_SHORT, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefButBit(block, type | SHO, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefButBit(block, type | UI_BUT_POIN_SHORT, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefBut(block, type | CHA, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefBut(block, type | UI_BUT_POIN_CHAR, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefButBit(block, type | CHA, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefButBit(block, type | UI_BUT_POIN_CHAR, bit, retval, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
@ -3187,41 +3188,41 @@ static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return uiDefIconBut(block, type | BIT | bitIdx, retval, icon, x, y, width, height, poin, min, max, a1, a2, tip);
|
return uiDefIconBut(block, type | UI_BUT_POIN_BIT | bitIdx, retval, icon, x, y, width, height, poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconBut(block, type | FLO, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconBut(block, type | UI_BUT_POIN_FLOAT, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconButBit(block, type | FLO, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconButBit(block, type | UI_BUT_POIN_FLOAT, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconBut(block, type | INT, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconBut(block, type | UI_BUT_POIN_INT, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconButBit(block, type | INT, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconButBit(block, type | UI_BUT_POIN_INT, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconBut(block, type | SHO, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconBut(block, type | UI_BUT_POIN_SHORT, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconButBit(block, type | SHO, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconButBit(block, type | UI_BUT_POIN_SHORT, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconBut(block, type | CHA, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconBut(block, type | UI_BUT_POIN_CHAR, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconButBit(block, type | CHA, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconButBit(block, type | UI_BUT_POIN_CHAR, bit, retval, icon, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
@ -3266,41 +3267,41 @@ static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return uiDefIconTextBut(block, type | BIT | bitIdx, retval, icon, str, x, y, width, height, poin, min, max, a1, a2, tip);
|
return uiDefIconTextBut(block, type | UI_BUT_POIN_BIT | bitIdx, retval, icon, str, x, y, width, height, poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextBut(block, type | FLO, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextBut(block, type | UI_BUT_POIN_FLOAT, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextButBit(block, type | FLO, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextButBit(block, type | UI_BUT_POIN_FLOAT, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextBut(block, type | INT, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextBut(block, type | UI_BUT_POIN_INT, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextButBit(block, type | INT, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextButBit(block, type | UI_BUT_POIN_INT, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextBut(block, type | SHO, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextBut(block, type | UI_BUT_POIN_SHORT, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextButBit(block, type | SHO, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextButBit(block, type | UI_BUT_POIN_SHORT, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextBut(block, type | CHA, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextBut(block, type | UI_BUT_POIN_CHAR, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
return uiDefIconTextButBit(block, type | CHA, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
return uiDefIconTextButBit(block, type | UI_BUT_POIN_CHAR, bit, retval, icon, str, x, y, width, height, (void *) poin, min, max, a1, a2, tip);
|
||||||
}
|
}
|
||||||
uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
|
uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip)
|
||||||
{
|
{
|
||||||
@ -3698,7 +3699,7 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int
|
|||||||
|
|
||||||
uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *spoin, const char *tip)
|
uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *spoin, const char *tip)
|
||||||
{
|
{
|
||||||
uiBut *but = ui_def_but(block, KEYEVT | SHO, retval, str, x, y, width, height, spoin, 0.0, 0.0, 0.0, 0.0, tip);
|
uiBut *but = ui_def_but(block, KEYEVT | UI_BUT_POIN_SHORT, retval, str, x, y, width, height, spoin, 0.0, 0.0, 0.0, 0.0, tip);
|
||||||
ui_check_but(but);
|
ui_check_but(but);
|
||||||
return but;
|
return but;
|
||||||
}
|
}
|
||||||
@ -3707,7 +3708,7 @@ uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y
|
|||||||
/* modkeypoin will be set to KM_SHIFT, KM_ALT, KM_CTRL, KM_OSKEY bits */
|
/* modkeypoin will be set to KM_SHIFT, KM_ALT, KM_CTRL, KM_OSKEY bits */
|
||||||
uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *keypoin, short *modkeypoin, const char *tip)
|
uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *keypoin, short *modkeypoin, const char *tip)
|
||||||
{
|
{
|
||||||
uiBut *but = ui_def_but(block, HOTKEYEVT | SHO, retval, str, x, y, width, height, keypoin, 0.0, 0.0, 0.0, 0.0, tip);
|
uiBut *but = ui_def_but(block, HOTKEYEVT | UI_BUT_POIN_SHORT, retval, str, x, y, width, height, keypoin, 0.0, 0.0, 0.0, 0.0, tip);
|
||||||
but->modifier_key = *modkeypoin;
|
but->modifier_key = *modkeypoin;
|
||||||
ui_check_but(but);
|
ui_check_but(but);
|
||||||
return but;
|
return but;
|
||||||
|
@ -494,10 +494,12 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||||||
|
|
||||||
/* local hack... */
|
/* local hack... */
|
||||||
if (but->type == BUT_TOGDUAL && data->togdual) {
|
if (but->type == BUT_TOGDUAL && data->togdual) {
|
||||||
if (but->pointype == SHO)
|
if (but->pointype == UI_BUT_POIN_SHORT) {
|
||||||
but->poin += 2;
|
but->poin += 2;
|
||||||
else if (but->pointype == INT)
|
}
|
||||||
|
else if (but->pointype == UI_BUT_POIN_INT) {
|
||||||
but->poin += 4;
|
but->poin += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
value = ui_get_but_val(but);
|
value = ui_get_but_val(but);
|
||||||
@ -534,10 +536,12 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||||||
|
|
||||||
/* end local hack... */
|
/* end local hack... */
|
||||||
if (but->type == BUT_TOGDUAL && data->togdual) {
|
if (but->type == BUT_TOGDUAL && data->togdual) {
|
||||||
if (but->pointype == SHO)
|
if (but->pointype == UI_BUT_POIN_SHORT) {
|
||||||
but->poin -= 2;
|
but->poin -= 2;
|
||||||
else if (but->pointype == INT)
|
}
|
||||||
|
else if (but->pointype == UI_BUT_POIN_INT) {
|
||||||
but->poin -= 4;
|
but->poin -= 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_apply_but_func(C, but);
|
ui_apply_but_func(C, but);
|
||||||
@ -605,7 +609,7 @@ static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
|
|||||||
|
|
||||||
static void ui_apply_but_TOG3(bContext *C, uiBut *but, uiHandleButtonData *data)
|
static void ui_apply_but_TOG3(bContext *C, uiBut *but, uiHandleButtonData *data)
|
||||||
{
|
{
|
||||||
if (but->pointype == SHO) {
|
if (but->pointype == UI_BUT_POIN_SHORT) {
|
||||||
short *sp = (short *)but->poin;
|
short *sp = (short *)but->poin;
|
||||||
|
|
||||||
if (UI_BITBUT_TEST(sp[1], but->bitnr)) {
|
if (UI_BITBUT_TEST(sp[1], but->bitnr)) {
|
||||||
@ -1049,7 +1053,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
|
|||||||
case PULLDOWN:
|
case PULLDOWN:
|
||||||
ui_apply_but_BLOCK(C, but, data);
|
ui_apply_but_BLOCK(C, but, data);
|
||||||
break;
|
break;
|
||||||
case COL:
|
case COLOR:
|
||||||
if (data->cancel)
|
if (data->cancel)
|
||||||
ui_apply_but_VEC(C, but, data);
|
ui_apply_but_VEC(C, but, data);
|
||||||
else
|
else
|
||||||
@ -1180,7 +1184,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* RGB triple */
|
/* RGB triple */
|
||||||
else if (but->type == COL) {
|
else if (but->type == COLOR) {
|
||||||
float rgb[3];
|
float rgb[3];
|
||||||
|
|
||||||
if (but->poin == NULL && but->rnapoin.data == NULL) ;
|
if (but->poin == NULL && but->rnapoin.data == NULL) ;
|
||||||
@ -2092,12 +2096,12 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
|
|||||||
menufunc = ui_block_func_ICONTEXTROW;
|
menufunc = ui_block_func_ICONTEXTROW;
|
||||||
arg = but;
|
arg = but;
|
||||||
break;
|
break;
|
||||||
case COL:
|
case COLOR:
|
||||||
ui_get_but_vectorf(but, data->origvec);
|
ui_get_but_vectorf(but, data->origvec);
|
||||||
copy_v3_v3(data->vec, data->origvec);
|
copy_v3_v3(data->vec, data->origvec);
|
||||||
but->editvec = data->vec;
|
but->editvec = data->vec;
|
||||||
|
|
||||||
handlefunc = ui_block_func_COL;
|
handlefunc = ui_block_func_COLOR;
|
||||||
arg = but;
|
arg = but;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3001,7 +3005,7 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm
|
|||||||
return WM_UI_HANDLER_BREAK;
|
return WM_UI_HANDLER_BREAK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (but->type == COL) {
|
else if (but->type == COLOR) {
|
||||||
if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
|
if (ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) {
|
||||||
float *hsv = ui_block_hsv_get(but->block);
|
float *hsv = ui_block_hsv_get(but->block);
|
||||||
float col[3];
|
float col[3];
|
||||||
@ -4914,7 +4918,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
|
|||||||
case BUTM:
|
case BUTM:
|
||||||
retval = ui_do_but_BUT(C, but, data, event);
|
retval = ui_do_but_BUT(C, but, data, event);
|
||||||
break;
|
break;
|
||||||
case COL:
|
case COLOR:
|
||||||
if (but->a1 == UI_GRAD_V_ALT) /* signal to prevent calling up color picker */
|
if (but->a1 == UI_GRAD_V_ALT) /* signal to prevent calling up color picker */
|
||||||
retval = ui_do_but_EXIT(C, but, data, event);
|
retval = ui_do_but_EXIT(C, but, data, event);
|
||||||
else
|
else
|
||||||
@ -5880,7 +5884,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (but->type != COL) { /* exception */
|
if (but->type != COLOR) { /* exception */
|
||||||
data->cancel = TRUE;
|
data->cancel = TRUE;
|
||||||
}
|
}
|
||||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||||
@ -5990,7 +5994,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut *
|
|||||||
|
|
||||||
/* copy over return values from the closing menu */
|
/* copy over return values from the closing menu */
|
||||||
if ((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_UPDATE)) {
|
if ((menu->menuretval & UI_RETURN_OK) || (menu->menuretval & UI_RETURN_UPDATE)) {
|
||||||
if (but->type == COL)
|
if (but->type == COLOR)
|
||||||
copy_v3_v3(data->vec, menu->retvec);
|
copy_v3_v3(data->vec, menu->retvec);
|
||||||
else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
|
else if (ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
|
||||||
data->value = menu->retvalue;
|
data->value = menu->retvalue;
|
||||||
@ -6420,7 +6424,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
|
|||||||
for (but = block->buttons.first; but; but = but->next) {
|
for (but = block->buttons.first; but; but = but->next) {
|
||||||
|
|
||||||
if (but->menu_key == event->type) {
|
if (but->menu_key == event->type) {
|
||||||
if (but->type == BUT) {
|
if (ELEM(but->type, BUT, BUTM)) {
|
||||||
/* mainly for operator buttons */
|
/* mainly for operator buttons */
|
||||||
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_APPLY);
|
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE_APPLY);
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,7 @@ typedef enum {
|
|||||||
UI_WTYPE_BOX,
|
UI_WTYPE_BOX,
|
||||||
UI_WTYPE_SCROLL,
|
UI_WTYPE_SCROLL,
|
||||||
UI_WTYPE_LISTITEM,
|
UI_WTYPE_LISTITEM,
|
||||||
UI_WTYPE_PROGRESSBAR,
|
UI_WTYPE_PROGRESSBAR
|
||||||
|
|
||||||
} uiWidgetTypeEnum;
|
} uiWidgetTypeEnum;
|
||||||
|
|
||||||
/* panel limits */
|
/* panel limits */
|
||||||
@ -133,7 +132,7 @@ typedef enum {
|
|||||||
|
|
||||||
/* bit button defines */
|
/* bit button defines */
|
||||||
/* Bit operations */
|
/* Bit operations */
|
||||||
#define UI_BITBUT_TEST(a, b) ( ( (a) & 1 << (b) ) != 0)
|
#define UI_BITBUT_TEST(a, b) ( ( (a) & 1 << (b) ) != 0)
|
||||||
#define UI_BITBUT_SET(a, b) ( (a) | 1 << (b) )
|
#define UI_BITBUT_SET(a, b) ( (a) | 1 << (b) )
|
||||||
#define UI_BITBUT_CLR(a, b) ( (a) & ~(1 << (b)) )
|
#define UI_BITBUT_CLR(a, b) ( (a) & ~(1 << (b)) )
|
||||||
/* bit-row */
|
/* bit-row */
|
||||||
@ -159,8 +158,9 @@ typedef struct {
|
|||||||
struct uiBut {
|
struct uiBut {
|
||||||
struct uiBut *next, *prev;
|
struct uiBut *next, *prev;
|
||||||
int flag, drawflag;
|
int flag, drawflag;
|
||||||
eButType type;
|
eButType type;
|
||||||
short pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend, alignnr;
|
eButPointerType pointype;
|
||||||
|
short bit, bitnr, retval, strwidth, ofs, pos, selsta, selend, alignnr;
|
||||||
|
|
||||||
char *str;
|
char *str;
|
||||||
char strdata[UI_MAX_NAME_STR];
|
char strdata[UI_MAX_NAME_STR];
|
||||||
@ -430,7 +430,7 @@ struct uiPopupBlockHandle {
|
|||||||
float retvec[4];
|
float retvec[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
uiBlock *ui_block_func_COL(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
|
uiBlock *ui_block_func_COLOR(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but);
|
||||||
void ui_block_func_ICONROW(struct bContext *C, uiLayout *layout, void *arg_but);
|
void ui_block_func_ICONROW(struct bContext *C, uiLayout *layout, void *arg_but);
|
||||||
void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_but);
|
void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_but);
|
||||||
|
|
||||||
|
@ -1808,11 +1808,11 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
|
|||||||
bt->flag = UI_TEXT_LEFT;
|
bt->flag = UI_TEXT_LEFT;
|
||||||
}
|
}
|
||||||
else if (entry->icon) {
|
else if (entry->icon) {
|
||||||
uiDefIconTextButF(block, BUTM | FLO, B_NOP, entry->icon, entry->str, 0, 0,
|
uiDefIconTextButF(block, BUTM, B_NOP, entry->icon, entry->str, 0, 0,
|
||||||
UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
|
UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uiDefButF(block, BUTM | FLO, B_NOP, entry->str, 0, 0,
|
uiDefButF(block, BUTM, B_NOP, entry->str, 0, 0,
|
||||||
UI_UNIT_X * 5, UI_UNIT_X, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
|
UI_UNIT_X * 5, UI_UNIT_X, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1830,7 +1830,7 @@ void ui_block_func_ICONROW(bContext *UNUSED(C), uiLayout *layout, void *arg_but)
|
|||||||
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
|
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
|
||||||
|
|
||||||
for (a = (int)but->hardmin; a <= (int)but->hardmax; a++)
|
for (a = (int)but->hardmin; a <= (int)but->hardmax; a++)
|
||||||
uiDefIconButF(block, BUTM | FLO, B_NOP, but->icon + (a - but->hardmin), 0, 0, UI_UNIT_X * 5, UI_UNIT_Y,
|
uiDefIconButF(block, BUTM, B_NOP, but->icon + (a - but->hardmin), 0, 0, UI_UNIT_X * 5, UI_UNIT_Y,
|
||||||
&handle->retvalue, (float)a, 0.0, 0, 0, "");
|
&handle->retvalue, (float)a, 0.0, 0, 0, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1860,7 +1860,7 @@ void ui_block_func_ICONTEXTROW(bContext *UNUSED(C), uiLayout *layout, void *arg_
|
|||||||
if (entry->sepr)
|
if (entry->sepr)
|
||||||
uiItemS(layout);
|
uiItemS(layout);
|
||||||
else
|
else
|
||||||
uiDefIconTextButF(block, BUTM | FLO, B_NOP, (short)((but->icon) + (entry->retval - but->hardmin)), entry->str,
|
uiDefIconTextButF(block, BUTM, B_NOP, (short)((but->icon) + (entry->retval - but->hardmin)), entry->str,
|
||||||
0, 0, UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
|
0, 0, UI_UNIT_X * 5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2244,7 +2244,7 @@ static int ui_picker_small_wheel_cb(const bContext *UNUSED(C), uiBlock *block, w
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
|
uiBlock *ui_block_func_COLOR(bContext *C, uiPopupBlockHandle *handle, void *arg_but)
|
||||||
{
|
{
|
||||||
uiBut *but = arg_but;
|
uiBut *but = arg_but;
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
|
@ -78,7 +78,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
|
|||||||
|
|
||||||
if (arraylen && index == -1) {
|
if (arraylen && index == -1) {
|
||||||
if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA))
|
if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA))
|
||||||
but = uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL);
|
but = uiDefButR_prop(block, COLOR, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL);
|
||||||
}
|
}
|
||||||
else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
|
else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
|
||||||
but = uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
but = uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
|
||||||
|
@ -1255,10 +1255,12 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
|
|||||||
|
|
||||||
if (but->type == BUT_TOGDUAL) {
|
if (but->type == BUT_TOGDUAL) {
|
||||||
int dualset = 0;
|
int dualset = 0;
|
||||||
if (but->pointype == SHO)
|
if (but->pointype == UI_BUT_POIN_SHORT) {
|
||||||
dualset = UI_BITBUT_TEST(*(((short *)but->poin) + 1), but->bitnr);
|
dualset = UI_BITBUT_TEST(*(((short *)but->poin) + 1), but->bitnr);
|
||||||
else if (but->pointype == INT)
|
}
|
||||||
|
else if (but->pointype == UI_BUT_POIN_INT) {
|
||||||
dualset = UI_BITBUT_TEST(*(((int *)but->poin) + 1), but->bitnr);
|
dualset = UI_BITBUT_TEST(*(((int *)but->poin) + 1), but->bitnr);
|
||||||
|
}
|
||||||
|
|
||||||
widget_draw_icon(but, ICON_DOT, dualset ? 1.0f : 0.25f, rect);
|
widget_draw_icon(but, ICON_DOT, dualset ? 1.0f : 0.25f, rect);
|
||||||
}
|
}
|
||||||
@ -3158,7 +3160,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
|
|||||||
wt = widget_type(UI_WTYPE_MENU_ITEM);
|
wt = widget_type(UI_WTYPE_MENU_ITEM);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COL:
|
case COLOR:
|
||||||
wt = widget_type(UI_WTYPE_SWATCH);
|
wt = widget_type(UI_WTYPE_SWATCH);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -556,6 +556,7 @@ static int add_vertex_new(const bContext *C, Mask *mask, MaskLayer *masklay, con
|
|||||||
|
|
||||||
static int add_vertex_exec(bContext *C, wmOperator *op)
|
static int add_vertex_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
|
Scene *scene = CTX_data_scene(C);
|
||||||
Mask *mask = CTX_data_edit_mask(C);
|
Mask *mask = CTX_data_edit_mask(C);
|
||||||
MaskLayer *masklay;
|
MaskLayer *masklay;
|
||||||
|
|
||||||
@ -595,7 +596,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
|
|||||||
BKE_mask_calc_handle_point_auto(spline, point_other, FALSE);
|
BKE_mask_calc_handle_point_auto(spline, point_other, FALSE);
|
||||||
|
|
||||||
/* TODO: only update this spline */
|
/* TODO: only update this spline */
|
||||||
BKE_mask_update_display(mask, CTX_data_scene(C)->r.cfra);
|
BKE_mask_update_display(mask, CFRA);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
|
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
@ -617,7 +618,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: only update this spline */
|
/* TODO: only update this spline */
|
||||||
BKE_mask_update_display(mask, CTX_data_scene(C)->r.cfra);
|
BKE_mask_update_display(mask, CFRA);
|
||||||
|
|
||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,8 @@ void ED_mask_draw(const bContext *C,
|
|||||||
* width, height are to match the values from ED_mask_get_size() */
|
* width, height are to match the values from ED_mask_get_size() */
|
||||||
void ED_mask_draw_region(Mask *mask, ARegion *ar,
|
void ED_mask_draw_region(Mask *mask, ARegion *ar,
|
||||||
const char draw_flag, const char draw_type,
|
const char draw_flag, const char draw_type,
|
||||||
int width, int height,
|
const int width_i, const int height_i, /* convert directly into aspect corrected vars */
|
||||||
|
const float aspx, const float aspy,
|
||||||
const short do_scale_applied, const short do_post_draw,
|
const short do_scale_applied, const short do_post_draw,
|
||||||
float stabmat[4][4], /* optional - only used by clip */
|
float stabmat[4][4], /* optional - only used by clip */
|
||||||
const bContext *C /* optional - only used when do_post_draw is set */
|
const bContext *C /* optional - only used when do_post_draw is set */
|
||||||
@ -504,6 +505,9 @@ void ED_mask_draw_region(Mask *mask, ARegion *ar,
|
|||||||
{
|
{
|
||||||
struct View2D *v2d = &ar->v2d;
|
struct View2D *v2d = &ar->v2d;
|
||||||
|
|
||||||
|
/* aspect always scales vertically in movie and image spaces */
|
||||||
|
const float width = width_i, height = (float)height_i * (aspy / aspx);
|
||||||
|
|
||||||
int x, y;
|
int x, y;
|
||||||
/* int w, h; */
|
/* int w, h; */
|
||||||
float zoomx, zoomy;
|
float zoomx, zoomy;
|
||||||
|
@ -109,11 +109,9 @@ void ED_mask_mouse_pos(ScrArea *sa, ARegion *ar, const int mval[2], float co[2])
|
|||||||
}
|
}
|
||||||
case SPACE_IMAGE:
|
case SPACE_IMAGE:
|
||||||
{
|
{
|
||||||
float frame_size[2];
|
|
||||||
SpaceImage *sima = sa->spacedata.first;
|
SpaceImage *sima = sa->spacedata.first;
|
||||||
ED_space_image_get_size_fl(sima, frame_size);
|
|
||||||
ED_image_mouse_pos(sima, ar, mval, co);
|
ED_image_mouse_pos(sima, ar, mval, co);
|
||||||
BKE_mask_coord_from_frame(co, co, frame_size);
|
BKE_mask_coord_from_image(sima->image, &sima->iuser, co, co);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -149,11 +147,9 @@ void ED_mask_point_pos(ScrArea *sa, ARegion *ar, float x, float y, float *xr, fl
|
|||||||
break;
|
break;
|
||||||
case SPACE_IMAGE:
|
case SPACE_IMAGE:
|
||||||
{
|
{
|
||||||
float frame_size[2];
|
|
||||||
SpaceImage *sima = sa->spacedata.first;
|
SpaceImage *sima = sa->spacedata.first;
|
||||||
ED_space_image_get_size_fl(sima, frame_size);
|
|
||||||
ED_image_point_pos(sima, ar, x, y, &co[0], &co[1]);
|
ED_image_point_pos(sima, ar, x, y, &co[0], &co[1]);
|
||||||
BKE_mask_coord_from_frame(co, co, frame_size);
|
BKE_mask_coord_from_image(sima->image, &sima->iuser, co, co);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -192,13 +188,10 @@ void ED_mask_point_pos__reverse(ScrArea *sa, ARegion *ar, float x, float y, floa
|
|||||||
break;
|
break;
|
||||||
case SPACE_IMAGE:
|
case SPACE_IMAGE:
|
||||||
{
|
{
|
||||||
float frame_size[2];
|
|
||||||
SpaceImage *sima = sa->spacedata.first;
|
SpaceImage *sima = sa->spacedata.first;
|
||||||
ED_space_image_get_size_fl(sima, frame_size);
|
|
||||||
|
|
||||||
co[0] = x;
|
co[0] = x;
|
||||||
co[1] = y;
|
co[1] = y;
|
||||||
BKE_mask_coord_to_frame(co, co, frame_size);
|
BKE_mask_coord_to_image(sima->image, &sima->iuser, co, co);
|
||||||
ED_image_point_pos__reverse(sima, ar, co, co);
|
ED_image_point_pos__reverse(sima, ar, co, co);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -915,6 +915,7 @@ static void delete_feather_points(MaskSplinePoint *point)
|
|||||||
|
|
||||||
static int delete_exec(bContext *C, wmOperator *UNUSED(op))
|
static int delete_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
|
Scene *scene = CTX_data_scene(C);
|
||||||
Mask *mask = CTX_data_edit_mask(C);
|
Mask *mask = CTX_data_edit_mask(C);
|
||||||
MaskLayer *masklay;
|
MaskLayer *masklay;
|
||||||
|
|
||||||
@ -1002,7 +1003,7 @@ static int delete_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: only update edited splines */
|
/* TODO: only update edited splines */
|
||||||
BKE_mask_update_display(mask, CTX_data_scene(C)->r.cfra);
|
BKE_mask_update_display(mask, CFRA);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
|
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
|
||||||
|
|
||||||
@ -1060,7 +1061,7 @@ static int mask_switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
if (change) {
|
if (change) {
|
||||||
/* TODO: only update this spline */
|
/* TODO: only update this spline */
|
||||||
BKE_mask_update_display(mask, CTX_data_scene(C)->r.cfra);
|
BKE_mask_update_display(mask, CFRA);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
|
WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
|
||||||
|
|
||||||
@ -1126,7 +1127,7 @@ static int mask_normals_make_consistent_exec(bContext *C, wmOperator *UNUSED(op)
|
|||||||
|
|
||||||
if (change) {
|
if (change) {
|
||||||
/* TODO: only update this spline */
|
/* TODO: only update this spline */
|
||||||
BKE_mask_update_display(mask, CTX_data_scene(C)->r.cfra);
|
BKE_mask_update_display(mask, CFRA);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
|
WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);
|
||||||
|
|
||||||
@ -1324,6 +1325,7 @@ void MASK_OT_hide_view_set(wmOperatorType *ot)
|
|||||||
|
|
||||||
static int mask_feather_weight_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
static int mask_feather_weight_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
|
Scene *scene = CTX_data_scene(C);
|
||||||
Mask *mask = CTX_data_edit_mask(C);
|
Mask *mask = CTX_data_edit_mask(C);
|
||||||
MaskLayer *masklay;
|
MaskLayer *masklay;
|
||||||
int changed = FALSE;
|
int changed = FALSE;
|
||||||
@ -1351,7 +1353,7 @@ static int mask_feather_weight_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
/* TODO: only update edited splines */
|
/* TODO: only update edited splines */
|
||||||
BKE_mask_update_display(mask, CTX_data_scene(C)->r.cfra);
|
BKE_mask_update_display(mask, CFRA);
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_MASK | ND_DRAW, mask);
|
WM_event_add_notifier(C, NC_MASK | ND_DRAW, mask);
|
||||||
DAG_id_tag_update(&mask->id, 0);
|
DAG_id_tag_update(&mask->id, 0);
|
||||||
|
@ -1352,6 +1352,8 @@ static void init_bake_internal(BakeRender *bkr, bContext *C)
|
|||||||
|
|
||||||
static void finish_bake_internal(BakeRender *bkr)
|
static void finish_bake_internal(BakeRender *bkr)
|
||||||
{
|
{
|
||||||
|
Image *ima;
|
||||||
|
|
||||||
RE_Database_Free(bkr->re);
|
RE_Database_Free(bkr->re);
|
||||||
|
|
||||||
/* restore raytrace and AO */
|
/* restore raytrace and AO */
|
||||||
@ -1363,27 +1365,30 @@ static void finish_bake_internal(BakeRender *bkr)
|
|||||||
if (bkr->prev_r_raytrace == 0)
|
if (bkr->prev_r_raytrace == 0)
|
||||||
bkr->scene->r.mode &= ~R_RAYTRACE;
|
bkr->scene->r.mode &= ~R_RAYTRACE;
|
||||||
|
|
||||||
if (bkr->result == BAKE_RESULT_OK) {
|
|
||||||
Image *ima;
|
/* force OpenGL reload and mipmap recalc */
|
||||||
/* force OpenGL reload and mipmap recalc */
|
for (ima = G.main->image.first; ima; ima = ima->id.next) {
|
||||||
for (ima = G.main->image.first; ima; ima = ima->id.next) {
|
ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
|
||||||
|
|
||||||
|
if (bkr->result == BAKE_RESULT_OK) {
|
||||||
if (ima->ok == IMA_OK_LOADED) {
|
if (ima->ok == IMA_OK_LOADED) {
|
||||||
ImBuf *ibuf = BKE_image_get_ibuf(ima, NULL);
|
|
||||||
if (ibuf) {
|
if (ibuf) {
|
||||||
if (ibuf->userflags & IB_BITMAPDIRTY) {
|
if (ibuf->userflags & IB_BITMAPDIRTY) {
|
||||||
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
|
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
|
||||||
GPU_free_image(ima);
|
GPU_free_image(ima);
|
||||||
imb_freemipmapImBuf(ibuf);
|
imb_freemipmapImBuf(ibuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* freed when baking is done, but if its canceled we need to free here */
|
|
||||||
if (ibuf->userdata) {
|
|
||||||
MEM_freeN(ibuf->userdata);
|
|
||||||
ibuf->userdata = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* freed when baking is done, but if its canceled we need to free here */
|
||||||
|
if (ibuf) {
|
||||||
|
if (ibuf->userdata) {
|
||||||
|
MEM_freeN(ibuf->userdata);
|
||||||
|
ibuf->userdata = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1658,7 +1658,7 @@ static int skin_radii_equalize_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
void OBJECT_OT_skin_radii_equalize(wmOperatorType *ot)
|
void OBJECT_OT_skin_radii_equalize(wmOperatorType *ot)
|
||||||
{
|
{
|
||||||
ot->name = "Skin Radii Equalize";
|
ot->name = "Skin Radii Equalize";
|
||||||
ot->description = "Make skin radii of selected vertices equal";
|
ot->description = "Make skin radii of selected vertices equal on each axis";
|
||||||
ot->idname = "OBJECT_OT_skin_radii_equalize";
|
ot->idname = "OBJECT_OT_skin_radii_equalize";
|
||||||
|
|
||||||
ot->poll = skin_edit_poll;
|
ot->poll = skin_edit_poll;
|
||||||
|
@ -158,7 +158,7 @@ void ED_space_clip_get_aspect(SpaceClip *sc, float *aspx, float *aspy)
|
|||||||
MovieClip *clip = ED_space_clip_get_clip(sc);
|
MovieClip *clip = ED_space_clip_get_clip(sc);
|
||||||
|
|
||||||
if (clip)
|
if (clip)
|
||||||
BKE_movieclip_aspect(clip, aspx, aspy);
|
BKE_movieclip_get_aspect(clip, aspx, aspy);
|
||||||
else
|
else
|
||||||
*aspx = *aspy = 1.0f;
|
*aspx = *aspy = 1.0f;
|
||||||
|
|
||||||
|
@ -1131,10 +1131,13 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
|
|||||||
if (mask) {
|
if (mask) {
|
||||||
ScrArea *sa = CTX_wm_area(C);
|
ScrArea *sa = CTX_wm_area(C);
|
||||||
int width, height;
|
int width, height;
|
||||||
|
float aspx, aspy;
|
||||||
ED_mask_get_size(sa, &width, &height);
|
ED_mask_get_size(sa, &width, &height);
|
||||||
|
ED_space_clip_get_aspect(sc, &aspx, &aspy);
|
||||||
ED_mask_draw_region(mask, ar,
|
ED_mask_draw_region(mask, ar,
|
||||||
sc->mask_info.draw_flag, sc->mask_info.draw_type,
|
sc->mask_info.draw_flag, sc->mask_info.draw_type,
|
||||||
width, height,
|
width, height,
|
||||||
|
aspx, aspy,
|
||||||
TRUE, TRUE,
|
TRUE, TRUE,
|
||||||
sc->stabmat, C);
|
sc->stabmat, C);
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ static FileSelection file_selection_get(bContext *C, const rcti *rect, short fil
|
|||||||
return sel;
|
return sel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FileSelect file_select_do(bContext *C, int selected_idx)
|
static FileSelect file_select_do(bContext *C, int selected_idx, short do_diropen)
|
||||||
{
|
{
|
||||||
FileSelect retval = FILE_SELECT_NOTHING;
|
FileSelect retval = FILE_SELECT_NOTHING;
|
||||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||||
@ -172,8 +172,12 @@ static FileSelect file_select_do(bContext *C, int selected_idx)
|
|||||||
params->active_file = selected_idx;
|
params->active_file = selected_idx;
|
||||||
|
|
||||||
if (S_ISDIR(file->type)) {
|
if (S_ISDIR(file->type)) {
|
||||||
|
if (do_diropen == FALSE) {
|
||||||
|
params->file[0] = '\0';
|
||||||
|
retval = FILE_SELECT_DIR;
|
||||||
|
}
|
||||||
/* the path is too long and we are not going up! */
|
/* the path is too long and we are not going up! */
|
||||||
if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX) {
|
else if (strcmp(file->relname, "..") && strlen(params->dir) + strlen(file->relname) >= FILE_MAX) {
|
||||||
// XXX error("Path too long, cannot enter this directory");
|
// XXX error("Path too long, cannot enter this directory");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -202,7 +206,7 @@ static FileSelect file_select_do(bContext *C, int selected_idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select, short fill)
|
static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select, short fill, short do_diropen)
|
||||||
{
|
{
|
||||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||||
FileSelect retval = FILE_SELECT_NOTHING;
|
FileSelect retval = FILE_SELECT_NOTHING;
|
||||||
@ -219,7 +223,7 @@ static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select,
|
|||||||
if ((sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE))) {
|
if ((sel.last >= 0) && ((select == FILE_SEL_ADD) || (select == FILE_SEL_TOGGLE))) {
|
||||||
/* Check last selection, if selected, act on the file or dir */
|
/* Check last selection, if selected, act on the file or dir */
|
||||||
if (filelist_is_selected(sfile->files, sel.last, check_type)) {
|
if (filelist_is_selected(sfile->files, sel.last, check_type)) {
|
||||||
retval = file_select_do(C, sel.last);
|
retval = file_select_do(C, sel.last, do_diropen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +288,7 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
BLI_rcti_isect(&(ar->v2d.mask), &rect, &rect);
|
BLI_rcti_isect(&(ar->v2d.mask), &rect, &rect);
|
||||||
|
|
||||||
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, 0);
|
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, FALSE, FALSE);
|
||||||
if (FILE_SELECT_DIR == ret) {
|
if (FILE_SELECT_DIR == ret) {
|
||||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
|
||||||
}
|
}
|
||||||
@ -320,6 +324,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
|||||||
rcti rect;
|
rcti rect;
|
||||||
int extend = RNA_boolean_get(op->ptr, "extend");
|
int extend = RNA_boolean_get(op->ptr, "extend");
|
||||||
int fill = RNA_boolean_get(op->ptr, "fill");
|
int fill = RNA_boolean_get(op->ptr, "fill");
|
||||||
|
int do_diropen = RNA_boolean_get(op->ptr, "open");
|
||||||
|
|
||||||
if (ar->regiontype != RGN_TYPE_WINDOW)
|
if (ar->regiontype != RGN_TYPE_WINDOW)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
@ -333,7 +338,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
|||||||
/* single select, deselect all selected first */
|
/* single select, deselect all selected first */
|
||||||
if (!extend) file_deselect_all(sfile, SELECTED_FILE);
|
if (!extend) file_deselect_all(sfile, SELECTED_FILE);
|
||||||
|
|
||||||
ret = file_select(C, &rect, extend ? FILE_SEL_TOGGLE : FILE_SEL_ADD, fill);
|
ret = file_select(C, &rect, extend ? FILE_SEL_TOGGLE : FILE_SEL_ADD, fill, do_diropen);
|
||||||
if (FILE_SELECT_DIR == ret)
|
if (FILE_SELECT_DIR == ret)
|
||||||
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
|
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
|
||||||
else if (FILE_SELECT_FILE == ret)
|
else if (FILE_SELECT_FILE == ret)
|
||||||
@ -357,8 +362,9 @@ void FILE_OT_select(wmOperatorType *ot)
|
|||||||
ot->poll = ED_operator_file_active;
|
ot->poll = ED_operator_file_active;
|
||||||
|
|
||||||
/* rna */
|
/* rna */
|
||||||
RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
|
RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
|
||||||
RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection");
|
RNA_def_boolean(ot->srna, "fill", FALSE, "Fill", "Select everything beginning with the last selection");
|
||||||
|
RNA_def_boolean(ot->srna, "open", TRUE, "Open", "Open a directory when selecting it");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
|
static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
|
@ -284,8 +284,6 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
|
|||||||
|
|
||||||
keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
|
keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
|
||||||
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
|
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
|
static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
|
||||||
@ -418,12 +416,26 @@ static void file_keymap(struct wmKeyConfig *keyconf)
|
|||||||
keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
|
keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
|
||||||
kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
|
kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "need_active", TRUE);
|
RNA_boolean_set(kmi->ptr, "need_active", TRUE);
|
||||||
|
|
||||||
|
/* left mouse selects and opens */
|
||||||
WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0);
|
WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0);
|
||||||
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
|
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_ALT, 0);
|
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_ALT, 0);
|
||||||
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
RNA_boolean_set(kmi->ptr, "fill", TRUE);
|
RNA_boolean_set(kmi->ptr, "fill", TRUE);
|
||||||
|
|
||||||
|
/* right mouse selects without opening */
|
||||||
|
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", RIGHTMOUSE, KM_CLICK, 0, 0);
|
||||||
|
RNA_boolean_set(kmi->ptr, "open", FALSE);
|
||||||
|
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", RIGHTMOUSE, KM_CLICK, KM_SHIFT, 0);
|
||||||
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
|
RNA_boolean_set(kmi->ptr, "open", FALSE);
|
||||||
|
kmi = WM_keymap_add_item(keymap, "FILE_OT_select", RIGHTMOUSE, KM_CLICK, KM_ALT, 0);
|
||||||
|
RNA_boolean_set(kmi->ptr, "extend", TRUE);
|
||||||
|
RNA_boolean_set(kmi->ptr, "fill", TRUE);
|
||||||
|
RNA_boolean_set(kmi->ptr, "open", FALSE);
|
||||||
|
|
||||||
WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
|
WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
|
||||||
WM_keymap_add_item(keymap, "FILE_OT_refresh", PADPERIOD, KM_PRESS, 0, 0);
|
WM_keymap_add_item(keymap, "FILE_OT_refresh", PADPERIOD, KM_PRESS, 0, 0);
|
||||||
WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0);
|
WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0);
|
||||||
|
@ -143,27 +143,6 @@ int ED_space_image_has_buffer(SpaceImage *sima)
|
|||||||
return has_buffer;
|
return has_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_image_get_size(Image *ima, int *width, int *height)
|
|
||||||
{
|
|
||||||
ImBuf *ibuf = NULL;
|
|
||||||
void *lock;
|
|
||||||
|
|
||||||
if (ima)
|
|
||||||
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
|
|
||||||
|
|
||||||
if (ibuf && ibuf->x > 0 && ibuf->y > 0) {
|
|
||||||
*width = ibuf->x;
|
|
||||||
*height = ibuf->y;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*width = IMG_SIZE_FALLBACK;
|
|
||||||
*height = IMG_SIZE_FALLBACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ima)
|
|
||||||
BKE_image_release_ibuf(ima, lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ED_space_image_get_size(SpaceImage *sima, int *width, int *height)
|
void ED_space_image_get_size(SpaceImage *sima, int *width, int *height)
|
||||||
{
|
{
|
||||||
Scene *scene = sima->iuser.scene;
|
Scene *scene = sima->iuser.scene;
|
||||||
@ -205,23 +184,18 @@ void ED_space_image_get_size_fl(SpaceImage *sima, float size[2])
|
|||||||
size[1] = size_i[1];
|
size[1] = size_i[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_image_get_aspect(Image *ima, float *aspx, float *aspy)
|
|
||||||
{
|
|
||||||
*aspx = *aspy = 1.0;
|
|
||||||
|
|
||||||
if ((ima == NULL) || (ima->type == IMA_TYPE_R_RESULT) || (ima->type == IMA_TYPE_COMPOSITE) ||
|
|
||||||
(ima->aspx == 0.0f || ima->aspy == 0.0f))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* x is always 1 */
|
|
||||||
*aspy = ima->aspy / ima->aspx;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ED_space_image_get_aspect(SpaceImage *sima, float *aspx, float *aspy)
|
void ED_space_image_get_aspect(SpaceImage *sima, float *aspx, float *aspy)
|
||||||
{
|
{
|
||||||
ED_image_get_aspect(ED_space_image(sima), aspx, aspy);
|
Image *ima = sima->image;
|
||||||
|
if ((ima == NULL) || (ima->type == IMA_TYPE_R_RESULT) || (ima->type == IMA_TYPE_COMPOSITE) ||
|
||||||
|
(ima->aspx == 0.0f || ima->aspy == 0.0f))
|
||||||
|
{
|
||||||
|
*aspx = *aspy = 1.0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BKE_image_get_aspect(ima, aspx, aspy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_space_image_get_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoomy)
|
void ED_space_image_get_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float *zoomy)
|
||||||
@ -254,12 +228,12 @@ void ED_space_image_get_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ED_image_get_uv_aspect(Image *ima, float *aspx, float *aspy)
|
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *aspx, float *aspy)
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
ED_image_get_aspect(ima, aspx, aspy);
|
BKE_image_get_aspect(ima, aspx, aspy);
|
||||||
ED_image_get_size(ima, &w, &h);
|
BKE_image_get_size(ima, iuser, &w, &h);
|
||||||
|
|
||||||
*aspx *= (float)w;
|
*aspx *= (float)w;
|
||||||
*aspy *= (float)h;
|
*aspy *= (float)h;
|
||||||
|
@ -633,7 +633,7 @@ static int image_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
ima = ED_space_image(sima);
|
ima = ED_space_image(sima);
|
||||||
ED_space_image_get_size(sima, &width, &height);
|
ED_space_image_get_size(sima, &width, &height);
|
||||||
ED_image_get_aspect(ima, &aspx, &aspy);
|
ED_space_image_get_aspect(sima, &aspx, &aspy);
|
||||||
|
|
||||||
width = width * aspx;
|
width = width * aspx;
|
||||||
height = height * aspy;
|
height = height * aspy;
|
||||||
|
@ -679,10 +679,13 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
|
|||||||
|
|
||||||
if (mask) {
|
if (mask) {
|
||||||
int width, height;
|
int width, height;
|
||||||
|
float aspx, aspy;
|
||||||
ED_space_image_get_size(sima, &width, &height);
|
ED_space_image_get_size(sima, &width, &height);
|
||||||
|
ED_space_image_get_aspect(sima, &aspx, &aspy);
|
||||||
ED_mask_draw_region(mask, ar,
|
ED_mask_draw_region(mask, ar,
|
||||||
sima->mask_info.draw_flag, sima->mask_info.draw_type,
|
sima->mask_info.draw_flag, sima->mask_info.draw_type,
|
||||||
width, height,
|
width, height,
|
||||||
|
aspx, aspy,
|
||||||
TRUE, FALSE,
|
TRUE, FALSE,
|
||||||
NULL, C);
|
NULL, C);
|
||||||
|
|
||||||
|
@ -2162,7 +2162,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
|
|||||||
0.0, 1.0, 0, 0, "Sets the volume of this sound");
|
0.0, 1.0, 0, 0, "Sets the volume of this sound");
|
||||||
uiDefButF(block, NUM, 0, "Pitch:", xco+wval+10, yco-66, wval, 19, &sa->pitch, -12.0,
|
uiDefButF(block, NUM, 0, "Pitch:", xco+wval+10, yco-66, wval, 19, &sa->pitch, -12.0,
|
||||||
12.0, 0, 0, "Sets the pitch of this sound");
|
12.0, 0, 0, "Sets the pitch of this sound");
|
||||||
uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
|
uiDefButS(block, TOG | UI_BUT_POIN_BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
|
||||||
&sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
|
&sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
|
||||||
if (sa->flag & ACT_SND_3D_SOUND) {
|
if (sa->flag & ACT_SND_3D_SOUND) {
|
||||||
uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19,
|
uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19,
|
||||||
@ -3398,7 +3398,13 @@ static void draw_sensor_message(uiLayout *layout, PointerRNA *ptr)
|
|||||||
|
|
||||||
static void draw_sensor_mouse(uiLayout *layout, PointerRNA *ptr)
|
static void draw_sensor_mouse(uiLayout *layout, PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
uiItemR(layout, ptr, "mouse_event", 0, NULL, ICON_NONE);
|
uiLayout *split;
|
||||||
|
|
||||||
|
split = uiLayoutSplit(layout, 0.8f, FALSE);
|
||||||
|
uiItemR(split, ptr, "mouse_event", 0, NULL, ICON_NONE);
|
||||||
|
|
||||||
|
if (RNA_enum_get(ptr, "mouse_event") == BL_SENS_MOUSE_MOUSEOVER_ANY)
|
||||||
|
uiItemR(split, ptr, "use_pulse", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_sensor_near(uiLayout *layout, PointerRNA *ptr)
|
static void draw_sensor_near(uiLayout *layout, PointerRNA *ptr)
|
||||||
|
@ -172,7 +172,7 @@ static void node_socket_button_color(const bContext *C, uiBlock *block,
|
|||||||
int labelw = width - 40;
|
int labelw = width - 40;
|
||||||
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
|
RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr);
|
||||||
|
|
||||||
bt = uiDefButR(block, COL, B_NODE_EXEC, "",
|
bt = uiDefButR(block, COLOR, B_NODE_EXEC, "",
|
||||||
x, y + 2, (labelw > 0 ? 40 : width), NODE_DY - 2,
|
x, y + 2, (labelw > 0 ? 40 : width), NODE_DY - 2,
|
||||||
&ptr, "default_value", 0, 0, 0, -1, -1, NULL);
|
&ptr, "default_value", 0, 0, 0, -1, -1, NULL);
|
||||||
if (node)
|
if (node)
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
#include "BLF_translation.h"
|
#include "BLF_translation.h"
|
||||||
|
|
||||||
|
#include "BKE_blender.h"
|
||||||
#include "BKE_context.h"
|
#include "BKE_context.h"
|
||||||
#include "BKE_global.h"
|
#include "BKE_global.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
@ -64,7 +65,7 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp)
|
|||||||
SpaceNode *snode = CTX_wm_space_node(C);
|
SpaceNode *snode = CTX_wm_space_node(C);
|
||||||
ScrArea *sa = CTX_wm_area(C);
|
ScrArea *sa = CTX_wm_area(C);
|
||||||
ARegion *ar;
|
ARegion *ar;
|
||||||
bNode *node;
|
bNode *node, *node_new;
|
||||||
|
|
||||||
/* get location to add node at mouse */
|
/* get location to add node at mouse */
|
||||||
for (ar = sa->regionbase.first; ar; ar = ar->next) {
|
for (ar = sa->regionbase.first; ar; ar = ar->next) {
|
||||||
@ -84,7 +85,7 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp)
|
|||||||
else node->flag &= ~NODE_TEST;
|
else node->flag &= ~NODE_TEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* node= */ node_add_node(snode, bmain, scene, ntemp, snode->cursor[0], snode->cursor[1]);
|
node_new = node_add_node(snode, bmain, scene, ntemp, snode->cursor[0], snode->cursor[1]);
|
||||||
|
|
||||||
/* select previous selection before autoconnect */
|
/* select previous selection before autoconnect */
|
||||||
for (node = snode->edittree->nodes.first; node; node = node->next) {
|
for (node = snode->edittree->nodes.first; node; node = node->next) {
|
||||||
@ -95,7 +96,14 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp)
|
|||||||
for (node = snode->edittree->nodes.first; node; node = node->next) {
|
for (node = snode->edittree->nodes.first; node; node = node->next) {
|
||||||
if (node->flag & NODE_TEST) node->flag &= ~NODE_SELECT;
|
if (node->flag & NODE_TEST) node->flag &= ~NODE_SELECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* once this is called from an operator, this should be removed */
|
||||||
|
if (node_new) {
|
||||||
|
char undostr[BKE_UNDO_STR_MAX];
|
||||||
|
BLI_snprintf(undostr, sizeof(BKE_UNDO_STR_MAX), "Add Node %s", nodeLabel(node_new));
|
||||||
|
BKE_write_undo(C, undostr);
|
||||||
|
}
|
||||||
|
|
||||||
snode_notify(C, snode);
|
snode_notify(C, snode);
|
||||||
snode_dag_update(C, snode);
|
snode_dag_update(C, snode);
|
||||||
}
|
}
|
||||||
|
@ -1126,6 +1126,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
|
|||||||
|
|
||||||
if (mask) {
|
if (mask) {
|
||||||
int width, height;
|
int width, height;
|
||||||
|
float aspx = 1.0f, aspy = 1.0f;
|
||||||
// ED_mask_get_size(C, &width, &height);
|
// ED_mask_get_size(C, &width, &height);
|
||||||
|
|
||||||
//Scene *scene = CTX_data_scene(C);
|
//Scene *scene = CTX_data_scene(C);
|
||||||
@ -1135,6 +1136,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
|
|||||||
ED_mask_draw_region(mask, ar,
|
ED_mask_draw_region(mask, ar,
|
||||||
0, 0, /* TODO */
|
0, 0, /* TODO */
|
||||||
width, height,
|
width, height,
|
||||||
|
aspx, aspy,
|
||||||
FALSE, TRUE,
|
FALSE, TRUE,
|
||||||
NULL, C);
|
NULL, C);
|
||||||
}
|
}
|
||||||
|
@ -1141,12 +1141,16 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
|
|||||||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||||
if ((seq->flag & SEQ_LOCK) == 0) {
|
if ((seq->flag & SEQ_LOCK) == 0) {
|
||||||
if (selected) { /* mute unselected */
|
if (selected) { /* mute unselected */
|
||||||
if (seq->flag & SELECT)
|
if (seq->flag & SELECT) {
|
||||||
seq->flag |= SEQ_MUTE;
|
seq->flag |= SEQ_MUTE;
|
||||||
|
BKE_sequence_invalidate_deendent(scene, seq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((seq->flag & SELECT) == 0)
|
if ((seq->flag & SELECT) == 0) {
|
||||||
seq->flag |= SEQ_MUTE;
|
seq->flag |= SEQ_MUTE;
|
||||||
|
BKE_sequence_invalidate_deendent(scene, seq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1188,12 +1192,16 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
|
|||||||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||||
if ((seq->flag & SEQ_LOCK) == 0) {
|
if ((seq->flag & SEQ_LOCK) == 0) {
|
||||||
if (selected) { /* unmute unselected */
|
if (selected) { /* unmute unselected */
|
||||||
if (seq->flag & SELECT)
|
if (seq->flag & SELECT) {
|
||||||
seq->flag &= ~SEQ_MUTE;
|
seq->flag &= ~SEQ_MUTE;
|
||||||
|
BKE_sequence_invalidate_deendent(scene, seq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((seq->flag & SELECT) == 0)
|
if ((seq->flag & SELECT) == 0) {
|
||||||
seq->flag &= ~SEQ_MUTE;
|
seq->flag &= ~SEQ_MUTE;
|
||||||
|
BKE_sequence_invalidate_deendent(scene, seq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
#include "BKE_particle.h"
|
#include "BKE_particle.h"
|
||||||
#include "BKE_pointcache.h"
|
#include "BKE_pointcache.h"
|
||||||
#include "BKE_unit.h"
|
#include "BKE_unit.h"
|
||||||
|
#include "BKE_mask.h"
|
||||||
|
|
||||||
#include "ED_image.h"
|
#include "ED_image.h"
|
||||||
#include "ED_keyframing.h"
|
#include "ED_keyframing.h"
|
||||||
@ -228,9 +229,27 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2])
|
|||||||
project_int_noclip(t->ar, vec, adr);
|
project_int_noclip(t->ar, vec, adr);
|
||||||
}
|
}
|
||||||
else if (t->spacetype == SPACE_IMAGE) {
|
else if (t->spacetype == SPACE_IMAGE) {
|
||||||
|
SpaceImage *sima = t->sa->spacedata.first;
|
||||||
|
|
||||||
if (t->options & CTX_MASK) {
|
if (t->options & CTX_MASK) {
|
||||||
|
/* not working quite right, TODO (see below too) */
|
||||||
|
float aspx, aspy;
|
||||||
float v[2];
|
float v[2];
|
||||||
ED_mask_point_pos__reverse(t->sa, t->ar, vec[0], vec[1], &v[0], &v[1]);
|
|
||||||
|
ED_space_image_get_aspect(sima, &aspx, &aspy);
|
||||||
|
|
||||||
|
copy_v2_v2(v, vec);
|
||||||
|
|
||||||
|
v[0] = v[0] / aspx;
|
||||||
|
v[1] = v[1] / aspy;
|
||||||
|
|
||||||
|
BKE_mask_coord_to_image(sima->image, &sima->iuser, v, v);
|
||||||
|
|
||||||
|
v[0] = v[0] / aspx;
|
||||||
|
v[1] = v[1] / aspy;
|
||||||
|
|
||||||
|
ED_image_point_pos__reverse(sima, t->ar, v, v);
|
||||||
|
|
||||||
adr[0] = v[0];
|
adr[0] = v[0];
|
||||||
adr[1] = v[1];
|
adr[1] = v[1];
|
||||||
}
|
}
|
||||||
@ -278,23 +297,41 @@ void projectIntView(TransInfo *t, const float vec[3], int adr[2])
|
|||||||
adr[1] = out[1];
|
adr[1] = out[1];
|
||||||
}
|
}
|
||||||
else if (t->spacetype == SPACE_CLIP) {
|
else if (t->spacetype == SPACE_CLIP) {
|
||||||
float v[2];
|
SpaceClip *sc = t->sa->spacedata.first;
|
||||||
float aspx = 1.0f, aspy = 1.0f;
|
|
||||||
|
|
||||||
copy_v2_v2(v, vec);
|
if (t->options & CTX_MASK) {
|
||||||
|
/* not working quite right, TODO (see above too) */
|
||||||
|
float aspx, aspy;
|
||||||
|
float v[2];
|
||||||
|
|
||||||
if (t->options & CTX_MOVIECLIP) {
|
ED_space_clip_get_aspect(sc, &aspx, &aspy);
|
||||||
|
|
||||||
|
copy_v2_v2(v, vec);
|
||||||
|
|
||||||
|
v[0] = v[0] / aspx;
|
||||||
|
v[1] = v[1] / aspy;
|
||||||
|
|
||||||
|
BKE_mask_coord_to_movieclip(sc->clip, &sc->user, v, v);
|
||||||
|
|
||||||
|
v[0] = v[0] / aspx;
|
||||||
|
v[1] = v[1] / aspy;
|
||||||
|
|
||||||
|
ED_clip_point_stable_pos__reverse(sc, t->ar, v, v);
|
||||||
|
|
||||||
|
adr[0] = v[0];
|
||||||
|
adr[1] = v[1];
|
||||||
|
}
|
||||||
|
else if (t->options & CTX_MOVIECLIP) {
|
||||||
|
float v[2], aspx, aspy;
|
||||||
|
|
||||||
|
copy_v2_v2(v, vec);
|
||||||
ED_space_clip_get_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy);
|
ED_space_clip_get_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy);
|
||||||
}
|
|
||||||
else if (t->options & CTX_MASK) {
|
|
||||||
/* MASKTODO - not working as expected */
|
|
||||||
ED_space_clip_get_aspect(t->sa->spacedata.first, &aspx, &aspy);
|
|
||||||
}
|
|
||||||
|
|
||||||
v[0] /= aspx;
|
v[0] /= aspx;
|
||||||
v[1] /= aspy;
|
v[1] /= aspy;
|
||||||
|
|
||||||
UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr + 1);
|
UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (t->spacetype == SPACE_NODE) {
|
else if (t->spacetype == SPACE_NODE) {
|
||||||
UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], adr, adr + 1);
|
UI_view2d_to_region_no_clip((View2D *)t->view, vec[0], vec[1], adr, adr + 1);
|
||||||
|
@ -992,6 +992,9 @@ static void createTransPose(TransInfo *t, Object *ob)
|
|||||||
t->flag |= T_POSE;
|
t->flag |= T_POSE;
|
||||||
t->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */
|
t->poseobj = ob; /* we also allow non-active objects to be transformed, in weightpaint */
|
||||||
|
|
||||||
|
/* disable PET, its not usable in pose mode yet [#32444] */
|
||||||
|
t->flag &= ~(T_PROP_EDIT | T_PROP_CONNECTED);
|
||||||
|
|
||||||
/* init trans data */
|
/* init trans data */
|
||||||
td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransPoseBone");
|
td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransPoseBone");
|
||||||
tdx = t->ext = MEM_callocN(t->total * sizeof(TransDataExtension), "TransPoseBoneExt");
|
tdx = t->ext = MEM_callocN(t->total * sizeof(TransDataExtension), "TransPoseBoneExt");
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "DNA_armature_types.h"
|
#include "DNA_armature_types.h"
|
||||||
#include "DNA_lattice_types.h"
|
#include "DNA_lattice_types.h"
|
||||||
#include "DNA_screen_types.h"
|
#include "DNA_screen_types.h"
|
||||||
|
#include "DNA_sequence_types.h"
|
||||||
#include "DNA_space_types.h"
|
#include "DNA_space_types.h"
|
||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
#include "DNA_object_types.h"
|
#include "DNA_object_types.h"
|
||||||
@ -894,6 +895,17 @@ static void recalcData_view3d(TransInfo *t)
|
|||||||
/* helper for recalcData() - for sequencer transforms */
|
/* helper for recalcData() - for sequencer transforms */
|
||||||
static void recalcData_sequencer(TransInfo *t)
|
static void recalcData_sequencer(TransInfo *t)
|
||||||
{
|
{
|
||||||
|
Editing *ed = BKE_sequencer_editing_get(t->scene, FALSE);
|
||||||
|
Sequence *seq;
|
||||||
|
|
||||||
|
SEQ_BEGIN(ed, seq)
|
||||||
|
{
|
||||||
|
if (seq->flag & SELECT) {
|
||||||
|
BKE_sequence_invalidate_deendent(t->scene, seq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SEQ_END
|
||||||
|
|
||||||
BKE_sequencer_preprocessed_cache_cleanup();
|
BKE_sequencer_preprocessed_cache_cleanup();
|
||||||
|
|
||||||
flushTransSeq(t);
|
flushTransSeq(t);
|
||||||
|
@ -107,8 +107,7 @@ void ED_undo_push(bContext *C, const char *str)
|
|||||||
PE_undo_push(CTX_data_scene(C), str);
|
PE_undo_push(CTX_data_scene(C), str);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (U.uiflag & USER_GLOBALUNDO)
|
BKE_write_undo(C, str);
|
||||||
BKE_write_undo(C, str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wm->file_saved) {
|
if (wm->file_saved) {
|
||||||
|
@ -201,7 +201,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
|
|||||||
float aspx, aspy;
|
float aspx, aspy;
|
||||||
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
|
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
|
||||||
|
|
||||||
ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy);
|
ED_image_get_uv_aspect(tf->tpage, NULL, &aspx, &aspy);
|
||||||
|
|
||||||
if (aspx != aspy)
|
if (aspx != aspy)
|
||||||
param_aspect_ratio(handle, aspx, aspy);
|
param_aspect_ratio(handle, aspx, aspy);
|
||||||
@ -393,7 +393,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, BMEditMesh *e
|
|||||||
float aspx, aspy;
|
float aspx, aspy;
|
||||||
tf = CustomData_bmesh_get(&em->bm->pdata, editFace->head.data, CD_MTEXPOLY);
|
tf = CustomData_bmesh_get(&em->bm->pdata, editFace->head.data, CD_MTEXPOLY);
|
||||||
|
|
||||||
ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy);
|
ED_image_get_uv_aspect(tf->tpage, NULL, &aspx, &aspy);
|
||||||
|
|
||||||
if (aspx != aspy)
|
if (aspx != aspy)
|
||||||
param_aspect_ratio(handle, aspx, aspy);
|
param_aspect_ratio(handle, aspx, aspy);
|
||||||
@ -1021,7 +1021,7 @@ static void correct_uv_aspect(BMEditMesh *em)
|
|||||||
MTexPoly *tf;
|
MTexPoly *tf;
|
||||||
|
|
||||||
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
|
tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);
|
||||||
ED_image_get_uv_aspect(tf->tpage, &aspx, &aspy);
|
ED_image_get_uv_aspect(tf->tpage, NULL, &aspx, &aspy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aspx == aspy)
|
if (aspx == aspy)
|
||||||
|
@ -133,11 +133,11 @@ typedef struct RegionView3D {
|
|||||||
short rflag;
|
short rflag;
|
||||||
|
|
||||||
|
|
||||||
/* last view */
|
/* last view (use when switching out of camera view) */
|
||||||
float lviewquat[4];
|
float lviewquat[4];
|
||||||
short lpersp, lview; /* lpersp can never be set to 'RV3D_CAMOB' */
|
short lpersp, lview; /* lpersp can never be set to 'RV3D_CAMOB' */
|
||||||
|
|
||||||
float gridview;
|
float gridview;
|
||||||
|
|
||||||
float twangle[3];
|
float twangle[3];
|
||||||
|
|
||||||
|
|
||||||
|
@ -1659,8 +1659,9 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value)
|
|||||||
IDP_Int(idprop) = value;
|
IDP_Int(idprop) = value;
|
||||||
rna_idproperty_touch(idprop);
|
rna_idproperty_touch(idprop);
|
||||||
}
|
}
|
||||||
else if (bprop->set)
|
else if (bprop->set) {
|
||||||
bprop->set(ptr, value);
|
bprop->set(ptr, value);
|
||||||
|
}
|
||||||
else if (prop->flag & PROP_EDITABLE) {
|
else if (prop->flag & PROP_EDITABLE) {
|
||||||
IDPropertyTemplate val = {0};
|
IDPropertyTemplate val = {0};
|
||||||
IDProperty *group;
|
IDProperty *group;
|
||||||
|
@ -417,6 +417,11 @@ static void rna_def_mouse_sensor(BlenderRNA *brna)
|
|||||||
RNA_def_property_enum_items(prop, mouse_event_items);
|
RNA_def_property_enum_items(prop, mouse_event_items);
|
||||||
RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on");
|
RNA_def_property_ui_text(prop, "Mouse Event", "Type of event this mouse sensor should trigger on");
|
||||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "use_pulse", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_MOUSE_FOCUS_PULSE);
|
||||||
|
RNA_def_property_ui_text(prop, "Pulse", "Moving the mouse over a different object generates a pulse");
|
||||||
|
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_def_touch_sensor(BlenderRNA *brna)
|
static void rna_def_touch_sensor(BlenderRNA *brna)
|
||||||
|
@ -1541,7 +1541,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
|||||||
RNA_def_property_float_sdna(prop, NULL, "near");
|
RNA_def_property_float_sdna(prop, NULL, "near");
|
||||||
RNA_def_property_range(prop, 0.001f, FLT_MAX);
|
RNA_def_property_range(prop, 0.001f, FLT_MAX);
|
||||||
RNA_def_property_float_default(prop, 0.1f);
|
RNA_def_property_float_default(prop, 0.1f);
|
||||||
RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance");
|
RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance (perspective view only)");
|
||||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
|
prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
|
||||||
|
@ -3265,6 +3265,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
|
|||||||
RNA_def_property_enum_items(prop, compute_device_type_items);
|
RNA_def_property_enum_items(prop, compute_device_type_items);
|
||||||
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_compute_device_type_itemf");
|
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_compute_device_type_itemf");
|
||||||
RNA_def_property_ui_text(prop, "Compute Device Type", "Device to use for computation (rendering with Cycles)");
|
RNA_def_property_ui_text(prop, "Compute Device Type", "Device to use for computation (rendering with Cycles)");
|
||||||
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "compute_device", PROP_ENUM, PROP_NONE);
|
prop = RNA_def_property(srna, "compute_device", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
|
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
|
||||||
|
@ -105,6 +105,41 @@ static void foreachObjectLink(ModifierData *md, Object *ob,
|
|||||||
walk(userData, ob, &pimd->ob);
|
walk(userData, ob, &pimd->ob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *psys, int p)
|
||||||
|
{
|
||||||
|
ParticleData *pa;
|
||||||
|
|
||||||
|
if (pimd->flag & eParticleInstanceFlag_Parents) {
|
||||||
|
if (p >= psys->totpart) {
|
||||||
|
if (psys->part->childtype == PART_CHILD_PARTICLES) {
|
||||||
|
pa = psys->particles + (psys->child + p - psys->totpart)->parent;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pa = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pa = psys->particles + p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (psys->part->childtype == PART_CHILD_PARTICLES) {
|
||||||
|
pa = psys->particles + (psys->child + p)->parent;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pa = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pa) {
|
||||||
|
if (pa->alive == PARS_UNBORN && (pimd->flag & eParticleInstanceFlag_Unborn) == 0) return 1;
|
||||||
|
if (pa->alive == PARS_ALIVE && (pimd->flag & eParticleInstanceFlag_Alive) == 0) return 1;
|
||||||
|
if (pa->alive == PARS_DEAD && (pimd->flag & eParticleInstanceFlag_Dead) == 0) return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||||
DerivedMesh *derivedData,
|
DerivedMesh *derivedData,
|
||||||
ModifierApplyFlag UNUSED(flag))
|
ModifierApplyFlag UNUSED(flag))
|
||||||
@ -113,11 +148,13 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
|
ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *) md;
|
||||||
ParticleSimulationData sim;
|
ParticleSimulationData sim;
|
||||||
ParticleSystem *psys = NULL;
|
ParticleSystem *psys = NULL;
|
||||||
ParticleData *pa = NULL, *pars = NULL;
|
ParticleData *pa = NULL;
|
||||||
MPoly *mpoly, *orig_mpoly;
|
MPoly *mpoly, *orig_mpoly;
|
||||||
MLoop *mloop, *orig_mloop;
|
MLoop *mloop, *orig_mloop;
|
||||||
MVert *mvert, *orig_mvert;
|
MVert *mvert, *orig_mvert;
|
||||||
int i, totvert, totpoly, totloop, maxvert, maxpoly, maxloop, totpart = 0, first_particle = 0;
|
int totvert, totpoly, totloop /* , totedge */;
|
||||||
|
int maxvert, maxpoly, maxloop, totpart = 0, first_particle = 0;
|
||||||
|
int k, p, p_skip;
|
||||||
short track = ob->trackflag % 3, trackneg, axis = pimd->axis;
|
short track = ob->trackflag % 3, trackneg, axis = pimd->axis;
|
||||||
float max_co = 0.0, min_co = 0.0, temp_co[3], cross[3];
|
float max_co = 0.0, min_co = 0.0, temp_co[3], cross[3];
|
||||||
float *size = NULL;
|
float *size = NULL;
|
||||||
@ -153,7 +190,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
sim.psmd = psys_get_modifier(pimd->ob, psys);
|
sim.psmd = psys_get_modifier(pimd->ob, psys);
|
||||||
|
|
||||||
if (pimd->flag & eParticleInstanceFlag_UseSize) {
|
if (pimd->flag & eParticleInstanceFlag_UseSize) {
|
||||||
int p;
|
|
||||||
float *si;
|
float *si;
|
||||||
si = size = MEM_callocN(totpart * sizeof(float), "particle size array");
|
si = size = MEM_callocN(totpart * sizeof(float), "particle size array");
|
||||||
|
|
||||||
@ -171,15 +207,24 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pars = psys->particles;
|
|
||||||
|
|
||||||
totvert = dm->getNumVerts(dm);
|
totvert = dm->getNumVerts(dm);
|
||||||
totpoly = dm->getNumPolys(dm);
|
totpoly = dm->getNumPolys(dm);
|
||||||
totloop = dm->getNumLoops(dm);
|
totloop = dm->getNumLoops(dm);
|
||||||
|
/* totedge = dm->getNumEdges(dm); */ /* UNUSED */
|
||||||
|
|
||||||
maxvert = totvert * totpart;
|
/* count particles */
|
||||||
maxpoly = totpoly * totpart;
|
maxvert = 0;
|
||||||
maxloop = totloop * totpart;
|
maxpoly = 0;
|
||||||
|
maxloop = 0;
|
||||||
|
|
||||||
|
for (p = 0; p < totpart; p++) {
|
||||||
|
if (particle_skip(pimd, psys, p))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
maxvert += totvert;
|
||||||
|
maxpoly += totpoly;
|
||||||
|
maxloop += totloop;
|
||||||
|
}
|
||||||
|
|
||||||
psys->lattice = psys_get_lattice(&sim);
|
psys->lattice = psys_get_lattice(&sim);
|
||||||
|
|
||||||
@ -191,127 +236,110 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
max_co = max_r[track];
|
max_co = max_r[track];
|
||||||
}
|
}
|
||||||
|
|
||||||
result = CDDM_from_template(dm, maxvert, dm->getNumEdges(dm) * totpart, 0, maxloop, maxpoly);
|
result = CDDM_from_template(dm, maxvert, 0, 0, maxloop, maxpoly);
|
||||||
|
|
||||||
mvert = result->getVertArray(result);
|
mvert = result->getVertArray(result);
|
||||||
orig_mvert = dm->getVertArray(dm);
|
orig_mvert = dm->getVertArray(dm);
|
||||||
|
|
||||||
for (i = 0; i < maxvert; i++) {
|
|
||||||
MVert *inMV;
|
|
||||||
MVert *mv = mvert + i;
|
|
||||||
ParticleKey state;
|
|
||||||
|
|
||||||
inMV = orig_mvert + i % totvert;
|
|
||||||
DM_copy_vert_data(dm, result, i % totvert, i, 1);
|
|
||||||
*mv = *inMV;
|
|
||||||
|
|
||||||
/*change orientation based on object trackflag*/
|
|
||||||
copy_v3_v3(temp_co, mv->co);
|
|
||||||
mv->co[axis] = temp_co[track];
|
|
||||||
mv->co[(axis + 1) % 3] = temp_co[(track + 1) % 3];
|
|
||||||
mv->co[(axis + 2) % 3] = temp_co[(track + 2) % 3];
|
|
||||||
|
|
||||||
if ((psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) &&
|
|
||||||
(pimd->flag & eParticleInstanceFlag_Path))
|
|
||||||
{
|
|
||||||
float ran = 0.0f;
|
|
||||||
if (pimd->random_position != 0.0f) {
|
|
||||||
BLI_srandom(psys->seed + (i / totvert) % totpart);
|
|
||||||
ran = pimd->random_position * BLI_frand();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pimd->flag & eParticleInstanceFlag_KeepShape) {
|
|
||||||
state.time = pimd->position * (1.0f - ran);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
state.time = (mv->co[axis] - min_co) / (max_co - min_co) * pimd->position * (1.0f - ran);
|
|
||||||
|
|
||||||
if (trackneg)
|
|
||||||
state.time = 1.0f - state.time;
|
|
||||||
|
|
||||||
mv->co[axis] = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
psys_get_particle_on_path(&sim, first_particle + i / totvert, &state, 1);
|
|
||||||
|
|
||||||
normalize_v3(state.vel);
|
|
||||||
|
|
||||||
/* TODO: incremental rotations somehow */
|
|
||||||
if (state.vel[axis] < -0.9999f || state.vel[axis] > 0.9999f) {
|
|
||||||
unit_qt(state.rot);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
float temp[3] = {0.0f, 0.0f, 0.0f};
|
|
||||||
temp[axis] = 1.0f;
|
|
||||||
|
|
||||||
cross_v3_v3v3(cross, temp, state.vel);
|
|
||||||
|
|
||||||
/* state.vel[axis] is the only component surviving from a dot product with the axis */
|
|
||||||
axis_angle_to_quat(state.rot, cross, saacos(state.vel[axis]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
state.time = -1.0;
|
|
||||||
psys_get_particle_state(&sim, first_particle + i / totvert, &state, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
mul_qt_v3(state.rot, mv->co);
|
|
||||||
if (pimd->flag & eParticleInstanceFlag_UseSize)
|
|
||||||
mul_v3_fl(mv->co, size[i / totvert]);
|
|
||||||
add_v3_v3(mv->co, state.co);
|
|
||||||
}
|
|
||||||
|
|
||||||
mpoly = result->getPolyArray(result);
|
mpoly = result->getPolyArray(result);
|
||||||
orig_mpoly = dm->getPolyArray(dm);
|
orig_mpoly = dm->getPolyArray(dm);
|
||||||
mloop = result->getLoopArray(result);
|
mloop = result->getLoopArray(result);
|
||||||
orig_mloop = dm->getLoopArray(dm);
|
orig_mloop = dm->getLoopArray(dm);
|
||||||
|
|
||||||
for (i = 0; i < maxpoly; i++) {
|
for (p = 0, p_skip = 0; p < totpart; p++) {
|
||||||
MPoly *inMP = orig_mpoly + i % totpoly;
|
/* skip particle? */
|
||||||
MPoly *mp = mpoly + i;
|
if (particle_skip(pimd, psys, p))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (pimd->flag & eParticleInstanceFlag_Parents) {
|
/* set vertices coordinates */
|
||||||
if (i / totpoly >= psys->totpart) {
|
for (k = 0; k < totvert; k++) {
|
||||||
if (psys->part->childtype == PART_CHILD_PARTICLES) {
|
ParticleKey state;
|
||||||
pa = psys->particles + (psys->child + i / totpoly - psys->totpart)->parent;
|
MVert *inMV;
|
||||||
|
MVert *mv = mvert + p_skip * totvert + k;
|
||||||
|
|
||||||
|
inMV = orig_mvert + k;
|
||||||
|
DM_copy_vert_data(dm, result, k, p_skip * totvert + k, 1);
|
||||||
|
*mv = *inMV;
|
||||||
|
|
||||||
|
/*change orientation based on object trackflag*/
|
||||||
|
copy_v3_v3(temp_co, mv->co);
|
||||||
|
mv->co[axis] = temp_co[track];
|
||||||
|
mv->co[(axis + 1) % 3] = temp_co[(track + 1) % 3];
|
||||||
|
mv->co[(axis + 2) % 3] = temp_co[(track + 2) % 3];
|
||||||
|
|
||||||
|
/* get particle state */
|
||||||
|
if ((psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) &&
|
||||||
|
(pimd->flag & eParticleInstanceFlag_Path))
|
||||||
|
{
|
||||||
|
float ran = 0.0f;
|
||||||
|
if (pimd->random_position != 0.0f) {
|
||||||
|
BLI_srandom(psys->seed + p);
|
||||||
|
ran = pimd->random_position * BLI_frand();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pimd->flag & eParticleInstanceFlag_KeepShape) {
|
||||||
|
state.time = pimd->position * (1.0f - ran);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pa = NULL;
|
state.time = (mv->co[axis] - min_co) / (max_co - min_co) * pimd->position * (1.0f - ran);
|
||||||
|
|
||||||
|
if (trackneg)
|
||||||
|
state.time = 1.0f - state.time;
|
||||||
|
|
||||||
|
mv->co[axis] = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
psys_get_particle_on_path(&sim, first_particle + p, &state, 1);
|
||||||
|
|
||||||
|
normalize_v3(state.vel);
|
||||||
|
|
||||||
|
/* TODO: incremental rotations somehow */
|
||||||
|
if (state.vel[axis] < -0.9999f || state.vel[axis] > 0.9999f) {
|
||||||
|
unit_qt(state.rot);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
float temp[3] = {0.0f, 0.0f, 0.0f};
|
||||||
|
temp[axis] = 1.0f;
|
||||||
|
|
||||||
|
cross_v3_v3v3(cross, temp, state.vel);
|
||||||
|
|
||||||
|
/* state.vel[axis] is the only component surviving from a dot product with the axis */
|
||||||
|
axis_angle_to_quat(state.rot, cross, saacos(state.vel[axis]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pa = pars + i / totpoly;
|
state.time = -1.0;
|
||||||
|
psys_get_particle_state(&sim, first_particle + p, &state, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mul_qt_v3(state.rot, mv->co);
|
||||||
|
if (pimd->flag & eParticleInstanceFlag_UseSize)
|
||||||
|
mul_v3_fl(mv->co, size[p]);
|
||||||
|
add_v3_v3(mv->co, state.co);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (psys->part->childtype == PART_CHILD_PARTICLES) {
|
/* create polys and loops */
|
||||||
pa = psys->particles + (psys->child + i / totpoly)->parent;
|
for (k = 0; k < totpoly; k++) {
|
||||||
}
|
MPoly *inMP = orig_mpoly + k;
|
||||||
else {
|
MPoly *mp = mpoly + p_skip * totpoly + k;
|
||||||
pa = NULL;
|
|
||||||
|
DM_copy_poly_data(dm, result, k, p_skip * totpoly + k, 1);
|
||||||
|
*mp = *inMP;
|
||||||
|
mp->loopstart += p_skip * totloop;
|
||||||
|
|
||||||
|
{
|
||||||
|
MLoop *inML = orig_mloop + inMP->loopstart;
|
||||||
|
MLoop *ml = mloop + mp->loopstart;
|
||||||
|
int j = mp->totloop;
|
||||||
|
|
||||||
|
DM_copy_loop_data(dm, result, inMP->loopstart, mp->loopstart, j);
|
||||||
|
for (; j; j--, ml++, inML++) {
|
||||||
|
ml->v = inML->v + (p_skip * totvert);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pa) {
|
p_skip++;
|
||||||
if (pa->alive == PARS_UNBORN && (pimd->flag & eParticleInstanceFlag_Unborn) == 0) continue;
|
|
||||||
if (pa->alive == PARS_ALIVE && (pimd->flag & eParticleInstanceFlag_Alive) == 0) continue;
|
|
||||||
if (pa->alive == PARS_DEAD && (pimd->flag & eParticleInstanceFlag_Dead) == 0) continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
DM_copy_poly_data(dm, result, i % totpoly, i, 1);
|
|
||||||
*mp = *inMP;
|
|
||||||
mp->loopstart += (i / totpoly) * totloop;
|
|
||||||
|
|
||||||
{
|
|
||||||
MLoop *inML = orig_mloop + inMP->loopstart;
|
|
||||||
MLoop *ml = mloop + mp->loopstart;
|
|
||||||
int j = mp->totloop;
|
|
||||||
|
|
||||||
DM_copy_loop_data(dm, result, inMP->loopstart, mp->loopstart, j);
|
|
||||||
for (; j; j--, ml++, inML++) {
|
|
||||||
ml->v = inML->v + ((i / totpoly) * totvert);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CDDM_calc_edges(result);
|
CDDM_calc_edges(result);
|
||||||
|
@ -857,7 +857,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
|
|
||||||
mp_new->loopstart = mpoly_index * 4;
|
mp_new->loopstart = mpoly_index * 4;
|
||||||
mp_new->totloop = 4;
|
mp_new->totloop = 4;
|
||||||
mp_new->flag = ME_SMOOTH;
|
mp_new->flag = mpoly_flag;
|
||||||
origindex[mpoly_index] = ORIGINDEX_NONE;
|
origindex[mpoly_index] = ORIGINDEX_NONE;
|
||||||
mp_new++;
|
mp_new++;
|
||||||
ml_new += 4;
|
ml_new += 4;
|
||||||
|
@ -1054,6 +1054,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex
|
|||||||
|
|
||||||
if ((ibuf == NULL) || ((ibuf->rect == NULL) && (ibuf->rect_float == NULL))) return retval;
|
if ((ibuf == NULL) || ((ibuf->rect == NULL) && (ibuf->rect_float == NULL))) return retval;
|
||||||
|
|
||||||
|
ima->flag |= IMA_USED_FOR_RENDER;
|
||||||
|
|
||||||
/* mipmap test */
|
/* mipmap test */
|
||||||
image_mipmap_test(tex, ibuf);
|
image_mipmap_test(tex, ibuf);
|
||||||
|
|
||||||
|
@ -326,7 +326,11 @@ static void build_pict_list(char *first, int totframes, int fstep, int fontid)
|
|||||||
int file;
|
int file;
|
||||||
|
|
||||||
file = open(filepath, O_BINARY | O_RDONLY, 0);
|
file = open(filepath, O_BINARY | O_RDONLY, 0);
|
||||||
if (file < 0) return;
|
if (file < 0) {
|
||||||
|
/* print errno? */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
picture = (PlayAnimPict *)MEM_callocN(sizeof(PlayAnimPict), "picture");
|
picture = (PlayAnimPict *)MEM_callocN(sizeof(PlayAnimPict), "picture");
|
||||||
if (picture == NULL) {
|
if (picture == NULL) {
|
||||||
printf("Not enough memory for pict struct '%s'\n", filepath);
|
printf("Not enough memory for pict struct '%s'\n", filepath);
|
||||||
@ -700,11 +704,11 @@ void playanim_window_open(const char *title, int posx, int posy, int sizex, int
|
|||||||
inital_state = start_maximized ? GHOST_kWindowStateMaximized : GHOST_kWindowStateNormal;
|
inital_state = start_maximized ? GHOST_kWindowStateMaximized : GHOST_kWindowStateNormal;
|
||||||
|
|
||||||
g_WS.ghost_window = GHOST_CreateWindow(g_WS.ghost_system,
|
g_WS.ghost_window = GHOST_CreateWindow(g_WS.ghost_system,
|
||||||
title,
|
title,
|
||||||
posx, posy, sizex, sizey,
|
posx, posy, sizex, sizey,
|
||||||
inital_state,
|
inital_state,
|
||||||
GHOST_kDrawingContextTypeOpenGL,
|
GHOST_kDrawingContextTypeOpenGL,
|
||||||
FALSE /* no stereo */, FALSE);
|
FALSE /* no stereo */, FALSE);
|
||||||
|
|
||||||
//if (ghostwin) {
|
//if (ghostwin) {
|
||||||
//if (win) {
|
//if (win) {
|
||||||
|
@ -1727,11 +1727,6 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to)
|
|||||||
brick->Replace_IScene(to);
|
brick->Replace_IScene(to);
|
||||||
brick->Replace_NetworkScene(to->GetNetworkScene());
|
brick->Replace_NetworkScene(to->GetNetworkScene());
|
||||||
|
|
||||||
SCA_ISensor *sensor= dynamic_cast<class SCA_ISensor *>(brick);
|
|
||||||
if (sensor) {
|
|
||||||
sensor->Replace_EventManager(logicmgr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* near sensors have physics controllers */
|
/* near sensors have physics controllers */
|
||||||
#ifdef USE_BULLET
|
#ifdef USE_BULLET
|
||||||
KX_TouchSensor *touch_sensor = dynamic_cast<class KX_TouchSensor *>(brick);
|
KX_TouchSensor *touch_sensor = dynamic_cast<class KX_TouchSensor *>(brick);
|
||||||
@ -1739,6 +1734,14 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to)
|
|||||||
touch_sensor->GetPhysicsController()->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
|
touch_sensor->GetPhysicsController()->SetPhysicsEnvironment(to->GetPhysicsEnvironment());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// If we end up replacing a KX_TouchEventManager, we need to make sure
|
||||||
|
// physics controllers are properly in place. In other words, do this
|
||||||
|
// after merging physics controllers!
|
||||||
|
SCA_ISensor *sensor= dynamic_cast<class SCA_ISensor *>(brick);
|
||||||
|
if (sensor) {
|
||||||
|
sensor->Replace_EventManager(logicmgr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_BULLET
|
#ifdef USE_BULLET
|
||||||
|
70
source/tests/bl_rna_wiki_reference.py
Normal file
70
source/tests/bl_rna_wiki_reference.py
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
# ##### 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 #####
|
||||||
|
|
||||||
|
# <pep8 compliant>
|
||||||
|
|
||||||
|
# Use for validating our wiki interlinking.
|
||||||
|
# ./blender.bin --background -noaudio --python source/tests/bl_rna_wiki_reference.py
|
||||||
|
#
|
||||||
|
# 1) test_lookup_coverage() -- ensure that we have lookups for _every_ RNA path
|
||||||
|
# 2) test_urls() -- ensure all the URL's are correct
|
||||||
|
# 3) test_language_coverage() -- ensure language lookup table is complete
|
||||||
|
#
|
||||||
|
|
||||||
|
import bpy
|
||||||
|
|
||||||
|
# a stripped down version of api_dump() in rna_info_dump.py
|
||||||
|
|
||||||
|
|
||||||
|
def test_lookup_coverage():
|
||||||
|
|
||||||
|
def rna_ids():
|
||||||
|
|
||||||
|
import rna_info
|
||||||
|
struct = rna_info.BuildRNAInfo()[0]
|
||||||
|
for struct_id, v in sorted(struct.items()):
|
||||||
|
props = [(prop.identifier, prop) for prop in v.properties]
|
||||||
|
for prop_id, prop in props:
|
||||||
|
yield "bpy.types.%s.%s" % (struct_id[1], prop_id)
|
||||||
|
|
||||||
|
for submod_id in dir(bpy.ops):
|
||||||
|
for op_id in dir(getattr(bpy.ops, submod_id)):
|
||||||
|
yield "bpy.ops.%s.%s" % (submod_id, op_id)
|
||||||
|
|
||||||
|
# check coverage
|
||||||
|
from bl_operators import wm
|
||||||
|
|
||||||
|
for rna_id in rna_ids():
|
||||||
|
url = wm.WM_OT_doc_view_manual._lookup_rna_url(rna_id, verbose=False)
|
||||||
|
print(rna_id, "->", url)
|
||||||
|
|
||||||
|
|
||||||
|
def test_urls():
|
||||||
|
pass # TODO
|
||||||
|
|
||||||
|
|
||||||
|
def test_language_coverage():
|
||||||
|
pass # TODO
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
test_lookup_coverage()
|
||||||
|
test_language_coverage()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -19,7 +19,7 @@
|
|||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
|
|
||||||
# Used for generating API diff's between releases
|
# Used for generating API diff's between releases
|
||||||
# ./blender.bin --background -noaudio --python release/test/rna_info_dump.py
|
# ./blender.bin --background -noaudio --python source/tests/rna_info_dump.py
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user