Merge branch 'master' into blender2.8
This commit is contained in:
@@ -121,8 +121,7 @@ void BlenderSession::create()
|
|||||||
void BlenderSession::create_session()
|
void BlenderSession::create_session()
|
||||||
{
|
{
|
||||||
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
|
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
|
||||||
bool is_cpu = session_params.device.type == DEVICE_CPU;
|
SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
|
||||||
SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background, is_cpu);
|
|
||||||
bool session_pause = BlenderSync::get_session_pause(b_scene, background);
|
bool session_pause = BlenderSync::get_session_pause(b_scene, background);
|
||||||
|
|
||||||
/* reset status/progress */
|
/* reset status/progress */
|
||||||
@@ -147,7 +146,7 @@ void BlenderSession::create_session()
|
|||||||
session->set_pause(session_pause);
|
session->set_pause(session_pause);
|
||||||
|
|
||||||
/* create sync */
|
/* create sync */
|
||||||
sync = new BlenderSync(b_engine, b_data, b_depsgraph, b_scene, scene, !background, session->progress, is_cpu);
|
sync = new BlenderSync(b_engine, b_data, b_depsgraph, b_scene, scene, !background, session->progress);
|
||||||
BL::Object b_camera_override(b_engine.camera_override());
|
BL::Object b_camera_override(b_engine.camera_override());
|
||||||
if(b_v3d) {
|
if(b_v3d) {
|
||||||
if(session_pause == false) {
|
if(session_pause == false) {
|
||||||
@@ -185,8 +184,7 @@ void BlenderSession::reset_session(BL::BlendData& b_data_, BL::Scene& b_scene_)
|
|||||||
b_scene = b_scene_;
|
b_scene = b_scene_;
|
||||||
|
|
||||||
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
|
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
|
||||||
const bool is_cpu = session_params.device.type == DEVICE_CPU;
|
SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
|
||||||
SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background, is_cpu);
|
|
||||||
|
|
||||||
width = render_resolution_x(b_render);
|
width = render_resolution_x(b_render);
|
||||||
height = render_resolution_y(b_render);
|
height = render_resolution_y(b_render);
|
||||||
@@ -217,7 +215,7 @@ void BlenderSession::reset_session(BL::BlendData& b_data_, BL::Scene& b_scene_)
|
|||||||
session->stats.mem_peak = session->stats.mem_used;
|
session->stats.mem_peak = session->stats.mem_used;
|
||||||
|
|
||||||
/* sync object should be re-created */
|
/* sync object should be re-created */
|
||||||
sync = new BlenderSync(b_engine, b_data, b_depsgraph, b_scene, scene, !background, session->progress, is_cpu);
|
sync = new BlenderSync(b_engine, b_data, b_depsgraph, b_scene, scene, !background, session->progress);
|
||||||
|
|
||||||
/* for final render we will do full data sync per render layer, only
|
/* for final render we will do full data sync per render layer, only
|
||||||
* do some basic syncing here, no objects or materials for speed */
|
* do some basic syncing here, no objects or materials for speed */
|
||||||
@@ -742,8 +740,7 @@ void BlenderSession::synchronize()
|
|||||||
|
|
||||||
/* on session/scene parameter changes, we recreate session entirely */
|
/* on session/scene parameter changes, we recreate session entirely */
|
||||||
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
|
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
|
||||||
const bool is_cpu = session_params.device.type == DEVICE_CPU;
|
SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background);
|
||||||
SceneParams scene_params = BlenderSync::get_scene_params(b_scene, background, is_cpu);
|
|
||||||
bool session_pause = BlenderSync::get_session_pause(b_scene, background);
|
bool session_pause = BlenderSync::get_session_pause(b_scene, background);
|
||||||
|
|
||||||
if(session->params.modified(session_params) ||
|
if(session->params.modified(session_params) ||
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ BlenderSync::BlenderSync(BL::RenderEngine& b_engine,
|
|||||||
BL::Scene& b_scene,
|
BL::Scene& b_scene,
|
||||||
Scene *scene,
|
Scene *scene,
|
||||||
bool preview,
|
bool preview,
|
||||||
Progress &progress,
|
Progress &progress)
|
||||||
bool is_cpu)
|
|
||||||
: b_engine(b_engine),
|
: b_engine(b_engine),
|
||||||
b_data(b_data),
|
b_data(b_data),
|
||||||
b_depsgraph(b_depsgraph),
|
b_depsgraph(b_depsgraph),
|
||||||
@@ -65,7 +64,6 @@ BlenderSync::BlenderSync(BL::RenderEngine& b_engine,
|
|||||||
scene(scene),
|
scene(scene),
|
||||||
preview(preview),
|
preview(preview),
|
||||||
experimental(false),
|
experimental(false),
|
||||||
is_cpu(is_cpu),
|
|
||||||
dicing_rate(1.0f),
|
dicing_rate(1.0f),
|
||||||
max_subdivisions(12),
|
max_subdivisions(12),
|
||||||
progress(progress)
|
progress(progress)
|
||||||
@@ -598,8 +596,7 @@ array<Pass> BlenderSync::sync_render_passes(BL::RenderLayer& b_rlay,
|
|||||||
/* Scene Parameters */
|
/* Scene Parameters */
|
||||||
|
|
||||||
SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene,
|
SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene,
|
||||||
bool background,
|
bool background)
|
||||||
bool is_cpu)
|
|
||||||
{
|
{
|
||||||
BL::RenderSettings r = b_scene.render();
|
BL::RenderSettings r = b_scene.render();
|
||||||
SceneParams params;
|
SceneParams params;
|
||||||
@@ -639,15 +636,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene,
|
|||||||
params.texture_limit = 0;
|
params.texture_limit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86)))
|
params.use_qbvh = DebugFlags().cpu.qbvh;
|
||||||
if(is_cpu) {
|
|
||||||
params.use_qbvh = DebugFlags().cpu.qbvh && system_cpu_support_sse2();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
params.use_qbvh = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,7 @@ public:
|
|||||||
BL::Scene& b_scene,
|
BL::Scene& b_scene,
|
||||||
Scene *scene,
|
Scene *scene,
|
||||||
bool preview,
|
bool preview,
|
||||||
Progress &progress,
|
Progress &progress);
|
||||||
bool is_cpu);
|
|
||||||
~BlenderSync();
|
~BlenderSync();
|
||||||
|
|
||||||
/* sync */
|
/* sync */
|
||||||
@@ -85,8 +84,7 @@ public:
|
|||||||
|
|
||||||
/* get parameters */
|
/* get parameters */
|
||||||
static SceneParams get_scene_params(BL::Scene& b_scene,
|
static SceneParams get_scene_params(BL::Scene& b_scene,
|
||||||
bool background,
|
bool background);
|
||||||
bool is_cpu);
|
|
||||||
static SessionParams get_session_params(BL::RenderEngine& b_engine,
|
static SessionParams get_session_params(BL::RenderEngine& b_engine,
|
||||||
BL::UserPreferences& b_userpref,
|
BL::UserPreferences& b_userpref,
|
||||||
BL::Scene& b_scene,
|
BL::Scene& b_scene,
|
||||||
@@ -182,7 +180,6 @@ private:
|
|||||||
Scene *scene;
|
Scene *scene;
|
||||||
bool preview;
|
bool preview;
|
||||||
bool experimental;
|
bool experimental;
|
||||||
bool is_cpu;
|
|
||||||
|
|
||||||
float dicing_rate;
|
float dicing_rate;
|
||||||
int max_subdivisions;
|
int max_subdivisions;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ CCL_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
bool Device::need_types_update = true;
|
bool Device::need_types_update = true;
|
||||||
bool Device::need_devices_update = true;
|
bool Device::need_devices_update = true;
|
||||||
|
thread_mutex Device::device_mutex;
|
||||||
vector<DeviceType> Device::types;
|
vector<DeviceType> Device::types;
|
||||||
vector<DeviceInfo> Device::devices;
|
vector<DeviceInfo> Device::devices;
|
||||||
|
|
||||||
@@ -443,53 +444,49 @@ string Device::string_from_type(DeviceType type)
|
|||||||
|
|
||||||
vector<DeviceType>& Device::available_types()
|
vector<DeviceType>& Device::available_types()
|
||||||
{
|
{
|
||||||
|
thread_scoped_lock lock(device_mutex);
|
||||||
if(need_types_update) {
|
if(need_types_update) {
|
||||||
types.clear();
|
types.clear();
|
||||||
types.push_back(DEVICE_CPU);
|
types.push_back(DEVICE_CPU);
|
||||||
|
|
||||||
#ifdef WITH_CUDA
|
#ifdef WITH_CUDA
|
||||||
if(device_cuda_init())
|
if(device_cuda_init()) {
|
||||||
types.push_back(DEVICE_CUDA);
|
types.push_back(DEVICE_CUDA);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_OPENCL
|
#ifdef WITH_OPENCL
|
||||||
if(device_opencl_init())
|
if(device_opencl_init()) {
|
||||||
types.push_back(DEVICE_OPENCL);
|
types.push_back(DEVICE_OPENCL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_NETWORK
|
#ifdef WITH_NETWORK
|
||||||
types.push_back(DEVICE_NETWORK);
|
types.push_back(DEVICE_NETWORK);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
need_types_update = false;
|
need_types_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<DeviceInfo>& Device::available_devices()
|
vector<DeviceInfo>& Device::available_devices()
|
||||||
{
|
{
|
||||||
|
thread_scoped_lock lock(device_mutex);
|
||||||
if(need_devices_update) {
|
if(need_devices_update) {
|
||||||
devices.clear();
|
devices.clear();
|
||||||
#ifdef WITH_CUDA
|
|
||||||
if(device_cuda_init())
|
|
||||||
device_cuda_info(devices);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_OPENCL
|
#ifdef WITH_OPENCL
|
||||||
if(device_opencl_init())
|
if(device_opencl_init()) {
|
||||||
device_opencl_info(devices);
|
device_opencl_info(devices);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef WITH_CUDA
|
||||||
|
if(device_cuda_init()) {
|
||||||
|
device_cuda_info(devices);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
device_cpu_info(devices);
|
device_cpu_info(devices);
|
||||||
|
|
||||||
#ifdef WITH_NETWORK
|
#ifdef WITH_NETWORK
|
||||||
device_network_info(devices);
|
device_network_info(devices);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
need_devices_update = false;
|
need_devices_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,12 +494,6 @@ string Device::device_capabilities()
|
|||||||
{
|
{
|
||||||
string capabilities = "CPU device capabilities: ";
|
string capabilities = "CPU device capabilities: ";
|
||||||
capabilities += device_cpu_capabilities() + "\n";
|
capabilities += device_cpu_capabilities() + "\n";
|
||||||
#ifdef WITH_CUDA
|
|
||||||
if(device_cuda_init()) {
|
|
||||||
capabilities += "\nCUDA device capabilities:\n";
|
|
||||||
capabilities += device_cuda_capabilities();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_OPENCL
|
#ifdef WITH_OPENCL
|
||||||
if(device_opencl_init()) {
|
if(device_opencl_init()) {
|
||||||
@@ -511,6 +502,13 @@ string Device::device_capabilities()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WITH_CUDA
|
||||||
|
if(device_cuda_init()) {
|
||||||
|
capabilities += "\nCUDA device capabilities:\n";
|
||||||
|
capabilities += device_cuda_capabilities();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return capabilities;
|
return capabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,10 +524,14 @@ DeviceInfo Device::get_multi_device(vector<DeviceInfo> subdevices)
|
|||||||
info.num = 0;
|
info.num = 0;
|
||||||
|
|
||||||
info.has_bindless_textures = true;
|
info.has_bindless_textures = true;
|
||||||
|
info.has_volume_decoupled = true;
|
||||||
|
info.has_qbvh = true;
|
||||||
foreach(DeviceInfo &device, subdevices) {
|
foreach(DeviceInfo &device, subdevices) {
|
||||||
assert(device.type == info.multi_devices[0].type);
|
assert(device.type == info.multi_devices[0].type);
|
||||||
|
|
||||||
info.has_bindless_textures &= device.has_bindless_textures;
|
info.has_bindless_textures &= device.has_bindless_textures;
|
||||||
|
info.has_volume_decoupled &= device.has_volume_decoupled;
|
||||||
|
info.has_qbvh &= device.has_qbvh;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public:
|
|||||||
bool display_device;
|
bool display_device;
|
||||||
bool advanced_shading;
|
bool advanced_shading;
|
||||||
bool has_bindless_textures; /* flag for GPU and Multi device */
|
bool has_bindless_textures; /* flag for GPU and Multi device */
|
||||||
|
bool has_volume_decoupled;
|
||||||
|
bool has_qbvh;
|
||||||
bool use_split_kernel; /* Denotes if the device is going to run cycles using split-kernel */
|
bool use_split_kernel; /* Denotes if the device is going to run cycles using split-kernel */
|
||||||
vector<DeviceInfo> multi_devices;
|
vector<DeviceInfo> multi_devices;
|
||||||
|
|
||||||
@@ -66,6 +68,8 @@ public:
|
|||||||
display_device = false;
|
display_device = false;
|
||||||
advanced_shading = true;
|
advanced_shading = true;
|
||||||
has_bindless_textures = false;
|
has_bindless_textures = false;
|
||||||
|
has_volume_decoupled = false;
|
||||||
|
has_qbvh = false;
|
||||||
use_split_kernel = false;
|
use_split_kernel = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,6 +368,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
/* Indicted whether device types and devices lists were initialized. */
|
/* Indicted whether device types and devices lists were initialized. */
|
||||||
static bool need_types_update, need_devices_update;
|
static bool need_types_update, need_devices_update;
|
||||||
|
static thread_mutex device_mutex;
|
||||||
static vector<DeviceType> types;
|
static vector<DeviceType> types;
|
||||||
static vector<DeviceInfo> devices;
|
static vector<DeviceInfo> devices;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1024,6 +1024,8 @@ void device_cpu_info(vector<DeviceInfo>& devices)
|
|||||||
info.id = "CPU";
|
info.id = "CPU";
|
||||||
info.num = 0;
|
info.num = 0;
|
||||||
info.advanced_shading = true;
|
info.advanced_shading = true;
|
||||||
|
info.has_qbvh = system_cpu_support_sse2();
|
||||||
|
info.has_volume_decoupled = true;
|
||||||
|
|
||||||
devices.insert(devices.begin(), info);
|
devices.insert(devices.begin(), info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1313,9 +1313,14 @@ public:
|
|||||||
CUdeviceptr d_work_tiles = cuda_device_ptr(work_tiles.device_pointer);
|
CUdeviceptr d_work_tiles = cuda_device_ptr(work_tiles.device_pointer);
|
||||||
|
|
||||||
/* Prepare work size. More step samples render faster, but for now we
|
/* Prepare work size. More step samples render faster, but for now we
|
||||||
* remain conservative to avoid driver timeouts. */
|
* remain conservative for GPUs connected to a display to avoid driver
|
||||||
|
* timeouts and display freezing. */
|
||||||
int min_blocks, num_threads_per_block;
|
int min_blocks, num_threads_per_block;
|
||||||
cuda_assert(cuOccupancyMaxPotentialBlockSize(&min_blocks, &num_threads_per_block, cuPathTrace, NULL, 0, 0));
|
cuda_assert(cuOccupancyMaxPotentialBlockSize(&min_blocks, &num_threads_per_block, cuPathTrace, NULL, 0, 0));
|
||||||
|
if(!info.display_device) {
|
||||||
|
min_blocks *= 8;
|
||||||
|
}
|
||||||
|
|
||||||
uint step_samples = divide_up(min_blocks * num_threads_per_block, wtile->w * wtile->h);;
|
uint step_samples = divide_up(min_blocks * num_threads_per_block, wtile->w * wtile->h);;
|
||||||
|
|
||||||
/* Render all samples. */
|
/* Render all samples. */
|
||||||
@@ -2130,7 +2135,6 @@ void device_cuda_info(vector<DeviceInfo>& devices)
|
|||||||
|
|
||||||
for(int num = 0; num < count; num++) {
|
for(int num = 0; num < count; num++) {
|
||||||
char name[256];
|
char name[256];
|
||||||
int attr;
|
|
||||||
|
|
||||||
if(cuDeviceGetName(name, 256, num) != CUDA_SUCCESS)
|
if(cuDeviceGetName(name, 256, num) != CUDA_SUCCESS)
|
||||||
continue;
|
continue;
|
||||||
@@ -2149,6 +2153,8 @@ void device_cuda_info(vector<DeviceInfo>& devices)
|
|||||||
|
|
||||||
info.advanced_shading = (major >= 2);
|
info.advanced_shading = (major >= 2);
|
||||||
info.has_bindless_textures = (major >= 3);
|
info.has_bindless_textures = (major >= 3);
|
||||||
|
info.has_volume_decoupled = false;
|
||||||
|
info.has_qbvh = false;
|
||||||
|
|
||||||
int pci_location[3] = {0, 0, 0};
|
int pci_location[3] = {0, 0, 0};
|
||||||
cuDeviceGetAttribute(&pci_location[0], CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, num);
|
cuDeviceGetAttribute(&pci_location[0], CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, num);
|
||||||
@@ -2160,14 +2166,21 @@ void device_cuda_info(vector<DeviceInfo>& devices)
|
|||||||
(unsigned int)pci_location[1],
|
(unsigned int)pci_location[1],
|
||||||
(unsigned int)pci_location[2]);
|
(unsigned int)pci_location[2]);
|
||||||
|
|
||||||
/* if device has a kernel timeout, assume it is used for display */
|
/* If device has a kernel timeout and no compute preemption, we assume
|
||||||
if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1) {
|
* it is connected to a display and will freeze the display while doing
|
||||||
|
* computations. */
|
||||||
|
int timeout_attr = 0, preempt_attr = 0;
|
||||||
|
cuDeviceGetAttribute(&timeout_attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num);
|
||||||
|
cuDeviceGetAttribute(&preempt_attr, CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, num);
|
||||||
|
|
||||||
|
if(timeout_attr && !preempt_attr) {
|
||||||
info.description += " (Display)";
|
info.description += " (Display)";
|
||||||
info.display_device = true;
|
info.display_device = true;
|
||||||
display_devices.push_back(info);
|
display_devices.push_back(info);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
devices.push_back(info);
|
devices.push_back(info);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!display_devices.empty())
|
if(!display_devices.empty())
|
||||||
|
|||||||
@@ -343,7 +343,11 @@ void device_network_info(vector<DeviceInfo>& devices)
|
|||||||
info.description = "Network Device";
|
info.description = "Network Device";
|
||||||
info.id = "NETWORK";
|
info.id = "NETWORK";
|
||||||
info.num = 0;
|
info.num = 0;
|
||||||
info.advanced_shading = true; /* todo: get this info from device */
|
|
||||||
|
/* todo: get this info from device */
|
||||||
|
info.advanced_shading = true;
|
||||||
|
info.has_volume_decoupled = false;
|
||||||
|
info.has_qbvh = false;
|
||||||
|
|
||||||
devices.push_back(info);
|
devices.push_back(info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ void device_opencl_info(vector<DeviceInfo>& devices)
|
|||||||
info.advanced_shading = OpenCLInfo::kernel_use_advanced_shading(platform_name);
|
info.advanced_shading = OpenCLInfo::kernel_use_advanced_shading(platform_name);
|
||||||
info.use_split_kernel = OpenCLInfo::kernel_use_split(platform_name,
|
info.use_split_kernel = OpenCLInfo::kernel_use_split(platform_name,
|
||||||
device_type);
|
device_type);
|
||||||
|
info.has_volume_decoupled = false;
|
||||||
|
info.has_qbvh = false;
|
||||||
info.id = string("OPENCL_") + platform_name + "_" + device_name + "_" + hardware_id;
|
info.id = string("OPENCL_") + platform_name + "_" + device_name + "_" + hardware_id;
|
||||||
devices.push_back(info);
|
devices.push_back(info);
|
||||||
num_devices++;
|
num_devices++;
|
||||||
|
|||||||
@@ -170,87 +170,90 @@ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume(
|
|||||||
if(!hit) {
|
if(!hit) {
|
||||||
kernel_volume_clean_stack(kg, state->volume_stack);
|
kernel_volume_clean_stack(kg, state->volume_stack);
|
||||||
}
|
}
|
||||||
/* volume attenuation, emission, scatter */
|
|
||||||
if(state->volume_stack[0].shader != SHADER_NONE) {
|
|
||||||
Ray volume_ray = *ray;
|
|
||||||
volume_ray.t = (hit)? isect->t: FLT_MAX;
|
|
||||||
|
|
||||||
bool heterogeneous = volume_stack_is_heterogeneous(kg, state->volume_stack);
|
if(state->volume_stack[0].shader == SHADER_NONE) {
|
||||||
|
return VOLUME_PATH_ATTENUATED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* volume attenuation, emission, scatter */
|
||||||
|
Ray volume_ray = *ray;
|
||||||
|
volume_ray.t = (hit)? isect->t: FLT_MAX;
|
||||||
|
|
||||||
|
bool heterogeneous = volume_stack_is_heterogeneous(kg, state->volume_stack);
|
||||||
|
|
||||||
# ifdef __VOLUME_DECOUPLED__
|
# ifdef __VOLUME_DECOUPLED__
|
||||||
int sampling_method = volume_stack_sampling_method(kg, state->volume_stack);
|
int sampling_method = volume_stack_sampling_method(kg, state->volume_stack);
|
||||||
bool direct = (state->flag & PATH_RAY_CAMERA) != 0;
|
bool direct = (state->flag & PATH_RAY_CAMERA) != 0;
|
||||||
bool decoupled = kernel_volume_use_decoupled(kg, heterogeneous, direct, sampling_method);
|
bool decoupled = kernel_volume_use_decoupled(kg, heterogeneous, direct, sampling_method);
|
||||||
|
|
||||||
if(decoupled) {
|
if(decoupled) {
|
||||||
/* cache steps along volume for repeated sampling */
|
/* cache steps along volume for repeated sampling */
|
||||||
VolumeSegment volume_segment;
|
VolumeSegment volume_segment;
|
||||||
|
|
||||||
shader_setup_from_volume(kg, sd, &volume_ray);
|
shader_setup_from_volume(kg, sd, &volume_ray);
|
||||||
kernel_volume_decoupled_record(kg, state,
|
kernel_volume_decoupled_record(kg, state,
|
||||||
&volume_ray, sd, &volume_segment, heterogeneous);
|
&volume_ray, sd, &volume_segment, heterogeneous);
|
||||||
|
|
||||||
volume_segment.sampling_method = sampling_method;
|
volume_segment.sampling_method = sampling_method;
|
||||||
|
|
||||||
/* emission */
|
/* emission */
|
||||||
if(volume_segment.closure_flag & SD_EMISSION)
|
if(volume_segment.closure_flag & SD_EMISSION)
|
||||||
path_radiance_accum_emission(L, state, *throughput, volume_segment.accum_emission);
|
path_radiance_accum_emission(L, state, *throughput, volume_segment.accum_emission);
|
||||||
|
|
||||||
/* scattering */
|
/* scattering */
|
||||||
VolumeIntegrateResult result = VOLUME_PATH_ATTENUATED;
|
VolumeIntegrateResult result = VOLUME_PATH_ATTENUATED;
|
||||||
|
|
||||||
if(volume_segment.closure_flag & SD_SCATTER) {
|
if(volume_segment.closure_flag & SD_SCATTER) {
|
||||||
int all = kernel_data.integrator.sample_all_lights_indirect;
|
int all = kernel_data.integrator.sample_all_lights_indirect;
|
||||||
|
|
||||||
/* direct light sampling */
|
/* direct light sampling */
|
||||||
kernel_branched_path_volume_connect_light(kg, sd,
|
kernel_branched_path_volume_connect_light(kg, sd,
|
||||||
emission_sd, *throughput, state, L, all,
|
emission_sd, *throughput, state, L, all,
|
||||||
&volume_ray, &volume_segment);
|
&volume_ray, &volume_segment);
|
||||||
|
|
||||||
/* indirect sample. if we use distance sampling and take just
|
/* indirect sample. if we use distance sampling and take just
|
||||||
* one sample for direct and indirect light, we could share
|
* one sample for direct and indirect light, we could share
|
||||||
* this computation, but makes code a bit complex */
|
* this computation, but makes code a bit complex */
|
||||||
float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL);
|
float rphase = path_state_rng_1D(kg, state, PRNG_PHASE_CHANNEL);
|
||||||
float rscatter = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE);
|
float rscatter = path_state_rng_1D(kg, state, PRNG_SCATTER_DISTANCE);
|
||||||
|
|
||||||
result = kernel_volume_decoupled_scatter(kg,
|
result = kernel_volume_decoupled_scatter(kg,
|
||||||
state, &volume_ray, sd, throughput,
|
state, &volume_ray, sd, throughput,
|
||||||
rphase, rscatter, &volume_segment, NULL, true);
|
rphase, rscatter, &volume_segment, NULL, true);
|
||||||
}
|
|
||||||
|
|
||||||
/* free cached steps */
|
|
||||||
kernel_volume_decoupled_free(kg, &volume_segment);
|
|
||||||
|
|
||||||
if(result == VOLUME_PATH_SCATTERED) {
|
|
||||||
if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray))
|
|
||||||
return VOLUME_PATH_SCATTERED;
|
|
||||||
else
|
|
||||||
return VOLUME_PATH_MISSED;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*throughput *= volume_segment.accum_transmittance;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
/* free cached steps */
|
||||||
|
kernel_volume_decoupled_free(kg, &volume_segment);
|
||||||
|
|
||||||
|
if(result == VOLUME_PATH_SCATTERED) {
|
||||||
|
if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray))
|
||||||
|
return VOLUME_PATH_SCATTERED;
|
||||||
|
else
|
||||||
|
return VOLUME_PATH_MISSED;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*throughput *= volume_segment.accum_transmittance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
# endif /* __VOLUME_DECOUPLED__ */
|
# endif /* __VOLUME_DECOUPLED__ */
|
||||||
{
|
{
|
||||||
/* integrate along volume segment with distance sampling */
|
/* integrate along volume segment with distance sampling */
|
||||||
VolumeIntegrateResult result = kernel_volume_integrate(
|
VolumeIntegrateResult result = kernel_volume_integrate(
|
||||||
kg, state, sd, &volume_ray, L, throughput, heterogeneous);
|
kg, state, sd, &volume_ray, L, throughput, heterogeneous);
|
||||||
|
|
||||||
# ifdef __VOLUME_SCATTER__
|
# ifdef __VOLUME_SCATTER__
|
||||||
if(result == VOLUME_PATH_SCATTERED) {
|
if(result == VOLUME_PATH_SCATTERED) {
|
||||||
/* direct lighting */
|
/* direct lighting */
|
||||||
kernel_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L);
|
kernel_path_volume_connect_light(kg, sd, emission_sd, *throughput, state, L);
|
||||||
|
|
||||||
/* indirect light bounce */
|
/* indirect light bounce */
|
||||||
if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray))
|
if(kernel_path_volume_bounce(kg, sd, throughput, state, &L->state, ray))
|
||||||
return VOLUME_PATH_SCATTERED;
|
return VOLUME_PATH_SCATTERED;
|
||||||
else
|
else
|
||||||
return VOLUME_PATH_MISSED;
|
return VOLUME_PATH_MISSED;
|
||||||
}
|
|
||||||
# endif /* __VOLUME_SCATTER__ */
|
|
||||||
}
|
}
|
||||||
|
# endif /* __VOLUME_SCATTER__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
return VOLUME_PATH_ATTENUATED;
|
return VOLUME_PATH_ATTENUATED;
|
||||||
|
|||||||
@@ -64,6 +64,164 @@ ccl_device_inline void kernel_branched_path_ao(KernelGlobals *kg,
|
|||||||
|
|
||||||
#ifndef __SPLIT_KERNEL__
|
#ifndef __SPLIT_KERNEL__
|
||||||
|
|
||||||
|
#ifdef __VOLUME__
|
||||||
|
ccl_device_forceinline void kernel_branched_path_volume(
|
||||||
|
KernelGlobals *kg,
|
||||||
|
ShaderData *sd,
|
||||||
|
PathState *state,
|
||||||
|
Ray *ray,
|
||||||
|
float3 *throughput,
|
||||||
|
ccl_addr_space Intersection *isect,
|
||||||
|
bool hit,
|
||||||
|
ShaderData *indirect_sd,
|
||||||
|
ShaderData *emission_sd,
|
||||||
|
PathRadiance *L)
|
||||||
|
{
|
||||||
|
/* Sanitize volume stack. */
|
||||||
|
if(!hit) {
|
||||||
|
kernel_volume_clean_stack(kg, state->volume_stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state->volume_stack[0].shader == SHADER_NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* volume attenuation, emission, scatter */
|
||||||
|
Ray volume_ray = *ray;
|
||||||
|
volume_ray.t = (hit)? isect->t: FLT_MAX;
|
||||||
|
|
||||||
|
bool heterogeneous = volume_stack_is_heterogeneous(kg, state->volume_stack);
|
||||||
|
|
||||||
|
# ifdef __VOLUME_DECOUPLED__
|
||||||
|
/* decoupled ray marching only supported on CPU */
|
||||||
|
if(kernel_data.integrator.volume_decoupled) {
|
||||||
|
/* cache steps along volume for repeated sampling */
|
||||||
|
VolumeSegment volume_segment;
|
||||||
|
|
||||||
|
shader_setup_from_volume(kg, sd, &volume_ray);
|
||||||
|
kernel_volume_decoupled_record(kg, state,
|
||||||
|
&volume_ray, sd, &volume_segment, heterogeneous);
|
||||||
|
|
||||||
|
/* direct light sampling */
|
||||||
|
if(volume_segment.closure_flag & SD_SCATTER) {
|
||||||
|
volume_segment.sampling_method = volume_stack_sampling_method(kg, state->volume_stack);
|
||||||
|
|
||||||
|
int all = kernel_data.integrator.sample_all_lights_direct;
|
||||||
|
|
||||||
|
kernel_branched_path_volume_connect_light(kg, sd,
|
||||||
|
emission_sd, *throughput, state, L, all,
|
||||||
|
&volume_ray, &volume_segment);
|
||||||
|
|
||||||
|
/* indirect light sampling */
|
||||||
|
int num_samples = kernel_data.integrator.volume_samples;
|
||||||
|
float num_samples_inv = 1.0f/num_samples;
|
||||||
|
|
||||||
|
for(int j = 0; j < num_samples; j++) {
|
||||||
|
PathState ps = *state;
|
||||||
|
Ray pray = *ray;
|
||||||
|
float3 tp = *throughput;
|
||||||
|
|
||||||
|
/* branch RNG state */
|
||||||
|
path_state_branch(&ps, j, num_samples);
|
||||||
|
|
||||||
|
/* scatter sample. if we use distance sampling and take just one
|
||||||
|
* sample for direct and indirect light, we could share this
|
||||||
|
* computation, but makes code a bit complex */
|
||||||
|
float rphase = path_state_rng_1D(kg, &ps, PRNG_PHASE_CHANNEL);
|
||||||
|
float rscatter = path_state_rng_1D(kg, &ps, PRNG_SCATTER_DISTANCE);
|
||||||
|
|
||||||
|
VolumeIntegrateResult result = kernel_volume_decoupled_scatter(kg,
|
||||||
|
&ps, &pray, sd, &tp, rphase, rscatter, &volume_segment, NULL, false);
|
||||||
|
|
||||||
|
if(result == VOLUME_PATH_SCATTERED &&
|
||||||
|
kernel_path_volume_bounce(kg,
|
||||||
|
sd,
|
||||||
|
&tp,
|
||||||
|
&ps,
|
||||||
|
&L->state,
|
||||||
|
&pray))
|
||||||
|
{
|
||||||
|
kernel_path_indirect(kg,
|
||||||
|
indirect_sd,
|
||||||
|
emission_sd,
|
||||||
|
&pray,
|
||||||
|
tp*num_samples_inv,
|
||||||
|
&ps,
|
||||||
|
L);
|
||||||
|
|
||||||
|
/* for render passes, sum and reset indirect light pass variables
|
||||||
|
* for the next samples */
|
||||||
|
path_radiance_sum_indirect(L);
|
||||||
|
path_radiance_reset_indirect(L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* emission and transmittance */
|
||||||
|
if(volume_segment.closure_flag & SD_EMISSION)
|
||||||
|
path_radiance_accum_emission(L, state, *throughput, volume_segment.accum_emission);
|
||||||
|
*throughput *= volume_segment.accum_transmittance;
|
||||||
|
|
||||||
|
/* free cached steps */
|
||||||
|
kernel_volume_decoupled_free(kg, &volume_segment);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif /* __VOLUME_DECOUPLED__ */
|
||||||
|
{
|
||||||
|
/* GPU: no decoupled ray marching, scatter probalistically */
|
||||||
|
int num_samples = kernel_data.integrator.volume_samples;
|
||||||
|
float num_samples_inv = 1.0f/num_samples;
|
||||||
|
|
||||||
|
/* todo: we should cache the shader evaluations from stepping
|
||||||
|
* through the volume, for now we redo them multiple times */
|
||||||
|
|
||||||
|
for(int j = 0; j < num_samples; j++) {
|
||||||
|
PathState ps = *state;
|
||||||
|
Ray pray = *ray;
|
||||||
|
float3 tp = (*throughput) * num_samples_inv;
|
||||||
|
|
||||||
|
/* branch RNG state */
|
||||||
|
path_state_branch(&ps, j, num_samples);
|
||||||
|
|
||||||
|
VolumeIntegrateResult result = kernel_volume_integrate(
|
||||||
|
kg, &ps, sd, &volume_ray, L, &tp, heterogeneous);
|
||||||
|
|
||||||
|
# ifdef __VOLUME_SCATTER__
|
||||||
|
if(result == VOLUME_PATH_SCATTERED) {
|
||||||
|
/* todo: support equiangular, MIS and all light sampling.
|
||||||
|
* alternatively get decoupled ray marching working on the GPU */
|
||||||
|
kernel_path_volume_connect_light(kg, sd, emission_sd, tp, state, L);
|
||||||
|
|
||||||
|
if(kernel_path_volume_bounce(kg,
|
||||||
|
sd,
|
||||||
|
&tp,
|
||||||
|
&ps,
|
||||||
|
&L->state,
|
||||||
|
&pray))
|
||||||
|
{
|
||||||
|
kernel_path_indirect(kg,
|
||||||
|
indirect_sd,
|
||||||
|
emission_sd,
|
||||||
|
&pray,
|
||||||
|
tp,
|
||||||
|
&ps,
|
||||||
|
L);
|
||||||
|
|
||||||
|
/* for render passes, sum and reset indirect light pass variables
|
||||||
|
* for the next samples */
|
||||||
|
path_radiance_sum_indirect(L);
|
||||||
|
path_radiance_reset_indirect(L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif /* __VOLUME_SCATTER__ */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* todo: avoid this calculation using decoupled ray marching */
|
||||||
|
kernel_volume_shadow(kg, emission_sd, state, &volume_ray, throughput);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* __VOLUME__ */
|
||||||
|
|
||||||
/* bounce off surface and integrate indirect light */
|
/* bounce off surface and integrate indirect light */
|
||||||
ccl_device_noinline void kernel_branched_path_surface_indirect_light(KernelGlobals *kg,
|
ccl_device_noinline void kernel_branched_path_surface_indirect_light(KernelGlobals *kg,
|
||||||
ShaderData *sd, ShaderData *indirect_sd, ShaderData *emission_sd,
|
ShaderData *sd, ShaderData *indirect_sd, ShaderData *emission_sd,
|
||||||
@@ -293,142 +451,17 @@ ccl_device void kernel_branched_path_integrate(KernelGlobals *kg,
|
|||||||
bool hit = kernel_path_scene_intersect(kg, &state, &ray, &isect, L);
|
bool hit = kernel_path_scene_intersect(kg, &state, &ray, &isect, L);
|
||||||
|
|
||||||
#ifdef __VOLUME__
|
#ifdef __VOLUME__
|
||||||
/* Sanitize volume stack. */
|
/* Volume integration. */
|
||||||
if(!hit) {
|
kernel_branched_path_volume(kg,
|
||||||
kernel_volume_clean_stack(kg, state.volume_stack);
|
&sd,
|
||||||
}
|
&state,
|
||||||
/* volume attenuation, emission, scatter */
|
&ray,
|
||||||
if(state.volume_stack[0].shader != SHADER_NONE) {
|
&throughput,
|
||||||
Ray volume_ray = ray;
|
&isect,
|
||||||
volume_ray.t = (hit)? isect.t: FLT_MAX;
|
hit,
|
||||||
|
&indirect_sd,
|
||||||
bool heterogeneous = volume_stack_is_heterogeneous(kg, state.volume_stack);
|
&emission_sd,
|
||||||
|
L);
|
||||||
#ifdef __VOLUME_DECOUPLED__
|
|
||||||
/* decoupled ray marching only supported on CPU */
|
|
||||||
|
|
||||||
/* cache steps along volume for repeated sampling */
|
|
||||||
VolumeSegment volume_segment;
|
|
||||||
|
|
||||||
shader_setup_from_volume(kg, &sd, &volume_ray);
|
|
||||||
kernel_volume_decoupled_record(kg, &state,
|
|
||||||
&volume_ray, &sd, &volume_segment, heterogeneous);
|
|
||||||
|
|
||||||
/* direct light sampling */
|
|
||||||
if(volume_segment.closure_flag & SD_SCATTER) {
|
|
||||||
volume_segment.sampling_method = volume_stack_sampling_method(kg, state.volume_stack);
|
|
||||||
|
|
||||||
int all = kernel_data.integrator.sample_all_lights_direct;
|
|
||||||
|
|
||||||
kernel_branched_path_volume_connect_light(kg, &sd,
|
|
||||||
&emission_sd, throughput, &state, L, all,
|
|
||||||
&volume_ray, &volume_segment);
|
|
||||||
|
|
||||||
/* indirect light sampling */
|
|
||||||
int num_samples = kernel_data.integrator.volume_samples;
|
|
||||||
float num_samples_inv = 1.0f/num_samples;
|
|
||||||
|
|
||||||
for(int j = 0; j < num_samples; j++) {
|
|
||||||
PathState ps = state;
|
|
||||||
Ray pray = ray;
|
|
||||||
float3 tp = throughput;
|
|
||||||
|
|
||||||
/* branch RNG state */
|
|
||||||
path_state_branch(&ps, j, num_samples);
|
|
||||||
|
|
||||||
/* scatter sample. if we use distance sampling and take just one
|
|
||||||
* sample for direct and indirect light, we could share this
|
|
||||||
* computation, but makes code a bit complex */
|
|
||||||
float rphase = path_state_rng_1D(kg, &ps, PRNG_PHASE_CHANNEL);
|
|
||||||
float rscatter = path_state_rng_1D(kg, &ps, PRNG_SCATTER_DISTANCE);
|
|
||||||
|
|
||||||
VolumeIntegrateResult result = kernel_volume_decoupled_scatter(kg,
|
|
||||||
&ps, &pray, &sd, &tp, rphase, rscatter, &volume_segment, NULL, false);
|
|
||||||
|
|
||||||
if(result == VOLUME_PATH_SCATTERED &&
|
|
||||||
kernel_path_volume_bounce(kg,
|
|
||||||
&sd,
|
|
||||||
&tp,
|
|
||||||
&ps,
|
|
||||||
&L->state,
|
|
||||||
&pray))
|
|
||||||
{
|
|
||||||
kernel_path_indirect(kg,
|
|
||||||
&indirect_sd,
|
|
||||||
&emission_sd,
|
|
||||||
&pray,
|
|
||||||
tp*num_samples_inv,
|
|
||||||
&ps,
|
|
||||||
L);
|
|
||||||
|
|
||||||
/* for render passes, sum and reset indirect light pass variables
|
|
||||||
* for the next samples */
|
|
||||||
path_radiance_sum_indirect(L);
|
|
||||||
path_radiance_reset_indirect(L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* emission and transmittance */
|
|
||||||
if(volume_segment.closure_flag & SD_EMISSION)
|
|
||||||
path_radiance_accum_emission(L, &state, throughput, volume_segment.accum_emission);
|
|
||||||
throughput *= volume_segment.accum_transmittance;
|
|
||||||
|
|
||||||
/* free cached steps */
|
|
||||||
kernel_volume_decoupled_free(kg, &volume_segment);
|
|
||||||
#else
|
|
||||||
/* GPU: no decoupled ray marching, scatter probalistically */
|
|
||||||
int num_samples = kernel_data.integrator.volume_samples;
|
|
||||||
float num_samples_inv = 1.0f/num_samples;
|
|
||||||
|
|
||||||
/* todo: we should cache the shader evaluations from stepping
|
|
||||||
* through the volume, for now we redo them multiple times */
|
|
||||||
|
|
||||||
for(int j = 0; j < num_samples; j++) {
|
|
||||||
PathState ps = state;
|
|
||||||
Ray pray = ray;
|
|
||||||
float3 tp = throughput * num_samples_inv;
|
|
||||||
|
|
||||||
/* branch RNG state */
|
|
||||||
path_state_branch(&ps, j, num_samples);
|
|
||||||
|
|
||||||
VolumeIntegrateResult result = kernel_volume_integrate(
|
|
||||||
kg, &ps, &sd, &volume_ray, L, &tp, heterogeneous);
|
|
||||||
|
|
||||||
#ifdef __VOLUME_SCATTER__
|
|
||||||
if(result == VOLUME_PATH_SCATTERED) {
|
|
||||||
/* todo: support equiangular, MIS and all light sampling.
|
|
||||||
* alternatively get decoupled ray marching working on the GPU */
|
|
||||||
kernel_path_volume_connect_light(kg, &sd, &emission_sd, tp, &state, L);
|
|
||||||
|
|
||||||
if(kernel_path_volume_bounce(kg,
|
|
||||||
&sd,
|
|
||||||
&tp,
|
|
||||||
&ps,
|
|
||||||
&L->state,
|
|
||||||
&pray))
|
|
||||||
{
|
|
||||||
kernel_path_indirect(kg,
|
|
||||||
&indirect_sd,
|
|
||||||
&emission_sd,
|
|
||||||
&pray,
|
|
||||||
tp,
|
|
||||||
&ps,
|
|
||||||
L);
|
|
||||||
|
|
||||||
/* for render passes, sum and reset indirect light pass variables
|
|
||||||
* for the next samples */
|
|
||||||
path_radiance_sum_indirect(L);
|
|
||||||
path_radiance_reset_indirect(L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* __VOLUME_SCATTER__ */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* todo: avoid this calculation using decoupled ray marching */
|
|
||||||
kernel_volume_shadow(kg, &emission_sd, &state, &volume_ray, &throughput);
|
|
||||||
#endif /* __VOLUME_DECOUPLED__ */
|
|
||||||
}
|
|
||||||
#endif /* __VOLUME__ */
|
#endif /* __VOLUME__ */
|
||||||
|
|
||||||
/* Shade background. */
|
/* Shade background. */
|
||||||
|
|||||||
@@ -1262,6 +1262,7 @@ typedef struct KernelIntegrator {
|
|||||||
|
|
||||||
/* branched path */
|
/* branched path */
|
||||||
int branched;
|
int branched;
|
||||||
|
int volume_decoupled;
|
||||||
int diffuse_samples;
|
int diffuse_samples;
|
||||||
int glossy_samples;
|
int glossy_samples;
|
||||||
int transmission_samples;
|
int transmission_samples;
|
||||||
@@ -1287,7 +1288,6 @@ typedef struct KernelIntegrator {
|
|||||||
float light_inv_rr_threshold;
|
float light_inv_rr_threshold;
|
||||||
|
|
||||||
int start_sample;
|
int start_sample;
|
||||||
int pad1;
|
|
||||||
} KernelIntegrator;
|
} KernelIntegrator;
|
||||||
static_assert_align(KernelIntegrator, 16);
|
static_assert_align(KernelIntegrator, 16);
|
||||||
|
|
||||||
|
|||||||
@@ -1026,6 +1026,9 @@ ccl_device bool kernel_volume_use_decoupled(KernelGlobals *kg, bool heterogeneou
|
|||||||
/* decoupled ray marching for heterogeneous volumes not supported on the GPU,
|
/* decoupled ray marching for heterogeneous volumes not supported on the GPU,
|
||||||
* which also means equiangular and multiple importance sampling is not
|
* which also means equiangular and multiple importance sampling is not
|
||||||
* support for that case */
|
* support for that case */
|
||||||
|
if(!kernel_data.integrator.volume_decoupled)
|
||||||
|
return false;
|
||||||
|
|
||||||
#ifdef __KERNEL_GPU__
|
#ifdef __KERNEL_GPU__
|
||||||
if(heterogeneous)
|
if(heterogeneous)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, fl
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float x, float y, float z)
|
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float x, float y, float z, InterpolationType interp)
|
||||||
{
|
{
|
||||||
float4 r;
|
float4 r;
|
||||||
switch(id) {
|
switch(id) {
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
|
|||||||
kintegrator->sample_clamp_indirect = (sample_clamp_indirect == 0.0f)? FLT_MAX: sample_clamp_indirect*3.0f;
|
kintegrator->sample_clamp_indirect = (sample_clamp_indirect == 0.0f)? FLT_MAX: sample_clamp_indirect*3.0f;
|
||||||
|
|
||||||
kintegrator->branched = (method == BRANCHED_PATH);
|
kintegrator->branched = (method == BRANCHED_PATH);
|
||||||
|
kintegrator->volume_decoupled = device->info.has_volume_decoupled;
|
||||||
kintegrator->diffuse_samples = diffuse_samples;
|
kintegrator->diffuse_samples = diffuse_samples;
|
||||||
kintegrator->glossy_samples = glossy_samples;
|
kintegrator->glossy_samples = glossy_samples;
|
||||||
kintegrator->transmission_samples = transmission_samples;
|
kintegrator->transmission_samples = transmission_samples;
|
||||||
|
|||||||
@@ -1016,7 +1016,8 @@ void Mesh::pack_patches(uint *patch_data, uint vert_offset, uint face_offset, ui
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mesh::compute_bvh(DeviceScene *dscene,
|
void Mesh::compute_bvh(Device *device,
|
||||||
|
DeviceScene *dscene,
|
||||||
SceneParams *params,
|
SceneParams *params,
|
||||||
Progress *progress,
|
Progress *progress,
|
||||||
int n,
|
int n,
|
||||||
@@ -1050,7 +1051,7 @@ void Mesh::compute_bvh(DeviceScene *dscene,
|
|||||||
|
|
||||||
BVHParams bparams;
|
BVHParams bparams;
|
||||||
bparams.use_spatial_split = params->use_bvh_spatial_split;
|
bparams.use_spatial_split = params->use_bvh_spatial_split;
|
||||||
bparams.use_qbvh = params->use_qbvh;
|
bparams.use_qbvh = params->use_qbvh && device->info.has_qbvh;
|
||||||
bparams.use_unaligned_nodes = dscene->data.bvh.have_curves &&
|
bparams.use_unaligned_nodes = dscene->data.bvh.have_curves &&
|
||||||
params->use_bvh_unaligned_nodes;
|
params->use_bvh_unaligned_nodes;
|
||||||
bparams.num_motion_triangle_steps = params->num_bvh_time_steps;
|
bparams.num_motion_triangle_steps = params->num_bvh_time_steps;
|
||||||
@@ -1814,18 +1815,18 @@ void MeshManager::device_update_bvh(Device *device, DeviceScene *dscene, Scene *
|
|||||||
/* bvh build */
|
/* bvh build */
|
||||||
progress.set_status("Updating Scene BVH", "Building");
|
progress.set_status("Updating Scene BVH", "Building");
|
||||||
|
|
||||||
VLOG(1) << (scene->params.use_qbvh ? "Using QBVH optimization structure"
|
|
||||||
: "Using regular BVH optimization structure");
|
|
||||||
|
|
||||||
BVHParams bparams;
|
BVHParams bparams;
|
||||||
bparams.top_level = true;
|
bparams.top_level = true;
|
||||||
bparams.use_qbvh = scene->params.use_qbvh;
|
bparams.use_qbvh = scene->params.use_qbvh && device->info.has_qbvh;
|
||||||
bparams.use_spatial_split = scene->params.use_bvh_spatial_split;
|
bparams.use_spatial_split = scene->params.use_bvh_spatial_split;
|
||||||
bparams.use_unaligned_nodes = dscene->data.bvh.have_curves &&
|
bparams.use_unaligned_nodes = dscene->data.bvh.have_curves &&
|
||||||
scene->params.use_bvh_unaligned_nodes;
|
scene->params.use_bvh_unaligned_nodes;
|
||||||
bparams.num_motion_triangle_steps = scene->params.num_bvh_time_steps;
|
bparams.num_motion_triangle_steps = scene->params.num_bvh_time_steps;
|
||||||
bparams.num_motion_curve_steps = scene->params.num_bvh_time_steps;
|
bparams.num_motion_curve_steps = scene->params.num_bvh_time_steps;
|
||||||
|
|
||||||
|
VLOG(1) << (bparams.use_qbvh ? "Using QBVH optimization structure"
|
||||||
|
: "Using regular BVH optimization structure");
|
||||||
|
|
||||||
delete bvh;
|
delete bvh;
|
||||||
bvh = BVH::create(bparams, scene->objects);
|
bvh = BVH::create(bparams, scene->objects);
|
||||||
bvh->build(progress);
|
bvh->build(progress);
|
||||||
@@ -1879,7 +1880,7 @@ void MeshManager::device_update_bvh(Device *device, DeviceScene *dscene, Scene *
|
|||||||
}
|
}
|
||||||
|
|
||||||
dscene->data.bvh.root = pack.root_index;
|
dscene->data.bvh.root = pack.root_index;
|
||||||
dscene->data.bvh.use_qbvh = scene->params.use_qbvh;
|
dscene->data.bvh.use_qbvh = bparams.use_qbvh;
|
||||||
dscene->data.bvh.use_bvh_steps = (scene->params.num_bvh_time_steps != 0);
|
dscene->data.bvh.use_bvh_steps = (scene->params.num_bvh_time_steps != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2084,6 +2085,7 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
|
|||||||
if(mesh->need_update) {
|
if(mesh->need_update) {
|
||||||
pool.push(function_bind(&Mesh::compute_bvh,
|
pool.push(function_bind(&Mesh::compute_bvh,
|
||||||
mesh,
|
mesh,
|
||||||
|
device,
|
||||||
dscene,
|
dscene,
|
||||||
&scene->params,
|
&scene->params,
|
||||||
&progress,
|
&progress,
|
||||||
|
|||||||
@@ -282,7 +282,8 @@ public:
|
|||||||
void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset);
|
void pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, size_t curvekey_offset);
|
||||||
void pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset);
|
void pack_patches(uint *patch_data, uint vert_offset, uint face_offset, uint corner_offset);
|
||||||
|
|
||||||
void compute_bvh(DeviceScene *dscene,
|
void compute_bvh(Device *device,
|
||||||
|
DeviceScene *dscene,
|
||||||
SceneParams *params,
|
SceneParams *params,
|
||||||
Progress *progress,
|
Progress *progress,
|
||||||
int n,
|
int n,
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public:
|
|||||||
use_bvh_spatial_split = false;
|
use_bvh_spatial_split = false;
|
||||||
use_bvh_unaligned_nodes = true;
|
use_bvh_unaligned_nodes = true;
|
||||||
num_bvh_time_steps = 0;
|
num_bvh_time_steps = 0;
|
||||||
use_qbvh = false;
|
use_qbvh = true;
|
||||||
persistent_data = false;
|
persistent_data = false;
|
||||||
texture_limit = 0;
|
texture_limit = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -451,10 +451,12 @@ void ShaderManager::device_update_common(Device *device,
|
|||||||
flag |= SD_HETEROGENEOUS_VOLUME;
|
flag |= SD_HETEROGENEOUS_VOLUME;
|
||||||
if(shader->has_bssrdf_bump)
|
if(shader->has_bssrdf_bump)
|
||||||
flag |= SD_HAS_BSSRDF_BUMP;
|
flag |= SD_HAS_BSSRDF_BUMP;
|
||||||
if(shader->volume_sampling_method == VOLUME_SAMPLING_EQUIANGULAR)
|
if(device->info.has_volume_decoupled) {
|
||||||
flag |= SD_VOLUME_EQUIANGULAR;
|
if(shader->volume_sampling_method == VOLUME_SAMPLING_EQUIANGULAR)
|
||||||
if(shader->volume_sampling_method == VOLUME_SAMPLING_MULTIPLE_IMPORTANCE)
|
flag |= SD_VOLUME_EQUIANGULAR;
|
||||||
flag |= SD_VOLUME_MIS;
|
if(shader->volume_sampling_method == VOLUME_SAMPLING_MULTIPLE_IMPORTANCE)
|
||||||
|
flag |= SD_VOLUME_MIS;
|
||||||
|
}
|
||||||
if(shader->volume_interpolation_method == VOLUME_INTERPOLATION_CUBIC)
|
if(shader->volume_interpolation_method == VOLUME_INTERPOLATION_CUBIC)
|
||||||
flag |= SD_VOLUME_CUBIC;
|
flag |= SD_VOLUME_CUBIC;
|
||||||
if(shader->has_bump)
|
if(shader->has_bump)
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ import bpy
|
|||||||
from bpy.types import Header, Menu, Panel
|
from bpy.types import Header, Menu, Panel
|
||||||
from rna_prop_ui import PropertyPanel
|
from rna_prop_ui import PropertyPanel
|
||||||
from bl_ui.properties_grease_pencil_common import (
|
from bl_ui.properties_grease_pencil_common import (
|
||||||
GreasePencilDataPanel,
|
GreasePencilDataPanel,
|
||||||
GreasePencilPaletteColorPanel,
|
GreasePencilPaletteColorPanel,
|
||||||
GreasePencilToolsPanel,
|
GreasePencilToolsPanel,
|
||||||
)
|
)
|
||||||
from bpy.app.translations import pgettext_iface as iface_
|
from bpy.app.translations import pgettext_iface as iface_
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ def draw_color_balance(layout, color_balance):
|
|||||||
col.separator()
|
col.separator()
|
||||||
col.prop(color_balance, "lift", text="")
|
col.prop(color_balance, "lift", text="")
|
||||||
col.prop(color_balance, "invert_lift", text="Invert", icon='ARROW_LEFTRIGHT')
|
col.prop(color_balance, "invert_lift", text="Invert", icon='ARROW_LEFTRIGHT')
|
||||||
split.template_color_picker(color_balance, "lift", value_slider=True, cubic=True)
|
split.template_color_picker(color_balance, "lift", value_slider=True, cubic=True)
|
||||||
|
|
||||||
box = layout.box()
|
box = layout.box()
|
||||||
split = box.split(percentage=0.35)
|
split = box.split(percentage=0.35)
|
||||||
@@ -197,14 +197,18 @@ class SEQUENCER_MT_view(Menu):
|
|||||||
layout.operator_context = 'INVOKE_DEFAULT'
|
layout.operator_context = 'INVOKE_DEFAULT'
|
||||||
if is_preview:
|
if is_preview:
|
||||||
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
||||||
layout.operator("sequencer.view_all_preview", text="Fit Preview in Window")
|
layout.operator("sequencer.view_all_preview", text="Fit Preview in window")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
|
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
|
||||||
|
|
||||||
for a, b in ratios:
|
for a, b in ratios:
|
||||||
layout.operator("sequencer.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
|
layout.operator(
|
||||||
|
"sequencer.view_zoom_ratio",
|
||||||
|
text=iface_("Zoom %d:%d") % (a, b),
|
||||||
|
translate=False,
|
||||||
|
).ratio = a / b
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
@@ -276,30 +280,6 @@ class SEQUENCER_MT_marker(Menu):
|
|||||||
marker_menu_generic(layout)
|
marker_menu_generic(layout)
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_MT_change(Menu):
|
|
||||||
bl_label = "Change"
|
|
||||||
|
|
||||||
def draw(self, context):
|
|
||||||
layout = self.layout
|
|
||||||
strip = act_strip(context)
|
|
||||||
|
|
||||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
|
||||||
|
|
||||||
layout.operator_menu_enum("sequencer.change_effect_input", "swap")
|
|
||||||
layout.operator_menu_enum("sequencer.change_effect_type", "type")
|
|
||||||
prop = layout.operator("sequencer.change_path", text="Path/Files")
|
|
||||||
|
|
||||||
if strip:
|
|
||||||
stype = strip.type
|
|
||||||
|
|
||||||
if stype == 'IMAGE':
|
|
||||||
prop.filter_image = True
|
|
||||||
elif stype == 'MOVIE':
|
|
||||||
prop.filter_movie = True
|
|
||||||
elif stype == 'SOUND':
|
|
||||||
prop.filter_sound = True
|
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_MT_frame(Menu):
|
class SEQUENCER_MT_frame(Menu):
|
||||||
bl_label = "Frame"
|
bl_label = "Frame"
|
||||||
|
|
||||||
@@ -388,6 +368,60 @@ class SEQUENCER_MT_add_effect(Menu):
|
|||||||
layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
|
layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
|
||||||
|
|
||||||
|
|
||||||
|
class SEQUENCER_MT_strip_transform(Menu):
|
||||||
|
bl_label = "Transform"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
|
||||||
|
layout.operator("transform.transform", text="Grab/Extend from Frame").mode = 'TIME_EXTEND'
|
||||||
|
layout.operator("sequencer.slip", text="Slip Strip Contents")
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
|
layout.operator_menu_enum("sequencer.swap", "side")
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
|
layout.operator("sequencer.gap_remove").all = False
|
||||||
|
layout.operator("sequencer.gap_insert")
|
||||||
|
|
||||||
|
|
||||||
|
class SEQUENCER_MT_strip_input(Menu):
|
||||||
|
bl_label = "Inputs"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
strip = act_strip(context)
|
||||||
|
|
||||||
|
layout.operator("sequencer.reload", text="Reload Strips")
|
||||||
|
layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
|
||||||
|
prop = layout.operator("sequencer.change_path", text="Change Path/Files")
|
||||||
|
layout.operator("sequencer.swap_data", text="Swap Data")
|
||||||
|
|
||||||
|
if strip:
|
||||||
|
stype = strip.type
|
||||||
|
|
||||||
|
if stype == 'IMAGE':
|
||||||
|
prop.filter_image = True
|
||||||
|
elif stype == 'MOVIE':
|
||||||
|
prop.filter_movie = True
|
||||||
|
elif stype == 'SOUND':
|
||||||
|
prop.filter_sound = True
|
||||||
|
|
||||||
|
|
||||||
|
class SEQUENCER_MT_strip_lock_mute(Menu):
|
||||||
|
bl_label = "Lock/Mute"
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
layout.operator("sequencer.lock")
|
||||||
|
layout.operator("sequencer.unlock")
|
||||||
|
layout.operator("sequencer.mute").unselected = False
|
||||||
|
layout.operator("sequencer.unmute").unselected = False
|
||||||
|
layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
|
||||||
|
|
||||||
|
|
||||||
class SEQUENCER_MT_strip(Menu):
|
class SEQUENCER_MT_strip(Menu):
|
||||||
bl_label = "Strip"
|
bl_label = "Strip"
|
||||||
|
|
||||||
@@ -396,79 +430,62 @@ class SEQUENCER_MT_strip(Menu):
|
|||||||
|
|
||||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||||
|
|
||||||
layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
|
layout.operator("ed.undo")
|
||||||
layout.operator("transform.transform", text="Grab/Extend from Frame").mode = 'TIME_EXTEND'
|
layout.operator("ed.redo")
|
||||||
layout.operator("sequencer.gap_remove").all = False
|
layout.operator("ed.undo_history")
|
||||||
layout.operator("sequencer.gap_insert")
|
|
||||||
|
|
||||||
# uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
layout.menu("SEQUENCER_MT_strip_transform")
|
||||||
layout.operator("sequencer.cut", text="Cut (Hard) at Frame").type = 'HARD'
|
layout.operator("sequencer.snap")
|
||||||
layout.operator("sequencer.cut", text="Cut (Soft) at Frame").type = 'SOFT'
|
|
||||||
layout.operator("sequencer.slip", text="Slip Strip Contents")
|
|
||||||
layout.operator("sequencer.images_separate")
|
|
||||||
layout.operator("sequencer.offset_clear")
|
layout.operator("sequencer.offset_clear")
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
|
layout.operator("sequencer.duplicate_move")
|
||||||
|
layout.operator("sequencer.delete", text="Delete...")
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
|
layout.operator("sequencer.cut", text="Cut (Hard) at frame").type = 'HARD'
|
||||||
|
layout.operator("sequencer.cut", text="Cut (Soft) at frame").type = 'SOFT'
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
layout.operator("sequencer.deinterlace_selected_movies")
|
layout.operator("sequencer.deinterlace_selected_movies")
|
||||||
layout.operator("sequencer.rebuild_proxy")
|
layout.operator("sequencer.rebuild_proxy")
|
||||||
layout.separator()
|
|
||||||
|
|
||||||
layout.operator("sequencer.duplicate_move")
|
|
||||||
layout.operator("sequencer.delete")
|
|
||||||
|
|
||||||
strip = act_strip(context)
|
strip = act_strip(context)
|
||||||
|
|
||||||
if strip:
|
if strip:
|
||||||
stype = strip.type
|
stype = strip.type
|
||||||
|
|
||||||
# XXX note strip.type is never equal to 'EFFECT', look at seq_type_items within rna_sequencer.c
|
if stype in {
|
||||||
if stype == 'EFFECT':
|
'CROSS', 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
||||||
pass
|
'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP', 'WIPE', 'GLOW',
|
||||||
# layout.separator()
|
'TRANSFORM', 'COLOR', 'SPEED', 'MULTICAM', 'ADJUSTMENT',
|
||||||
# layout.operator("sequencer.effect_change")
|
'GAUSSIAN_BLUR', 'TEXT',
|
||||||
# layout.operator("sequencer.effect_reassign_inputs")
|
}:
|
||||||
elif stype == 'IMAGE':
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
# layout.operator("sequencer.image_change")
|
layout.operator_menu_enum("sequencer.change_effect_input", "swap")
|
||||||
layout.operator("sequencer.rendersize")
|
layout.operator_menu_enum("sequencer.change_effect_type", "type")
|
||||||
elif stype == 'SCENE':
|
layout.operator("sequencer.reassign_inputs")
|
||||||
pass
|
layout.operator("sequencer.swap_inputs")
|
||||||
# layout.separator()
|
elif stype in {'IMAGE', 'MOVIE'}:
|
||||||
# layout.operator("sequencer.scene_change", text="Change Scene")
|
|
||||||
elif stype == 'MOVIE':
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
# layout.operator("sequencer.movie_change")
|
|
||||||
layout.operator("sequencer.rendersize")
|
layout.operator("sequencer.rendersize")
|
||||||
|
layout.operator("sequencer.images_separate")
|
||||||
elif stype == 'SOUND':
|
elif stype == 'SOUND':
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("sequencer.crossfade_sounds")
|
layout.operator("sequencer.crossfade_sounds")
|
||||||
|
elif stype == 'META':
|
||||||
|
layout.separator()
|
||||||
|
layout.operator("sequencer.meta_separate")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("sequencer.meta_make")
|
layout.operator("sequencer.meta_make")
|
||||||
layout.operator("sequencer.meta_separate")
|
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("sequencer.reload", text="Reload Strips")
|
layout.menu("SEQUENCER_MT_strip_input")
|
||||||
layout.operator("sequencer.reload", text="Reload Strips and Adjust Length").adjust_length = True
|
|
||||||
layout.operator("sequencer.reassign_inputs")
|
|
||||||
layout.operator("sequencer.swap_inputs")
|
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.operator("sequencer.lock")
|
layout.menu("SEQUENCER_MT_strip_lock_mute")
|
||||||
layout.operator("sequencer.unlock")
|
|
||||||
layout.operator("sequencer.mute").unselected = False
|
|
||||||
layout.operator("sequencer.unmute").unselected = False
|
|
||||||
|
|
||||||
layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
|
|
||||||
|
|
||||||
layout.operator("sequencer.snap")
|
|
||||||
|
|
||||||
layout.operator_menu_enum("sequencer.swap", "side")
|
|
||||||
|
|
||||||
layout.separator()
|
|
||||||
|
|
||||||
layout.operator("sequencer.swap_data")
|
|
||||||
layout.menu("SEQUENCER_MT_change")
|
|
||||||
|
|
||||||
|
|
||||||
class SequencerButtonsPanel:
|
class SequencerButtonsPanel:
|
||||||
@@ -532,7 +549,6 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(strip, "mute", toggle=True, icon_only=True, icon='MUTE_IPO_OFF')
|
row.prop(strip, "mute", toggle=True, icon_only=True, icon='MUTE_IPO_OFF')
|
||||||
|
|
||||||
|
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
|
|
||||||
@@ -582,10 +598,12 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
|
|||||||
if not strip:
|
if not strip:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return strip.type in {'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
return strip.type in {
|
||||||
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
|
'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
||||||
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
|
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
|
||||||
'MULTICAM', 'GAUSSIAN_BLUR', 'TEXT'}
|
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR', 'SPEED',
|
||||||
|
'MULTICAM', 'GAUSSIAN_BLUR', 'TEXT',
|
||||||
|
}
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -700,7 +718,6 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
|
|||||||
col.separator()
|
col.separator()
|
||||||
col.label(text="Two or more channels are needed below this strip", icon='INFO')
|
col.label(text="Two or more channels are needed below this strip", icon='INFO')
|
||||||
|
|
||||||
|
|
||||||
elif strip.type == 'TEXT':
|
elif strip.type == 'TEXT':
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.prop(strip, "text")
|
col.prop(strip, "text")
|
||||||
@@ -748,11 +765,13 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
|
|||||||
if not strip:
|
if not strip:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
|
return strip.type in {
|
||||||
'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'META',
|
||||||
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
|
'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
|
||||||
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
|
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
|
||||||
'MULTICAM', 'SPEED', 'ADJUSTMENT'}
|
'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
|
||||||
|
'MULTICAM', 'SPEED', 'ADJUSTMENT',
|
||||||
|
}
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -985,11 +1004,13 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
|
|||||||
if not strip:
|
if not strip:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return strip.type in {'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
|
return strip.type in {
|
||||||
'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
|
'MOVIE', 'IMAGE', 'SCENE', 'MOVIECLIP', 'MASK',
|
||||||
'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
|
'META', 'ADD', 'SUBTRACT', 'ALPHA_OVER',
|
||||||
'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
|
'ALPHA_UNDER', 'CROSS', 'GAMMA_CROSS', 'MULTIPLY',
|
||||||
'MULTICAM', 'SPEED', 'ADJUSTMENT'}
|
'OVER_DROP', 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
|
||||||
|
'MULTICAM', 'SPEED', 'ADJUSTMENT',
|
||||||
|
}
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@@ -1269,11 +1290,13 @@ classes = (
|
|||||||
SEQUENCER_MT_view_toggle,
|
SEQUENCER_MT_view_toggle,
|
||||||
SEQUENCER_MT_select,
|
SEQUENCER_MT_select,
|
||||||
SEQUENCER_MT_marker,
|
SEQUENCER_MT_marker,
|
||||||
SEQUENCER_MT_change,
|
|
||||||
SEQUENCER_MT_frame,
|
SEQUENCER_MT_frame,
|
||||||
SEQUENCER_MT_add,
|
SEQUENCER_MT_add,
|
||||||
SEQUENCER_MT_add_effect,
|
SEQUENCER_MT_add_effect,
|
||||||
SEQUENCER_MT_strip,
|
SEQUENCER_MT_strip,
|
||||||
|
SEQUENCER_MT_strip_transform,
|
||||||
|
SEQUENCER_MT_strip_input,
|
||||||
|
SEQUENCER_MT_strip_lock_mute,
|
||||||
SEQUENCER_PT_edit,
|
SEQUENCER_PT_edit,
|
||||||
SEQUENCER_PT_effect,
|
SEQUENCER_PT_effect,
|
||||||
SEQUENCER_PT_input,
|
SEQUENCER_PT_input,
|
||||||
|
|||||||
@@ -1025,7 +1025,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
|
|||||||
ViewContext vc;
|
ViewContext vc;
|
||||||
view3d_set_viewcontext(C, &vc);
|
view3d_set_viewcontext(C, &vc);
|
||||||
|
|
||||||
if (vc.rv3d->rflag & RV3D_NAVIGATING) {
|
if (vc.rv3d && (vc.rv3d->rflag & RV3D_NAVIGATING)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -310,78 +310,29 @@ static uint vpaint_blend(
|
|||||||
return color_blend;
|
return color_blend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void tex_color_alpha(
|
||||||
/* whats _dl mean? */
|
|
||||||
static float calc_vp_strength_col_dl(
|
|
||||||
VPaint *vp, const ViewContext *vc, const float co[3],
|
VPaint *vp, const ViewContext *vc, const float co[3],
|
||||||
const float mval[2], const float brush_size_pressure, float rgba[4])
|
float r_rgba[4])
|
||||||
{
|
{
|
||||||
float co_ss[2]; /* screenspace */
|
const Brush *brush = BKE_paint_brush(&vp->paint);
|
||||||
|
BLI_assert(brush->mtex.tex != NULL);
|
||||||
if (ED_view3d_project_float_object(
|
if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) {
|
||||||
vc->ar,
|
BKE_brush_sample_tex_3D(vc->scene, brush, co, r_rgba, 0, NULL);
|
||||||
co, co_ss,
|
}
|
||||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
else {
|
||||||
{
|
float co_ss[2]; /* screenspace */
|
||||||
const float dist_sq = len_squared_v2v2(mval, co_ss);
|
if (ED_view3d_project_float_object(
|
||||||
|
vc->ar,
|
||||||
if (dist_sq <= SQUARE(brush_size_pressure)) {
|
co, co_ss,
|
||||||
Brush *brush = BKE_paint_brush(&vp->paint);
|
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
||||||
const float dist = sqrtf(dist_sq);
|
{
|
||||||
float factor;
|
const float co_ss_3d[3] = {co_ss[0], co_ss[1], 0.0f}; /* we need a 3rd empty value */
|
||||||
|
BKE_brush_sample_tex_3D(vc->scene, brush, co_ss_3d, r_rgba, 0, NULL);
|
||||||
if (brush->mtex.tex && rgba) {
|
}
|
||||||
if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_3D) {
|
else {
|
||||||
BKE_brush_sample_tex_3D(vc->scene, brush, co, rgba, 0, NULL);
|
zero_v4(r_rgba);
|
||||||
}
|
|
||||||
else {
|
|
||||||
const float co_ss_3d[3] = {co_ss[0], co_ss[1], 0.0f}; /* we need a 3rd empty value */
|
|
||||||
BKE_brush_sample_tex_3D(vc->scene, brush, co_ss_3d, rgba, 0, NULL);
|
|
||||||
}
|
|
||||||
factor = rgba[3];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
factor = 1.0f;
|
|
||||||
}
|
|
||||||
return factor * BKE_brush_curve_strength_clamped(brush, dist, brush_size_pressure);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rgba)
|
|
||||||
zero_v4(rgba);
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
static float calc_vp_alpha_col_dl(
|
|
||||||
VPaint *vp, const ViewContext *vc,
|
|
||||||
float vpimat[3][3], const DMCoNo *v_co_no,
|
|
||||||
const float mval[2],
|
|
||||||
const float brush_size_pressure, const float brush_alpha_pressure, float rgba[4])
|
|
||||||
{
|
|
||||||
float strength = calc_vp_strength_col_dl(vp, vc, v_co_no->co, mval, brush_size_pressure, rgba);
|
|
||||||
|
|
||||||
if (strength > 0.0f) {
|
|
||||||
float alpha = brush_alpha_pressure * strength;
|
|
||||||
|
|
||||||
if ((vp->paint.brush->flag & BRUSH_FRONTFACE_FALLOFF) != 0) {
|
|
||||||
float dvec[3];
|
|
||||||
|
|
||||||
/* transpose ! */
|
|
||||||
dvec[2] = dot_v3v3(vpimat[2], v_co_no->no);
|
|
||||||
if (dvec[2] > 0.0f) {
|
|
||||||
dvec[0] = dot_v3v3(vpimat[0], v_co_no->no);
|
|
||||||
dvec[1] = dot_v3v3(vpimat[1], v_co_no->no);
|
|
||||||
|
|
||||||
alpha *= dvec[2] / len_v3(dvec);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vpaint has 'vpaint_blend' */
|
/* vpaint has 'vpaint_blend' */
|
||||||
@@ -1195,8 +1146,6 @@ struct WPaintData {
|
|||||||
|
|
||||||
struct WeightPaintGroupData active, mirror;
|
struct WeightPaintGroupData active, mirror;
|
||||||
|
|
||||||
float wpimat[3][3];
|
|
||||||
|
|
||||||
/* variables for auto normalize */
|
/* variables for auto normalize */
|
||||||
const bool *vgroup_validmap; /* stores if vgroups tie to deforming bones or not */
|
const bool *vgroup_validmap; /* stores if vgroups tie to deforming bones or not */
|
||||||
const bool *lock_flags;
|
const bool *lock_flags;
|
||||||
@@ -1338,8 +1287,6 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
|
|||||||
VPaint *vp = CTX_data_tool_settings(C)->wpaint;
|
VPaint *vp = CTX_data_tool_settings(C)->wpaint;
|
||||||
EvaluationContext eval_ctx;
|
EvaluationContext eval_ctx;
|
||||||
|
|
||||||
float mat[4][4], imat[4][4];
|
|
||||||
|
|
||||||
if (ED_wpaint_ensure_data(C, op->reports, WPAINT_ENSURE_MIRROR, &vgroup_index) == false) {
|
if (ED_wpaint_ensure_data(C, op->reports, WPAINT_ENSURE_MIRROR, &vgroup_index) == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1443,11 +1390,6 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
|
|||||||
wpd->precomputed_weight = MEM_mallocN(sizeof(float) * me->totvert, __func__);
|
wpd->precomputed_weight = MEM_mallocN(sizeof(float) * me->totvert, __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* imat for normals */
|
|
||||||
mul_m4_m4m4(mat, wpd->vc.rv3d->viewmat, ob->obmat);
|
|
||||||
invert_m4_m4(imat, mat);
|
|
||||||
copy_m3_m4(wpd->wpimat, imat);
|
|
||||||
|
|
||||||
/* If not previously created, create vertex/weight paint mode session data */
|
/* If not previously created, create vertex/weight paint mode session data */
|
||||||
vertex_paint_init_session(&eval_ctx, scene, ob);
|
vertex_paint_init_session(&eval_ctx, scene, ob);
|
||||||
vwpaint_update_cache_invariants(C, vp, ss, op, mouse);
|
vwpaint_update_cache_invariants(C, vp, ss, op, mouse);
|
||||||
@@ -2361,8 +2303,6 @@ struct VPaintData {
|
|||||||
struct VertProjHandle *vp_handle;
|
struct VertProjHandle *vp_handle;
|
||||||
struct DMCoNo *vertexcosnos;
|
struct DMCoNo *vertexcosnos;
|
||||||
|
|
||||||
float vpimat[3][3];
|
|
||||||
|
|
||||||
/* modify 'me->mcol' directly, since the derived mesh is drawing from this
|
/* modify 'me->mcol' directly, since the derived mesh is drawing from this
|
||||||
* array, otherwise we need to refresh the modifier stack */
|
* array, otherwise we need to refresh the modifier stack */
|
||||||
bool use_fast_update;
|
bool use_fast_update;
|
||||||
@@ -2373,7 +2313,7 @@ struct VPaintData {
|
|||||||
|
|
||||||
bool is_texbrush;
|
bool is_texbrush;
|
||||||
|
|
||||||
/* Special storage for smear brush, avoid feedback loop - update each step and swap. */
|
/* Special storage for smear brush, avoid feedback loop - update each step. */
|
||||||
struct {
|
struct {
|
||||||
uint *color_prev;
|
uint *color_prev;
|
||||||
uint *color_curr;
|
uint *color_curr;
|
||||||
@@ -2390,7 +2330,6 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
|
|||||||
struct VPaintData *vpd;
|
struct VPaintData *vpd;
|
||||||
Object *ob = CTX_data_active_object(C);
|
Object *ob = CTX_data_active_object(C);
|
||||||
Mesh *me;
|
Mesh *me;
|
||||||
float mat[4][4], imat[4][4];
|
|
||||||
SculptSession *ss = ob->sculpt;
|
SculptSession *ss = ob->sculpt;
|
||||||
EvaluationContext eval_ctx;
|
EvaluationContext eval_ctx;
|
||||||
|
|
||||||
@@ -2446,11 +2385,6 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
|
|||||||
ob->sculpt->building_vp_handle = false;
|
ob->sculpt->building_vp_handle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* some old cruft to sort out later */
|
|
||||||
mul_m4_m4m4(mat, vpd->vc.rv3d->viewmat, ob->obmat);
|
|
||||||
invert_m4_m4(imat, mat);
|
|
||||||
copy_m3_m4(vpd->vpimat, imat);
|
|
||||||
|
|
||||||
/* If not previously created, create vertex/weight paint mode session data */
|
/* If not previously created, create vertex/weight paint mode session data */
|
||||||
vertex_paint_init_session(&eval_ctx, scene, ob);
|
vertex_paint_init_session(&eval_ctx, scene, ob);
|
||||||
vwpaint_update_cache_invariants(C, vp, ss, op, mouse);
|
vwpaint_update_cache_invariants(C, vp, ss, op, mouse);
|
||||||
@@ -2512,23 +2446,17 @@ static void do_vpaint_brush_calc_average_color_cb_ex(
|
|||||||
BKE_pbvh_vertex_iter_end;
|
BKE_pbvh_vertex_iter_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_texture_brush(
|
static float tex_color_alpha_ubyte(
|
||||||
SculptThreadedTaskData *data, PBVHVertexIter vd, float size_pressure, float alpha_pressure,
|
SculptThreadedTaskData *data, const float v_co[3],
|
||||||
float *r_alpha, uint *r_color)
|
uint *r_color)
|
||||||
{
|
{
|
||||||
SculptSession *ss = data->ob->sculpt;
|
|
||||||
CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
|
|
||||||
const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
|
|
||||||
|
|
||||||
float rgba[4];
|
float rgba[4];
|
||||||
float rgba_br[3];
|
float rgba_br[3];
|
||||||
|
tex_color_alpha(data->vp, &data->vpd->vc, v_co, rgba);
|
||||||
*r_alpha = calc_vp_alpha_col_dl(
|
|
||||||
data->vp, &data->vpd->vc, data->vpd->vpimat,
|
|
||||||
&data->vpd->vertexcosnos[v_index], ss->cache->mouse, size_pressure, alpha_pressure, rgba);
|
|
||||||
rgb_uchar_to_float(rgba_br, (const uchar *)&data->vpd->paintcol);
|
rgb_uchar_to_float(rgba_br, (const uchar *)&data->vpd->paintcol);
|
||||||
mul_v3_v3(rgba_br, rgba);
|
mul_v3_v3(rgba_br, rgba);
|
||||||
rgb_float_to_uchar((uchar *)r_color, rgba_br);
|
rgb_float_to_uchar((uchar *)r_color, rgba_br);
|
||||||
|
return rgba[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_vpaint_brush_draw_task_cb_ex(
|
static void do_vpaint_brush_draw_task_cb_ex(
|
||||||
@@ -2586,9 +2514,10 @@ static void do_vpaint_brush_draw_task_cb_ex(
|
|||||||
/* If we're painting with a texture, sample the texture color and alpha. */
|
/* If we're painting with a texture, sample the texture color and alpha. */
|
||||||
float tex_alpha = 1.0;
|
float tex_alpha = 1.0;
|
||||||
if (data->vpd->is_texbrush) {
|
if (data->vpd->is_texbrush) {
|
||||||
handle_texture_brush(
|
/* Note: we may want to paint alpha as vertex color alpha. */
|
||||||
data, vd, brush_size_pressure, brush_alpha_pressure,
|
tex_alpha = tex_color_alpha_ubyte(
|
||||||
&tex_alpha, &color_final);
|
data, data->vpd->vertexcosnos[v_index].co,
|
||||||
|
&color_final);
|
||||||
}
|
}
|
||||||
/* For each poly owning this vert, paint each loop belonging to this vert. */
|
/* For each poly owning this vert, paint each loop belonging to this vert. */
|
||||||
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
|
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
|
||||||
@@ -3032,7 +2961,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
|
|||||||
BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
|
BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
|
||||||
|
|
||||||
if (vp->paint.brush->vertexpaint_tool == PAINT_BLEND_SMEAR) {
|
if (vp->paint.brush->vertexpaint_tool == PAINT_BLEND_SMEAR) {
|
||||||
SWAP(uint *, vpd->smear.color_curr, vpd->smear.color_prev);
|
memcpy(vpd->smear.color_prev, vpd->smear.color_curr, sizeof(uint) * ((Mesh *)ob->data)->totloop);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate pivot for rotation around seletion if needed */
|
/* calculate pivot for rotation around seletion if needed */
|
||||||
@@ -3058,6 +2987,10 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
|
|||||||
ViewContext *vc = &vpd->vc;
|
ViewContext *vc = &vpd->vc;
|
||||||
Object *ob = vc->obact;
|
Object *ob = vc->obact;
|
||||||
|
|
||||||
|
if (vpd->is_texbrush) {
|
||||||
|
ED_vpaint_proj_handle_free(vpd->vp_handle);
|
||||||
|
}
|
||||||
|
|
||||||
if (vpd->mlooptag)
|
if (vpd->mlooptag)
|
||||||
MEM_freeN(vpd->mlooptag);
|
MEM_freeN(vpd->mlooptag);
|
||||||
if (vpd->smear.color_prev)
|
if (vpd->smear.color_prev)
|
||||||
|
|||||||
@@ -941,7 +941,7 @@ static void calc_area_center(
|
|||||||
|
|
||||||
/* Intentionally set 'sd' to NULL since we share logic with vertex paint. */
|
/* Intentionally set 'sd' to NULL since we share logic with vertex paint. */
|
||||||
SculptThreadedTaskData data = {
|
SculptThreadedTaskData data = {
|
||||||
.sd = NULL, .ob = ob, .nodes = nodes, .totnode = totnode,
|
.sd = NULL, .ob = ob, .brush = brush, .nodes = nodes, .totnode = totnode,
|
||||||
.has_bm_orco = has_bm_orco, .area_cos = area_cos, .area_nos = NULL, .count = count,
|
.has_bm_orco = has_bm_orco, .area_cos = area_cos, .area_nos = NULL, .count = count,
|
||||||
};
|
};
|
||||||
BLI_mutex_init(&data.mutex);
|
BLI_mutex_init(&data.mutex);
|
||||||
|
|||||||
@@ -2203,7 +2203,7 @@ static int file_rename_poll(bContext *C)
|
|||||||
poll = false;
|
poll = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char dir[FILE_MAX];
|
char dir[FILE_MAX_LIBEXTRA];
|
||||||
if (filelist_islibrary(sfile->files, dir, NULL)) {
|
if (filelist_islibrary(sfile->files, dir, NULL)) {
|
||||||
poll = false;
|
poll = false;
|
||||||
}
|
}
|
||||||
@@ -2235,7 +2235,7 @@ static int file_delete_poll(bContext *C)
|
|||||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||||
|
|
||||||
if (sfile && sfile->params) {
|
if (sfile && sfile->params) {
|
||||||
char dir[FILE_MAX];
|
char dir[FILE_MAX_LIBEXTRA];
|
||||||
int numfiles = filelist_files_ensure(sfile->files);
|
int numfiles = filelist_files_ensure(sfile->files);
|
||||||
int i;
|
int i;
|
||||||
int num_selected = 0;
|
int num_selected = 0;
|
||||||
|
|||||||
@@ -1232,7 +1232,7 @@ static int sequencer_snap_invoke(bContext *C, wmOperator *op, const wmEvent *UNU
|
|||||||
void SEQUENCER_OT_snap(struct wmOperatorType *ot)
|
void SEQUENCER_OT_snap(struct wmOperatorType *ot)
|
||||||
{
|
{
|
||||||
/* identifiers */
|
/* identifiers */
|
||||||
ot->name = "Snap Strips";
|
ot->name = "Snap Strips to Frame";
|
||||||
ot->idname = "SEQUENCER_OT_snap";
|
ot->idname = "SEQUENCER_OT_snap";
|
||||||
ot->description = "Frame where selected strips will be snapped";
|
ot->description = "Frame where selected strips will be snapped";
|
||||||
|
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
|
|||||||
SceneLayer *sl = CTX_data_scene_layer(C);
|
SceneLayer *sl = CTX_data_scene_layer(C);
|
||||||
PropertyRNA *prop;
|
PropertyRNA *prop;
|
||||||
WMLinkAppendData *lapp_data;
|
WMLinkAppendData *lapp_data;
|
||||||
char path[FILE_MAX_LIBEXTRA], root[FILE_MAXDIR], libname[FILE_MAX], relname[FILE_MAX];
|
char path[FILE_MAX_LIBEXTRA], root[FILE_MAXDIR], libname[FILE_MAX_LIBEXTRA], relname[FILE_MAX];
|
||||||
char *group, *name;
|
char *group, *name;
|
||||||
int totfiles = 0;
|
int totfiles = 0;
|
||||||
short flag;
|
short flag;
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ def print_message(message, type=None, status=''):
|
|||||||
status_text = " FAILED "
|
status_text = " FAILED "
|
||||||
else:
|
else:
|
||||||
status_text = status
|
status_text = status
|
||||||
print("[{}]" . format(status_text), end="")
|
if status_text:
|
||||||
|
print("[{}]" . format(status_text), end="")
|
||||||
print(COLORS.ENDC, end="")
|
print(COLORS.ENDC, end="")
|
||||||
print(" {}" . format(message))
|
print(" {}" . format(message))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|||||||
Reference in New Issue
Block a user