UI: Proper Selection Highlight for Confirms #111949
|
@ -335,8 +335,8 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa
|
|||
|
||||
if (attr_normal) {
|
||||
/* NOTE: the geometry normals are not computed for legacy particle hairs. This hair
|
||||
* system is expected to be discarded. */
|
||||
attr_normal->add(make_float3(1.0f, 0.0f, 0.0f));
|
||||
* system is expected to be deprecated. */
|
||||
attr_normal->add(make_float3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
num_curve_keys++;
|
||||
|
|
|
@ -172,29 +172,27 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args)
|
|||
/* RNA */
|
||||
ID *bScreen = (ID *)PyLong_AsVoidPtr(pyscreen);
|
||||
|
||||
PointerRNA engineptr;
|
||||
RNA_pointer_create(NULL, &RNA_RenderEngine, (void *)PyLong_AsVoidPtr(pyengine), &engineptr);
|
||||
PointerRNA engineptr = RNA_pointer_create(
|
||||
NULL, &RNA_RenderEngine, (void *)PyLong_AsVoidPtr(pyengine));
|
||||
BL::RenderEngine engine(engineptr);
|
||||
|
||||
PointerRNA preferencesptr;
|
||||
RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences), &preferencesptr);
|
||||
PointerRNA preferencesptr = RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences));
|
||||
BL::Preferences preferences(preferencesptr);
|
||||
|
||||
PointerRNA dataptr;
|
||||
RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
PointerRNA dataptr = RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata));
|
||||
BL::BlendData data(dataptr);
|
||||
|
||||
PointerRNA regionptr;
|
||||
RNA_pointer_create(bScreen, &RNA_Region, pylong_as_voidptr_typesafe(pyregion), ®ionptr);
|
||||
PointerRNA regionptr = RNA_pointer_create(
|
||||
bScreen, &RNA_Region, pylong_as_voidptr_typesafe(pyregion));
|
||||
BL::Region region(regionptr);
|
||||
|
||||
PointerRNA v3dptr;
|
||||
RNA_pointer_create(bScreen, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
|
||||
PointerRNA v3dptr = RNA_pointer_create(
|
||||
bScreen, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d));
|
||||
BL::SpaceView3D v3d(v3dptr);
|
||||
|
||||
PointerRNA rv3dptr;
|
||||
RNA_pointer_create(bScreen, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr);
|
||||
PointerRNA rv3dptr = RNA_pointer_create(
|
||||
bScreen, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d));
|
||||
BL::RegionView3D rv3d(rv3dptr);
|
||||
|
||||
/* create session */
|
||||
|
@ -231,8 +229,8 @@ static PyObject *render_func(PyObject * /*self*/, PyObject *args)
|
|||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, (ID *)PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, (ID *)PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
/* Allow Blender to execute other Python scripts. */
|
||||
|
@ -277,11 +275,8 @@ static PyObject *draw_func(PyObject * /*self*/, PyObject *args)
|
|||
|
||||
ID *b_screen = (ID *)PyLong_AsVoidPtr(py_screen);
|
||||
|
||||
PointerRNA b_space_image_ptr;
|
||||
RNA_pointer_create(b_screen,
|
||||
&RNA_SpaceImageEditor,
|
||||
pylong_as_voidptr_typesafe(py_space_image),
|
||||
&b_space_image_ptr);
|
||||
PointerRNA b_space_image_ptr = RNA_pointer_create(
|
||||
b_screen, &RNA_SpaceImageEditor, pylong_as_voidptr_typesafe(py_space_image));
|
||||
BL::SpaceImageEditor b_space_image(b_space_image_ptr);
|
||||
|
||||
session->draw(b_space_image);
|
||||
|
@ -309,12 +304,11 @@ static PyObject *bake_func(PyObject * /*self*/, PyObject *args)
|
|||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
PointerRNA objectptr;
|
||||
RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyobject), &objectptr);
|
||||
PointerRNA objectptr = RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyobject));
|
||||
BL::Object b_object(objectptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
|
@ -355,12 +349,11 @@ static PyObject *reset_func(PyObject * /*self*/, PyObject *args)
|
|||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA dataptr;
|
||||
RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
PointerRNA dataptr = RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata));
|
||||
BL::BlendData b_data(dataptr);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
|
@ -381,8 +374,8 @@ static PyObject *sync_func(PyObject * /*self*/, PyObject *args)
|
|||
|
||||
BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession);
|
||||
|
||||
PointerRNA depsgraphptr;
|
||||
RNA_pointer_create(NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph), &depsgraphptr);
|
||||
PointerRNA depsgraphptr = RNA_pointer_create(
|
||||
NULL, &RNA_Depsgraph, PyLong_AsVoidPtr(pydepsgraph));
|
||||
BL::Depsgraph b_depsgraph(depsgraphptr);
|
||||
|
||||
python_thread_state_save(&session->python_thread_state);
|
||||
|
@ -439,15 +432,12 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
|
|||
return NULL;
|
||||
|
||||
/* RNA */
|
||||
PointerRNA dataptr;
|
||||
RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata), &dataptr);
|
||||
PointerRNA dataptr = RNA_main_pointer_create((Main *)PyLong_AsVoidPtr(pydata));
|
||||
BL::BlendData b_data(dataptr);
|
||||
|
||||
PointerRNA nodeptr;
|
||||
RNA_pointer_create((ID *)PyLong_AsVoidPtr(pynodegroup),
|
||||
&RNA_ShaderNodeScript,
|
||||
(void *)PyLong_AsVoidPtr(pynode),
|
||||
&nodeptr);
|
||||
PointerRNA nodeptr = RNA_pointer_create((ID *)PyLong_AsVoidPtr(pynodegroup),
|
||||
&RNA_ShaderNodeScript,
|
||||
(void *)PyLong_AsVoidPtr(pynode));
|
||||
BL::ShaderNodeScript b_node(nodeptr);
|
||||
|
||||
/* update bytecode hash */
|
||||
|
@ -747,23 +737,18 @@ static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *key
|
|||
}
|
||||
|
||||
/* Get device specification from preferences and scene. */
|
||||
PointerRNA preferencesptr;
|
||||
RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences), &preferencesptr);
|
||||
PointerRNA preferencesptr = RNA_pointer_create(
|
||||
NULL, &RNA_Preferences, (void *)PyLong_AsVoidPtr(pypreferences));
|
||||
BL::Preferences b_preferences(preferencesptr);
|
||||
|
||||
PointerRNA sceneptr;
|
||||
RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene), &sceneptr);
|
||||
PointerRNA sceneptr = RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene));
|
||||
BL::Scene b_scene(sceneptr);
|
||||
|
||||
DeviceInfo device = blender_device_info(b_preferences, b_scene, true, true);
|
||||
|
||||
/* Get denoising parameters from view layer. */
|
||||
PointerRNA viewlayerptr;
|
||||
RNA_pointer_create((ID *)PyLong_AsVoidPtr(pyscene),
|
||||
&RNA_ViewLayer,
|
||||
PyLong_AsVoidPtr(pyviewlayer),
|
||||
&viewlayerptr);
|
||||
PointerRNA viewlayerptr = RNA_pointer_create(
|
||||
(ID *)PyLong_AsVoidPtr(pyscene), &RNA_ViewLayer, PyLong_AsVoidPtr(pyviewlayer));
|
||||
BL::ViewLayer b_view_layer(viewlayerptr);
|
||||
|
||||
DenoiseParams params = BlenderSync::get_denoise_params(b_scene, b_view_layer, true);
|
||||
|
@ -851,8 +836,7 @@ static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
PointerRNA sceneptr;
|
||||
RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene), &sceneptr);
|
||||
PointerRNA sceneptr = RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyscene));
|
||||
BL::Scene b_scene(sceneptr);
|
||||
|
||||
debug_flags_sync_from_scene(b_scene);
|
||||
|
|
|
@ -120,8 +120,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
|
|||
if (geom->is_mesh()) {
|
||||
Mesh *mesh = static_cast<Mesh *>(geom);
|
||||
if (mesh->get_subdivision_type() != Mesh::SUBDIVISION_NONE) {
|
||||
PointerRNA id_ptr;
|
||||
RNA_id_pointer_create((::ID *)iter.first.id, &id_ptr);
|
||||
PointerRNA id_ptr = RNA_id_pointer_create((::ID *)iter.first.id);
|
||||
geometry_map.set_recalc(BL::ID(id_ptr));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ ccl_device_inline
|
|||
}
|
||||
|
||||
#ifdef __SHADOW_LINKING__
|
||||
if (intersection_skip_shadow_link(kg, ray, prim_object)) {
|
||||
if (intersection_skip_shadow_link(kg, ray->self, prim_object)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -132,7 +132,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals kg,
|
|||
}
|
||||
|
||||
#ifdef __SHADOW_LINKING__
|
||||
if (intersection_skip_shadow_link(kg, ray, prim_object)) {
|
||||
if (intersection_skip_shadow_link(kg, ray->self, prim_object)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -233,14 +233,14 @@ ccl_device_inline float intersection_curve_shadow_transparency(
|
|||
return (1.0f - u) * f0 + u * f1;
|
||||
}
|
||||
|
||||
ccl_device_inline bool intersection_skip_self(ccl_private const RaySelfPrimitives &self,
|
||||
ccl_device_inline bool intersection_skip_self(ccl_ray_data const RaySelfPrimitives &self,
|
||||
const int object,
|
||||
const int prim)
|
||||
{
|
||||
return (self.prim == prim) && (self.object == object);
|
||||
}
|
||||
|
||||
ccl_device_inline bool intersection_skip_self_shadow(ccl_private const RaySelfPrimitives &self,
|
||||
ccl_device_inline bool intersection_skip_self_shadow(ccl_ray_data const RaySelfPrimitives &self,
|
||||
const int object,
|
||||
const int prim)
|
||||
{
|
||||
|
@ -248,22 +248,22 @@ ccl_device_inline bool intersection_skip_self_shadow(ccl_private const RaySelfPr
|
|||
((self.light_prim == prim) && (self.light_object == object));
|
||||
}
|
||||
|
||||
ccl_device_inline bool intersection_skip_self_local(ccl_private const RaySelfPrimitives &self,
|
||||
ccl_device_inline bool intersection_skip_self_local(ccl_ray_data const RaySelfPrimitives &self,
|
||||
const int prim)
|
||||
{
|
||||
return (self.prim == prim);
|
||||
}
|
||||
|
||||
#ifdef __SHADOW_LINKING__
|
||||
ccl_device_inline uint64_t ray_get_shadow_set_membership(KernelGlobals kg,
|
||||
ccl_private const Ray *ray)
|
||||
ccl_device_inline uint64_t
|
||||
ray_get_shadow_set_membership(KernelGlobals kg, ccl_ray_data const RaySelfPrimitives &self)
|
||||
{
|
||||
if (ray->self.light != LAMP_NONE) {
|
||||
return kernel_data_fetch(lights, ray->self.light).shadow_set_membership;
|
||||
if (self.light != LAMP_NONE) {
|
||||
return kernel_data_fetch(lights, self.light).shadow_set_membership;
|
||||
}
|
||||
|
||||
if (ray->self.light_object != OBJECT_NONE) {
|
||||
return kernel_data_fetch(objects, ray->self.light_object).shadow_set_membership;
|
||||
if (self.light_object != OBJECT_NONE) {
|
||||
return kernel_data_fetch(objects, self.light_object).shadow_set_membership;
|
||||
}
|
||||
|
||||
return LIGHT_LINK_MASK_ALL;
|
||||
|
@ -271,7 +271,7 @@ ccl_device_inline uint64_t ray_get_shadow_set_membership(KernelGlobals kg,
|
|||
#endif
|
||||
|
||||
ccl_device_inline bool intersection_skip_shadow_link(KernelGlobals kg,
|
||||
ccl_private const Ray *ray,
|
||||
ccl_ray_data const RaySelfPrimitives &self,
|
||||
const int isect_object)
|
||||
{
|
||||
#ifdef __SHADOW_LINKING__
|
||||
|
@ -279,7 +279,7 @@ ccl_device_inline bool intersection_skip_shadow_link(KernelGlobals kg,
|
|||
return false;
|
||||
}
|
||||
|
||||
const uint64_t set_membership = ray_get_shadow_set_membership(kg, ray);
|
||||
const uint64_t set_membership = ray_get_shadow_set_membership(kg, self);
|
||||
if (set_membership == LIGHT_LINK_MASK_ALL) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ ccl_device_inline float3 sphg_dir(float theta, float gamma, float b)
|
|||
fast_sincosf(theta, &sin_theta, &cos_theta);
|
||||
fast_sincosf(gamma, &sin_gamma, &cos_gamma);
|
||||
|
||||
if (b == 1.0f) {
|
||||
if (b == 1.0f || fabsf(cos_gamma) < 1e-6f) {
|
||||
sin_phi = sin_gamma;
|
||||
cos_phi = cos_gamma;
|
||||
}
|
||||
|
@ -211,11 +211,18 @@ ccl_device int bsdf_hair_huang_setup(ccl_private ShaderData *sd,
|
|||
/* Align local frame with the ray direction so that `phi_i == 0`. */
|
||||
bsdf->N = X;
|
||||
}
|
||||
kernel_assert(!is_zero(bsdf->N) && isfinite_safe(bsdf->N));
|
||||
|
||||
/* Fill extra closure. */
|
||||
bsdf->extra->Z = safe_normalize(cross(bsdf->N, sd->dPdu));
|
||||
bsdf->extra->Y = safe_normalize(cross(bsdf->extra->Z, bsdf->N));
|
||||
if (is_zero(bsdf->N) || !isfinite_safe(bsdf->N)) {
|
||||
bsdf->extra->Y = Y;
|
||||
/* Construct arbitrary local coordinate system. The implementation should ensure smooth
|
||||
* transition along the hair shaft. */
|
||||
make_orthonormals(Y, &bsdf->extra->Z, &bsdf->N);
|
||||
}
|
||||
else {
|
||||
bsdf->extra->Z = safe_normalize(cross(bsdf->N, sd->dPdu));
|
||||
bsdf->extra->Y = safe_normalize(cross(bsdf->extra->Z, bsdf->N));
|
||||
}
|
||||
|
||||
const float3 I = make_float3(
|
||||
dot(sd->wi, bsdf->N), dot(sd->wi, bsdf->extra->Y), dot(sd->wi, bsdf->extra->Z));
|
||||
|
|
|
@ -298,7 +298,7 @@ ccl_device_forceinline void kernel_embree_filter_intersection_func_impl(
|
|||
}
|
||||
|
||||
#ifdef __SHADOW_LINKING__
|
||||
if (intersection_skip_shadow_link(kg, cray, kernel_embree_get_hit_object(hit))) {
|
||||
if (intersection_skip_shadow_link(kg, cray->self, kernel_embree_get_hit_object(hit))) {
|
||||
*args->valid = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ ccl_device_forceinline void kernel_embree_filter_occluded_shadow_all_func_impl(
|
|||
}
|
||||
|
||||
#ifdef __SHADOW_LINKING__
|
||||
if (intersection_skip_shadow_link(kg, cray, current_isect.object)) {
|
||||
if (intersection_skip_shadow_link(kg, cray->self, current_isect.object)) {
|
||||
*args->valid = 0;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ typedef unsigned long long uint64_t;
|
|||
#define ccl_constant const
|
||||
#define ccl_gpu_shared __shared__
|
||||
#define ccl_private
|
||||
#define ccl_ray_data ccl_private
|
||||
#define ccl_may_alias
|
||||
#define ccl_restrict __restrict__
|
||||
#define ccl_loop_no_unroll
|
||||
|
|
|
@ -41,6 +41,7 @@ typedef unsigned long long uint64_t;
|
|||
#define ccl_constant const
|
||||
#define ccl_gpu_shared __shared__
|
||||
#define ccl_private
|
||||
#define ccl_ray_data ccl_private
|
||||
#define ccl_may_alias
|
||||
#define ccl_restrict __restrict__
|
||||
#define ccl_loop_no_unroll
|
||||
|
|
|
@ -48,6 +48,11 @@ using namespace metal::raytracing;
|
|||
#define ccl_constant constant
|
||||
#define ccl_gpu_shared threadgroup
|
||||
#define ccl_private thread
|
||||
#ifdef __METALRT__
|
||||
# define ccl_ray_data ray_data
|
||||
#else
|
||||
# define ccl_ray_data ccl_private
|
||||
#endif
|
||||
#define ccl_may_alias
|
||||
#define ccl_restrict __restrict
|
||||
#define ccl_loop_no_unroll
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
|
||||
/* Metal kernel entry points. */
|
||||
|
||||
/* NOTE: Must come prior to other includes. */
|
||||
#include "kernel/device/metal/compat.h"
|
||||
#include "kernel/device/metal/globals.h"
|
||||
|
||||
/* NOTE: Must come prior to the kernel.h. */
|
||||
#include "kernel/device/metal/function_constants.h"
|
||||
|
||||
#include "kernel/device/gpu/kernel.h"
|
||||
|
||||
/* MetalRT intersection handlers. */
|
||||
|
@ -30,29 +34,6 @@ struct TriangleIntersectionResult {
|
|||
|
||||
enum { METALRT_HIT_TRIANGLE, METALRT_HIT_BOUNDING_BOX };
|
||||
|
||||
/* Utilities. */
|
||||
|
||||
ccl_device_inline bool intersection_skip_self(ray_data const RaySelfPrimitives &self,
|
||||
const int object,
|
||||
const int prim)
|
||||
{
|
||||
return (self.prim == prim) && (self.object == object);
|
||||
}
|
||||
|
||||
ccl_device_inline bool intersection_skip_self_shadow(ray_data const RaySelfPrimitives &self,
|
||||
const int object,
|
||||
const int prim)
|
||||
{
|
||||
return ((self.prim == prim) && (self.object == object)) ||
|
||||
((self.light_prim == prim) && (self.light_object == object));
|
||||
}
|
||||
|
||||
ccl_device_inline bool intersection_skip_self_local(ray_data const RaySelfPrimitives &self,
|
||||
const int prim)
|
||||
{
|
||||
return (self.prim == prim);
|
||||
}
|
||||
|
||||
/* Hit functions. */
|
||||
|
||||
template<typename TReturn, uint intersection_type>
|
||||
|
@ -65,11 +46,14 @@ TReturn metalrt_local_hit(constant KernelParamsMetal &launch_params_metal,
|
|||
{
|
||||
TReturn result;
|
||||
|
||||
#ifdef __BVH_LOCAL__
|
||||
# ifdef __BVH_LOCAL__
|
||||
uint prim = primitive_id + kernel_data_fetch(object_prim_offset, object);
|
||||
|
||||
if ((object != payload.local_object) || intersection_skip_self_local(payload.self, prim)) {
|
||||
/* Only intersect with matching object and skip self-intersecton. */
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
|
||||
if ((object != payload.local_object) || context.intersection_skip_self_local(payload.self, prim))
|
||||
{
|
||||
/* Only intersect with matching object and skip self-intersection. */
|
||||
result.accept = false;
|
||||
result.continue_search = true;
|
||||
return result;
|
||||
|
@ -137,10 +121,10 @@ TReturn metalrt_local_hit(constant KernelParamsMetal &launch_params_metal,
|
|||
result.accept = false;
|
||||
result.continue_search = true;
|
||||
return result;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
[[intersection(triangle, triangle_data )]] TriangleIntersectionResult
|
||||
[[intersection(triangle, triangle_data)]] TriangleIntersectionResult
|
||||
__anyhit__cycles_metalrt_local_hit_tri_prim(
|
||||
constant KernelParamsMetal &launch_params_metal [[buffer(1)]],
|
||||
ray_data MetalKernelContext::MetalRTIntersectionLocalPayload &payload [[payload]],
|
||||
|
@ -148,9 +132,10 @@ __anyhit__cycles_metalrt_local_hit_tri_prim(
|
|||
float2 barycentrics [[barycentric_coord]],
|
||||
float ray_tmax [[distance]])
|
||||
{
|
||||
//instance_id, aka the user_id has been removed. If we take this function we optimized the
|
||||
//SSS for starting traversal from a primitive acceleration structure instead of the root of the global AS.
|
||||
//this means we will always be intersecting the correct object no need for the userid to check
|
||||
/* instance_id, aka the user_id has been removed. If we take this function we optimized the
|
||||
* SSS for starting traversal from a primitive acceleration structure instead of the root of the
|
||||
* global AS. this means we will always be intersecting the correct object no need for the
|
||||
* user-id to check */
|
||||
return metalrt_local_hit<TriangleIntersectionResult, METALRT_HIT_TRIANGLE>(
|
||||
launch_params_metal, payload, payload.local_object, primitive_id, barycentrics, ray_tmax);
|
||||
}
|
||||
|
@ -178,7 +163,7 @@ __anyhit__cycles_metalrt_local_hit_box(const float ray_tmax [[max_distance]])
|
|||
return result;
|
||||
}
|
||||
|
||||
[[intersection(bounding_box, triangle_data )]] BoundingBoxIntersectionResult
|
||||
[[intersection(bounding_box, triangle_data)]] BoundingBoxIntersectionResult
|
||||
__anyhit__cycles_metalrt_local_hit_box_prim(const float ray_tmax [[max_distance]])
|
||||
{
|
||||
/* unused function */
|
||||
|
@ -197,26 +182,26 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
|
|||
const float2 barycentrics,
|
||||
const float ray_tmax)
|
||||
{
|
||||
#ifdef __SHADOW_RECORD_ALL__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
# ifdef __SHADOW_RECORD_ALL__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
const uint visibility = payload.visibility;
|
||||
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
|
||||
/* continue search */
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
const float u = barycentrics.x;
|
||||
const float v = barycentrics.y;
|
||||
const int prim_type = kernel_data_fetch(objects, object).primitive_type;
|
||||
int type = prim_type;
|
||||
# ifdef __HAIR__
|
||||
# ifdef __HAIR__
|
||||
if (intersection_type != METALRT_HIT_TRIANGLE) {
|
||||
if ( (prim_type == PRIMITIVE_CURVE_THICK || prim_type == PRIMITIVE_CURVE_RIBBON)) {
|
||||
if ((prim_type == PRIMITIVE_CURVE_THICK || prim_type == PRIMITIVE_CURVE_RIBBON)) {
|
||||
const KernelCurveSegment segment = kernel_data_fetch(curve_segments, prim);
|
||||
type = segment.type;
|
||||
prim = segment.prim;
|
||||
|
||||
|
||||
/* Filter out curve endcaps */
|
||||
if (u == 0.0f || u == 1.0f) {
|
||||
/* continue search */
|
||||
|
@ -224,28 +209,36 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
|
|||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
if (intersection_skip_self_shadow(payload.self, object, prim)) {
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
|
||||
if (context.intersection_skip_self_shadow(payload.self, object, prim)) {
|
||||
/* continue search */
|
||||
return true;
|
||||
}
|
||||
|
||||
# ifndef __TRANSPARENT_SHADOWS__
|
||||
# ifdef __SHADOW_LINKING__
|
||||
if (context.intersection_skip_shadow_link(nullptr, payload.self, object)) {
|
||||
/* continue search */
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef __TRANSPARENT_SHADOWS__
|
||||
/* No transparent shadows support compiled in, make opaque. */
|
||||
payload.result = true;
|
||||
/* terminate ray */
|
||||
return false;
|
||||
# else
|
||||
# else
|
||||
short max_hits = payload.max_hits;
|
||||
short num_hits = payload.num_hits;
|
||||
short num_recorded_hits = payload.num_recorded_hits;
|
||||
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
|
||||
/* If no transparent shadows, all light is blocked and we can stop immediately. */
|
||||
if (num_hits >= max_hits ||
|
||||
!(context.intersection_get_shader_flags(NULL, prim, type) & SD_HAS_TRANSPARENT_SHADOW)) {
|
||||
!(context.intersection_get_shader_flags(NULL, prim, type) & SD_HAS_TRANSPARENT_SHADOW))
|
||||
{
|
||||
payload.result = true;
|
||||
/* terminate ray */
|
||||
return false;
|
||||
|
@ -304,10 +297,10 @@ bool metalrt_shadow_all_hit(constant KernelParamsMetal &launch_params_metal,
|
|||
INTEGRATOR_STATE_ARRAY_WRITE(state, shadow_isect, record_index, prim) = prim;
|
||||
INTEGRATOR_STATE_ARRAY_WRITE(state, shadow_isect, record_index, object) = object;
|
||||
INTEGRATOR_STATE_ARRAY_WRITE(state, shadow_isect, record_index, type) = type;
|
||||
|
||||
|
||||
/* Continue tracing. */
|
||||
# endif /* __TRANSPARENT_SHADOWS__ */
|
||||
#endif /* __SHADOW_RECORD_ALL__ */
|
||||
# endif /* __TRANSPARENT_SHADOWS__ */
|
||||
# endif /* __SHADOW_RECORD_ALL__ */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -351,9 +344,11 @@ inline TReturnType metalrt_visibility_test(
|
|||
{
|
||||
TReturnType result;
|
||||
|
||||
#ifdef __HAIR__
|
||||
# ifdef __HAIR__
|
||||
const int type = kernel_data_fetch(objects, object).primitive_type;
|
||||
if (intersection_type == METALRT_HIT_BOUNDING_BOX && (type == PRIMITIVE_CURVE_THICK || type == PRIMITIVE_CURVE_RIBBON)) {
|
||||
if (intersection_type == METALRT_HIT_BOUNDING_BOX &&
|
||||
(type == PRIMITIVE_CURVE_THICK || type == PRIMITIVE_CURVE_RIBBON))
|
||||
{
|
||||
/* Filter out curve endcaps. */
|
||||
if (u == 0.0f || u == 1.0f) {
|
||||
result.accept = false;
|
||||
|
@ -361,16 +356,16 @@ inline TReturnType metalrt_visibility_test(
|
|||
return result;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
uint visibility = payload.visibility;
|
||||
#ifdef __VISIBILITY_FLAG__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
|
||||
result.accept = false;
|
||||
result.continue_search = true;
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
if (intersection_type == METALRT_HIT_TRIANGLE) {
|
||||
}
|
||||
|
@ -380,9 +375,19 @@ inline TReturnType metalrt_visibility_test(
|
|||
}
|
||||
# endif
|
||||
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
|
||||
/* Shadow ray early termination. */
|
||||
if (visibility & PATH_RAY_SHADOW_OPAQUE) {
|
||||
if (intersection_skip_self_shadow(payload.self, object, prim)) {
|
||||
# ifdef __SHADOW_LINKING__
|
||||
if (context.intersection_skip_shadow_link(nullptr, payload.self, object)) {
|
||||
result.accept = false;
|
||||
result.continue_search = true;
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
if (context.intersection_skip_self_shadow(payload.self, object, prim)) {
|
||||
result.accept = false;
|
||||
result.continue_search = true;
|
||||
return result;
|
||||
|
@ -394,7 +399,7 @@ inline TReturnType metalrt_visibility_test(
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (intersection_skip_self(payload.self, object, prim)) {
|
||||
if (context.intersection_skip_self(payload.self, object, prim)) {
|
||||
result.accept = false;
|
||||
result.continue_search = true;
|
||||
return result;
|
||||
|
@ -437,7 +442,7 @@ __anyhit__cycles_metalrt_visibility_test_box(const float ray_tmax [[max_distance
|
|||
|
||||
/* Primitive intersection functions. */
|
||||
|
||||
#ifdef __HAIR__
|
||||
# ifdef __HAIR__
|
||||
ccl_device_inline void metalrt_intersection_curve(
|
||||
constant KernelParamsMetal &launch_params_metal,
|
||||
ray_data MetalKernelContext::MetalRTIntersectionPayload &payload,
|
||||
|
@ -451,19 +456,20 @@ ccl_device_inline void metalrt_intersection_curve(
|
|||
const float ray_tmax,
|
||||
thread BoundingBoxIntersectionResult &result)
|
||||
{
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
const uint visibility = payload.visibility;
|
||||
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
Intersection isect;
|
||||
isect.t = ray_tmax;
|
||||
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
if (context.curve_intersect(
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type)) {
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type))
|
||||
{
|
||||
result = metalrt_visibility_test<BoundingBoxIntersectionResult, METALRT_HIT_BOUNDING_BOX>(
|
||||
launch_params_metal, payload, object, prim, isect.u);
|
||||
if (result.accept) {
|
||||
|
@ -489,19 +495,20 @@ ccl_device_inline void metalrt_intersection_curve_shadow(
|
|||
const float ray_tmax,
|
||||
thread BoundingBoxIntersectionResult &result)
|
||||
{
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
const uint visibility = payload.visibility;
|
||||
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
Intersection isect;
|
||||
isect.t = ray_tmax;
|
||||
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
if (context.curve_intersect(
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type)) {
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type))
|
||||
{
|
||||
result.continue_search = metalrt_shadow_all_hit<METALRT_HIT_BOUNDING_BOX>(
|
||||
launch_params_metal, payload, object, prim, float2(isect.u, isect.v), ray_tmax);
|
||||
result.accept = !result.continue_search;
|
||||
|
@ -535,11 +542,11 @@ __intersection__curve_ribbon(constant KernelParamsMetal &launch_params_metal [[b
|
|||
segment.type,
|
||||
ray_P,
|
||||
ray_D,
|
||||
# if defined(__METALRT_MOTION__)
|
||||
# if defined(__METALRT_MOTION__)
|
||||
payload.time,
|
||||
# else
|
||||
# else
|
||||
0.0f,
|
||||
# endif
|
||||
# endif
|
||||
ray_tmin,
|
||||
ray_tmax,
|
||||
result);
|
||||
|
@ -575,11 +582,11 @@ __intersection__curve_ribbon_shadow(
|
|||
segment.type,
|
||||
ray_P,
|
||||
ray_D,
|
||||
# if defined(__METALRT_MOTION__)
|
||||
# if defined(__METALRT_MOTION__)
|
||||
payload.time,
|
||||
# else
|
||||
# else
|
||||
0.0f,
|
||||
# endif
|
||||
# endif
|
||||
ray_tmin,
|
||||
ray_tmax,
|
||||
result);
|
||||
|
@ -613,11 +620,11 @@ __intersection__curve_all(constant KernelParamsMetal &launch_params_metal [[buff
|
|||
segment.type,
|
||||
ray_P,
|
||||
ray_D,
|
||||
# if defined(__METALRT_MOTION__)
|
||||
# if defined(__METALRT_MOTION__)
|
||||
payload.time,
|
||||
# else
|
||||
# else
|
||||
0.0f,
|
||||
# endif
|
||||
# endif
|
||||
ray_tmin,
|
||||
ray_tmax,
|
||||
result);
|
||||
|
@ -651,20 +658,20 @@ __intersection__curve_all_shadow(
|
|||
segment.type,
|
||||
ray_P,
|
||||
ray_D,
|
||||
# if defined(__METALRT_MOTION__)
|
||||
# if defined(__METALRT_MOTION__)
|
||||
payload.time,
|
||||
# else
|
||||
# else
|
||||
0.0f,
|
||||
# endif
|
||||
# endif
|
||||
ray_tmin,
|
||||
ray_tmax,
|
||||
result);
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* __HAIR__ */
|
||||
# endif /* __HAIR__ */
|
||||
|
||||
#ifdef __POINTCLOUD__
|
||||
# ifdef __POINTCLOUD__
|
||||
ccl_device_inline void metalrt_intersection_point(
|
||||
constant KernelParamsMetal &launch_params_metal,
|
||||
ray_data MetalKernelContext::MetalRTIntersectionPayload &payload,
|
||||
|
@ -678,19 +685,20 @@ ccl_device_inline void metalrt_intersection_point(
|
|||
const float ray_tmax,
|
||||
thread BoundingBoxIntersectionResult &result)
|
||||
{
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
const uint visibility = payload.visibility;
|
||||
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
Intersection isect;
|
||||
isect.t = ray_tmax;
|
||||
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
if (context.point_intersect(
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type)) {
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type))
|
||||
{
|
||||
result = metalrt_visibility_test<BoundingBoxIntersectionResult, METALRT_HIT_BOUNDING_BOX>(
|
||||
launch_params_metal, payload, object, prim, isect.u);
|
||||
if (result.accept) {
|
||||
|
@ -716,19 +724,20 @@ ccl_device_inline void metalrt_intersection_point_shadow(
|
|||
const float ray_tmax,
|
||||
thread BoundingBoxIntersectionResult &result)
|
||||
{
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
# ifdef __VISIBILITY_FLAG__
|
||||
const uint visibility = payload.visibility;
|
||||
if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
|
||||
Intersection isect;
|
||||
isect.t = ray_tmax;
|
||||
|
||||
MetalKernelContext context(launch_params_metal);
|
||||
if (context.point_intersect(
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type)) {
|
||||
NULL, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type))
|
||||
{
|
||||
result.continue_search = metalrt_shadow_all_hit<METALRT_HIT_BOUNDING_BOX>(
|
||||
launch_params_metal, payload, object, prim, float2(isect.u, isect.v), ray_tmax);
|
||||
result.accept = !result.continue_search;
|
||||
|
@ -764,11 +773,11 @@ __intersection__point(constant KernelParamsMetal &launch_params_metal [[buffer(1
|
|||
type,
|
||||
ray_origin,
|
||||
ray_direction,
|
||||
# if defined(__METALRT_MOTION__)
|
||||
# if defined(__METALRT_MOTION__)
|
||||
payload.time,
|
||||
# else
|
||||
# else
|
||||
0.0f,
|
||||
# endif
|
||||
# endif
|
||||
ray_tmin,
|
||||
ray_tmax,
|
||||
result);
|
||||
|
@ -802,16 +811,16 @@ __intersection__point_shadow(constant KernelParamsMetal &launch_params_metal [[b
|
|||
type,
|
||||
ray_origin,
|
||||
ray_direction,
|
||||
# if defined(__METALRT_MOTION__)
|
||||
# if defined(__METALRT_MOTION__)
|
||||
payload.time,
|
||||
# else
|
||||
# else
|
||||
0.0f,
|
||||
# endif
|
||||
# endif
|
||||
ray_tmin,
|
||||
ray_tmax,
|
||||
result);
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* __POINTCLOUD__ */
|
||||
#endif /* __METALRT__ */
|
||||
# endif /* __POINTCLOUD__ */
|
||||
#endif /* __METALRT__ */
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#define ccl_loop_no_unroll
|
||||
#define ccl_optional_struct_init
|
||||
#define ccl_private
|
||||
#define ccl_ray_data ccl_private
|
||||
#define ccl_gpu_shared
|
||||
#define ATTR_FALLTHROUGH __attribute__((fallthrough))
|
||||
#define ccl_constant const
|
||||
|
|
|
@ -185,7 +185,7 @@ extern "C" __global__ void __anyhit__kernel_optix_shadow_all_hit()
|
|||
}
|
||||
|
||||
# ifdef __SHADOW_LINKING__
|
||||
if (intersection_skip_shadow_link(nullptr, ray, object)) {
|
||||
if (intersection_skip_shadow_link(nullptr, ray->self, object)) {
|
||||
return optixIgnoreIntersection();
|
||||
}
|
||||
# endif
|
||||
|
@ -334,7 +334,7 @@ extern "C" __global__ void __anyhit__kernel_optix_visibility_test()
|
|||
|
||||
if (visibility & PATH_RAY_SHADOW_OPAQUE) {
|
||||
#ifdef __SHADOW_LINKING__
|
||||
if (intersection_skip_shadow_link(nullptr, ray, object)) {
|
||||
if (intersection_skip_shadow_link(nullptr, ray->self, object)) {
|
||||
return optixIgnoreIntersection();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -48,6 +48,7 @@ typedef unsigned long long uint64_t;
|
|||
#define ccl_constant const
|
||||
#define ccl_gpu_shared __shared__
|
||||
#define ccl_private
|
||||
#define ccl_ray_data ccl_private
|
||||
#define ccl_may_alias
|
||||
#define ccl_restrict __restrict__
|
||||
#define ccl_loop_no_unroll
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
# define ccl_inline_constant inline constexpr
|
||||
# define ccl_constant const
|
||||
# define ccl_private
|
||||
# define ccl_ray_data ccl_private
|
||||
|
||||
# define ccl_restrict __restrict
|
||||
# define ccl_optional_struct_init
|
||||
|
|
|
@ -28,7 +28,7 @@ ccl_device bool ray_sphere_intersect(float3 ray_P,
|
|||
return false;
|
||||
}
|
||||
|
||||
const float d_sin_theta_sq = d_sq - d_cos_theta * d_cos_theta;
|
||||
const float d_sin_theta_sq = len_squared(d_vec - d_cos_theta * ray_D);
|
||||
|
||||
if (d_sin_theta_sq > r_sq) {
|
||||
/* Closest point on ray outside sphere. */
|
||||
|
|
|
@ -741,8 +741,34 @@ static string path_source_replace_includes_recursive(const string &source,
|
|||
const string &source_filepath,
|
||||
SourceReplaceState *state);
|
||||
|
||||
static string line_directive(const SourceReplaceState &state,
|
||||
const string &path,
|
||||
const size_t line_number)
|
||||
{
|
||||
string unescaped_path = path;
|
||||
/* First we make path relative. */
|
||||
if (string_startswith(unescaped_path, state.base.c_str())) {
|
||||
const string base_file = path_filename(state.base);
|
||||
const size_t base_len = state.base.length();
|
||||
unescaped_path = base_file +
|
||||
unescaped_path.substr(base_len, unescaped_path.length() - base_len);
|
||||
}
|
||||
/* Second, we replace all unsafe characters. */
|
||||
const size_t length = unescaped_path.length();
|
||||
string escaped_path = "";
|
||||
for (size_t i = 0; i < length; ++i) {
|
||||
const char ch = unescaped_path[i];
|
||||
if (strchr("\"\'\?\\", ch) != nullptr) {
|
||||
escaped_path += "\\";
|
||||
}
|
||||
escaped_path += ch;
|
||||
}
|
||||
return "#line " + std::to_string(line_number) + '"' + escaped_path + '"';
|
||||
}
|
||||
|
||||
static string path_source_handle_preprocessor(const string &preprocessor_line,
|
||||
const string &source_filepath,
|
||||
const size_t line_number,
|
||||
SourceReplaceState *state)
|
||||
{
|
||||
string result = preprocessor_line;
|
||||
|
@ -764,7 +790,8 @@ static string path_source_handle_preprocessor(const string &preprocessor_line,
|
|||
if (path_read_text(filepath, text)) {
|
||||
text = path_source_replace_includes_recursive(text, filepath, state);
|
||||
/* Use line directives for better error messages. */
|
||||
return "\n" + text + "\n";
|
||||
result = line_directive(*state, filepath, 1) + "\n" + text + "\n" +
|
||||
line_directive(*state, source_filepath, line_number + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -813,7 +840,7 @@ static string path_source_replace_includes_recursive(const string &_source,
|
|||
const size_t source_length = source.length();
|
||||
size_t index = 0;
|
||||
/* Information about where we are in the source. */
|
||||
size_t column_number = 1;
|
||||
size_t line_number = 0, column_number = 1;
|
||||
/* Currently gathered non-preprocessor token.
|
||||
* Store as start/length rather than token itself to avoid overhead of
|
||||
* memory re-allocations on each character concatenation.
|
||||
|
@ -833,7 +860,8 @@ static string path_source_replace_includes_recursive(const string &_source,
|
|||
|
||||
if (ch == '\n') {
|
||||
if (inside_preprocessor) {
|
||||
string block = path_source_handle_preprocessor(preprocessor_line, source_filepath, state);
|
||||
string block = path_source_handle_preprocessor(
|
||||
preprocessor_line, source_filepath, line_number, state);
|
||||
|
||||
if (!block.empty()) {
|
||||
result += block;
|
||||
|
@ -846,6 +874,7 @@ static string path_source_replace_includes_recursive(const string &_source,
|
|||
preprocessor_line = "";
|
||||
}
|
||||
column_number = 0;
|
||||
++line_number;
|
||||
}
|
||||
else if (ch == '#' && column_number == 1 && !inside_preprocessor) {
|
||||
/* Append all possible non-preprocessor token to the result. */
|
||||
|
@ -873,7 +902,8 @@ static string path_source_replace_includes_recursive(const string &_source,
|
|||
result.append(source, token_start, token_length);
|
||||
}
|
||||
if (inside_preprocessor) {
|
||||
result += path_source_handle_preprocessor(preprocessor_line, source_filepath, state);
|
||||
result += path_source_handle_preprocessor(
|
||||
preprocessor_line, source_filepath, line_number, state);
|
||||
}
|
||||
/* Store result for further reuse. */
|
||||
state->processed_files[source_filepath] = result;
|
||||
|
|
|
@ -229,13 +229,13 @@ class GHOST_DeviceVK {
|
|||
VkDeviceCreateInfo device_create_info = {};
|
||||
device_create_info.pNext = &maintenance_4;
|
||||
device_create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
|
||||
device_create_info.queueCreateInfoCount = static_cast<uint32_t>(queue_create_infos.size());
|
||||
device_create_info.queueCreateInfoCount = uint32_t(queue_create_infos.size());
|
||||
device_create_info.pQueueCreateInfos = queue_create_infos.data();
|
||||
/* layers_enabled are the same as instance extensions.
|
||||
* This is only needed for 1.0 implementations. */
|
||||
device_create_info.enabledLayerCount = static_cast<uint32_t>(layers_enabled.size());
|
||||
device_create_info.enabledLayerCount = uint32_t(layers_enabled.size());
|
||||
device_create_info.ppEnabledLayerNames = layers_enabled.data();
|
||||
device_create_info.enabledExtensionCount = static_cast<uint32_t>(extensions_device.size());
|
||||
device_create_info.enabledExtensionCount = uint32_t(extensions_device.size());
|
||||
device_create_info.ppEnabledExtensionNames = extensions_device.data();
|
||||
device_create_info.pEnabledFeatures = &device_features;
|
||||
|
||||
|
@ -947,9 +947,9 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext()
|
|||
VkInstanceCreateInfo create_info = {};
|
||||
create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
create_info.pApplicationInfo = &app_info;
|
||||
create_info.enabledLayerCount = static_cast<uint32_t>(layers_enabled.size());
|
||||
create_info.enabledLayerCount = uint32_t(layers_enabled.size());
|
||||
create_info.ppEnabledLayerNames = layers_enabled.data();
|
||||
create_info.enabledExtensionCount = static_cast<uint32_t>(extensions_enabled.size());
|
||||
create_info.enabledExtensionCount = uint32_t(extensions_enabled.size());
|
||||
create_info.ppEnabledExtensionNames = extensions_enabled.data();
|
||||
VK_CHECK(vkCreateInstance(&create_info, nullptr, &instance));
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
#include "GHOST_ISystem.hh"
|
||||
#include "GHOST_SystemHeadless.hh"
|
||||
|
@ -37,10 +38,15 @@ GHOST_TBacktraceFn GHOST_ISystem::m_backtrace_fn = nullptr;
|
|||
|
||||
GHOST_TSuccess GHOST_ISystem::createSystem(bool verbose, [[maybe_unused]] bool background)
|
||||
{
|
||||
|
||||
/* When GHOST fails to start, report the back-ends that were attempted.
|
||||
* A Verbose argument could be supported in printing isn't always desired. */
|
||||
const char *backends_attempted[8] = {nullptr};
|
||||
int backends_attempted_num = 0;
|
||||
struct GHOST_BackendInfo {
|
||||
const char *id = nullptr;
|
||||
/** The cause of the failure. */
|
||||
std::string failure_msg;
|
||||
};
|
||||
std::vector<GHOST_BackendInfo> backends_attempted;
|
||||
|
||||
GHOST_TSuccess success;
|
||||
if (!m_system) {
|
||||
|
@ -60,13 +66,13 @@ GHOST_TSuccess GHOST_ISystem::createSystem(bool verbose, [[maybe_unused]] bool b
|
|||
#elif defined(WITH_GHOST_X11) && defined(WITH_GHOST_WAYLAND)
|
||||
/* Special case, try Wayland, fall back to X11. */
|
||||
if (has_wayland_libraries) {
|
||||
backends_attempted[backends_attempted_num++] = "WAYLAND";
|
||||
backends_attempted.push_back({"WAYLAND"});
|
||||
try {
|
||||
m_system = new GHOST_SystemWayland(background);
|
||||
}
|
||||
catch (const std::runtime_error &e) {
|
||||
if (verbose) {
|
||||
fprintf(stderr, "GHOST: %s\n", e.what());
|
||||
backends_attempted.back().failure_msg = e.what();
|
||||
}
|
||||
delete m_system;
|
||||
m_system = nullptr;
|
||||
|
@ -81,33 +87,39 @@ GHOST_TSuccess GHOST_ISystem::createSystem(bool verbose, [[maybe_unused]] bool b
|
|||
|
||||
if (!m_system) {
|
||||
/* Try to fallback to X11. */
|
||||
backends_attempted[backends_attempted_num++] = "X11";
|
||||
backends_attempted.push_back({"X11"});
|
||||
try {
|
||||
m_system = new GHOST_SystemX11();
|
||||
}
|
||||
catch (const std::runtime_error &) {
|
||||
catch (const std::runtime_error &e) {
|
||||
if (verbose) {
|
||||
backends_attempted.back().failure_msg = e.what();
|
||||
}
|
||||
delete m_system;
|
||||
m_system = nullptr;
|
||||
}
|
||||
}
|
||||
#elif defined(WITH_GHOST_X11)
|
||||
backends_attempted[backends_attempted_num++] = "X11";
|
||||
backends_attempted.push_back({"X11"});
|
||||
try {
|
||||
m_system = new GHOST_SystemX11();
|
||||
}
|
||||
catch (const std::runtime_error &) {
|
||||
catch (const std::runtime_error &e) {
|
||||
if (verbose) {
|
||||
backends_attempted.back().failure_msg = e.what();
|
||||
}
|
||||
delete m_system;
|
||||
m_system = nullptr;
|
||||
}
|
||||
#elif defined(WITH_GHOST_WAYLAND)
|
||||
if (has_wayland_libraries) {
|
||||
backends_attempted[backends_attempted_num++] = "WAYLAND";
|
||||
backends_attempted.push_back({"WAYLAND"});
|
||||
try {
|
||||
m_system = new GHOST_SystemWayland(background);
|
||||
}
|
||||
catch (const std::runtime_error &e) {
|
||||
if (verbose) {
|
||||
fprintf(stderr, "GHOST: %s\n", e.what());
|
||||
backends_attempted.back().failure_msg = e.what();
|
||||
}
|
||||
delete m_system;
|
||||
m_system = nullptr;
|
||||
|
@ -120,36 +132,53 @@ GHOST_TSuccess GHOST_ISystem::createSystem(bool verbose, [[maybe_unused]] bool b
|
|||
m_system = nullptr;
|
||||
}
|
||||
#elif defined(WITH_GHOST_SDL)
|
||||
backends_attempted[backends_attempted_num++] = "SDL";
|
||||
backends_attempted.push_back({"SDL"});
|
||||
try {
|
||||
m_system = new GHOST_SystemSDL();
|
||||
}
|
||||
catch (const std::runtime_error &) {
|
||||
catch (const std::runtime_error &e) {
|
||||
if (verbose) {
|
||||
backends_attempted.back().failure_msg = e.what();
|
||||
}
|
||||
delete m_system;
|
||||
m_system = nullptr;
|
||||
}
|
||||
#elif defined(WIN32)
|
||||
backends_attempted[backends_attempted_num++] = "WIN32";
|
||||
backends_attempted.push_back({"WIN32"});
|
||||
m_system = new GHOST_SystemWin32();
|
||||
#elif defined(__APPLE__)
|
||||
backends_attempted[backends_attempted_num++] = "COCOA";
|
||||
backends_attempted.push_back({"COCOA"});
|
||||
m_system = new GHOST_SystemCocoa();
|
||||
#endif
|
||||
|
||||
if (m_system) {
|
||||
m_system_backend_id = backends_attempted[backends_attempted_num - 1];
|
||||
m_system_backend_id = backends_attempted.back().id;
|
||||
}
|
||||
else if (verbose) {
|
||||
bool show_messages = false;
|
||||
fprintf(stderr, "GHOST: failed to initialize display for back-end(s): [");
|
||||
for (int i = 0; i < backends_attempted_num; i++) {
|
||||
for (int i = 0; i < backends_attempted.size(); i++) {
|
||||
const GHOST_BackendInfo &backend_item = backends_attempted[i];
|
||||
if (i != 0) {
|
||||
fprintf(stderr, ", ");
|
||||
}
|
||||
fprintf(stderr, "'%s'", backends_attempted[i]);
|
||||
fprintf(stderr, "'%s'", backend_item.id);
|
||||
if (!backend_item.failure_msg.empty()) {
|
||||
show_messages = true;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "]\n");
|
||||
if (show_messages) {
|
||||
for (int i = 0; i < backends_attempted.size(); i++) {
|
||||
const GHOST_BackendInfo &backend_item = backends_attempted[i];
|
||||
fprintf(stderr,
|
||||
" '%s': %s\n",
|
||||
backend_item.id,
|
||||
backend_item.failure_msg.empty() ? "<unknown>" :
|
||||
backend_item.failure_msg.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
success = m_system != nullptr ? GHOST_kSuccess : GHOST_kFailure;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1763,7 +1763,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
|
|||
dx = [event scrollingDeltaX];
|
||||
dy = [event scrollingDeltaY];
|
||||
|
||||
/* However, Wacom tablet (intuos5) needs old deltas,
|
||||
/* However, WACOM tablet (intuos5) needs old deltas,
|
||||
* it then has momentum and phase at zero. */
|
||||
if (phase == NSEventPhaseNone && momentumPhase == NSEventPhaseNone) {
|
||||
dx = [event deltaX];
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
GHOST_SystemSDL::GHOST_SystemSDL() : GHOST_System()
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
|
||||
throw std::runtime_error("Error initializing SDL: " + std::string(SDL_GetError()));
|
||||
throw std::runtime_error(SDL_GetError());
|
||||
}
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
|
|
|
@ -3736,7 +3736,8 @@ static void keyboard_handle_keymap(void *data,
|
|||
char *map_str = static_cast<char *>(mmap(nullptr, size, PROT_READ, MAP_PRIVATE, fd, 0));
|
||||
if (map_str == MAP_FAILED) {
|
||||
close(fd);
|
||||
throw std::runtime_error("keymap mmap failed: " + std::string(std::strerror(errno)));
|
||||
CLOG_INFO(LOG, 2, "keymap mmap failed: %s", std::strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
xkb_keymap *keymap = xkb_keymap_new_from_string(
|
||||
|
@ -5596,7 +5597,7 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
|
|||
display_->wl.display = wl_display_connect(nullptr);
|
||||
if (!display_->wl.display) {
|
||||
display_destroy_and_free_all();
|
||||
throw std::runtime_error("Wayland: unable to connect to display!");
|
||||
throw std::runtime_error("unable to connect to display!");
|
||||
}
|
||||
|
||||
/* This may be removed later if decorations are required, needed as part of registration. */
|
||||
|
@ -5649,7 +5650,7 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
|
|||
"falling back to X11\n");
|
||||
# endif
|
||||
display_destroy_and_free_all();
|
||||
throw std::runtime_error("Wayland: unable to find libdecor!");
|
||||
throw std::runtime_error("unable to find libdecor!");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -5664,7 +5665,7 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
|
|||
decor.context = libdecor_new(display_->wl.display, &libdecor_interface);
|
||||
if (!decor.context) {
|
||||
display_destroy_and_free_all();
|
||||
throw std::runtime_error("Wayland: unable to create window decorations!");
|
||||
throw std::runtime_error("unable to create window decorations!");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -5675,7 +5676,7 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
|
|||
const GWL_XDG_Decor_System &decor = *display_->xdg_decor;
|
||||
if (!decor.shell) {
|
||||
display_destroy_and_free_all();
|
||||
throw std::runtime_error("Wayland: unable to access xdg_shell!");
|
||||
throw std::runtime_error("unable to access xdg_shell!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ GHOST_SystemX11::GHOST_SystemX11()
|
|||
m_display = XOpenDisplay(nullptr);
|
||||
|
||||
if (!m_display) {
|
||||
throw std::runtime_error("X11: Unable to open a display");
|
||||
throw std::runtime_error("unable to open a display!");
|
||||
}
|
||||
|
||||
#ifdef USE_X11_ERROR_HANDLERS
|
||||
|
@ -482,7 +482,7 @@ static void SleepTillEvent(Display *display, int64_t maxSleep)
|
|||
}
|
||||
}
|
||||
|
||||
/* This function borrowed from Qt's X11 support qclipboard_x11.cpp */
|
||||
/* This function borrowed from QT's X11 support `qclipboard_x11.cpp`. */
|
||||
struct init_timestamp_data {
|
||||
Time timestamp;
|
||||
};
|
||||
|
|
|
@ -153,7 +153,13 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
|
|||
# if defined(WITH_GHOST_X11)
|
||||
/* #GHOST_SystemX11. */
|
||||
oxr_binding.egl.type = XR_TYPE_GRAPHICS_BINDING_EGL_MNDX;
|
||||
oxr_binding.egl.getProcAddress = eglGetProcAddress;
|
||||
# if XR_CURRENT_API_VERSION >= XR_MAKE_VERSION(1, 0, 29)
|
||||
oxr_binding.egl.getProcAddress = reinterpret_cast<PFN_xrEglGetProcAddressMNDX>(
|
||||
eglGetProcAddress);
|
||||
# else
|
||||
oxr_binding.egl.getProcAddress = reinterpret_cast<PFNEGLGETPROCADDRESSPROC>(
|
||||
eglGetProcAddress);
|
||||
# endif
|
||||
oxr_binding.egl.display = ctx_egl.getDisplay();
|
||||
oxr_binding.egl.config = ctx_egl.getConfig();
|
||||
oxr_binding.egl.context = ctx_egl.getContext();
|
||||
|
|
|
@ -224,7 +224,7 @@ class pySketchyChainSilhouetteIterator(ChainingIterator):
|
|||
# keeping this local saves passing a reference to 'self' around
|
||||
def make_sketchy(self, ve):
|
||||
"""
|
||||
Creates the skeychy effect by causing the chain to run from
|
||||
Creates the sketchy effect by causing the chain to run from
|
||||
the start again. (loop over itself again)
|
||||
"""
|
||||
if ve is None:
|
||||
|
@ -459,9 +459,8 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
|
|||
self._percent = float(percent)
|
||||
|
||||
def init(self):
|
||||
# each time we're evaluating a chain length
|
||||
# we try to do it once. Thus we reinit
|
||||
# the chain length here:
|
||||
# Each time we're evaluating a chain length we try to do it once.
|
||||
# Thus we reinitialize the chain length here:
|
||||
self._length = 0.0
|
||||
|
||||
def traverse(self, iter):
|
||||
|
@ -531,7 +530,7 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
|
|||
self._percent = percent
|
||||
|
||||
def init(self):
|
||||
# A chain's length should preverably be evaluated only once.
|
||||
# A chain's length should preferably be evaluated only once.
|
||||
# Therefore, the chain length is reset here.
|
||||
self._length = 0.0
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : shaders.py
|
||||
# Authors : Fredo Durand, Stephane Grabli, Francois Sillion, Emmanuel Turquin
|
||||
# Date : 11/08/2005
|
||||
# Purpose : Stroke shaders to be used for creation of stylized strokes
|
||||
|
@ -834,7 +833,7 @@ class pyPerlinNoise1DShader(StrokeShader):
|
|||
"""
|
||||
Displaces the stroke using the curvilinear abscissa. This means
|
||||
that lines with the same length and sampling interval will be
|
||||
identically distorded.
|
||||
identically distorted.
|
||||
"""
|
||||
|
||||
def __init__(self, freq=10, amp=10, oct=4, seed=-1):
|
||||
|
@ -855,10 +854,10 @@ class pyPerlinNoise1DShader(StrokeShader):
|
|||
class pyPerlinNoise2DShader(StrokeShader):
|
||||
"""
|
||||
Displaces the stroke using the strokes coordinates. This means
|
||||
that in a scene no strokes will be distorded identically.
|
||||
that in a scene no strokes will be distorted identically.
|
||||
|
||||
More information on the noise shaders can be found at:
|
||||
freestyleintegration.wordpress.com/2011/09/25/development-updates-on-september-25/
|
||||
https://freestyleintegration.wordpress.com/2011/09/25/development-updates-on-september-25/
|
||||
"""
|
||||
|
||||
def __init__(self, freq=10, amp=10, oct=4, seed=-1):
|
||||
|
@ -898,7 +897,7 @@ class pyBluePrintCirclesShader(StrokeShader):
|
|||
C = self.__random_center
|
||||
|
||||
# The directions (and phases) are calculated using a separate
|
||||
# function decorated with an lru-cache. This guarantees that
|
||||
# function decorated with an LRU-cache. This guarantees that
|
||||
# the directions (involving sin and cos) are calculated as few
|
||||
# times as possible.
|
||||
#
|
||||
|
@ -977,7 +976,7 @@ class pyBluePrintEllipsesShader(StrokeShader):
|
|||
class pyBluePrintSquaresShader(StrokeShader):
|
||||
def __init__(self, turns=1, bb_len=10, bb_rand=0):
|
||||
StrokeShader.__init__(self)
|
||||
self.__turns = turns # does not have any effect atm
|
||||
self.__turns = turns # Does not have any effect ATM.
|
||||
self.__bb_len = bb_len
|
||||
self.__bb_rand = bb_rand
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ def normal_at_I0D(it: Interface0DIterator) -> Vector:
|
|||
# give iterator back in original state
|
||||
it.decrement()
|
||||
elif it.is_end:
|
||||
# just fail hard: this shouldn not happen
|
||||
# Just fail hard: this should not happen.
|
||||
raise StopIteration()
|
||||
else:
|
||||
# this case sometimes has a small difference with Normal2DF0D (1e-3 -ish)
|
||||
|
@ -197,8 +197,8 @@ def phase_to_direction(length):
|
|||
return results
|
||||
|
||||
|
||||
# -- simplification of a set of points; based on simplify.js by Vladimir Agafonkin --
|
||||
# https://mourner.github.io/simplify-js/
|
||||
# Simplification of a set of points; based on `simplify.js`:
|
||||
# See: https://mourner.github.io/simplify-js
|
||||
|
||||
def getSquareSegmentDistance(p, p1, p2):
|
||||
"""
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : parameter_editor.py
|
||||
# Authors : Tamito Kajiyama
|
||||
# Date : 26/07/2010
|
||||
# Purpose : Interactive manipulation of stylization parameters
|
||||
|
@ -811,7 +810,7 @@ class PerlinNoise1DShader(StrokeShader):
|
|||
"""
|
||||
Displaces the stroke using the curvilinear abscissa. This means
|
||||
that lines with the same length and sampling interval will be
|
||||
identically distorded.
|
||||
identically distorted.
|
||||
"""
|
||||
|
||||
def __init__(self, freq=10, amp=10, oct=4, angle=radians(45), seed=-1):
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : anisotropic_diffusion.py
|
||||
# Author : Fredo Durand
|
||||
# Date : 12/08/2004
|
||||
# Purpose : Smooth lines using an anisotropic diffusion scheme
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : apriori_and_causal_density.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Selects the lines with high a priori density and
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : apriori_density.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws lines having a high a prior density
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : backbone_stretcher.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Stretches the geometry of visible lines
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : blueprint_circles.py
|
||||
# Author : Emmanuel Turquin
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Produces a blueprint using circular contour strokes
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : blueprint_ellipses.py
|
||||
# Author : Emmanuel Turquin
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Produces a blueprint using elliptic contour strokes
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : blueprint_squares.py
|
||||
# Author : Emmanuel Turquin
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Produces a blueprint using square contour strokes
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : cartoon.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws colored lines. The color is automatically
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : contour.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws each object's visible contour
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : curvature2d.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The stroke points are colored in gray levels and depending
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : external_contour.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the external contour of the scene
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : external_contour_sketchy.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the external contour of the scene using a sketchy
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : external_contour_smooth.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws a smooth external contour
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : haloing.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : This style module selects the lines that
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : ignore_small_occlusions.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The strokes are drawn through small occlusions
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : invisible_lines.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws all lines whose Quantitative Invisibility
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : japanese_bigbrush.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Simulates a big brush fr oriental painting
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : long_anisotropically_dense.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Selects the lines that are long and have a high anisotropic
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : multiple_parameterization.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The thickness and the color of the strokes vary continuously
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : nature.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Uses the NatureUP1D predicate to select the lines
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : near_lines.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the lines that are "closer" than a threshold
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : occluded_by_specific_object.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws only the lines that are occluded by a given object
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : polygonalize.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Make the strokes more "polygonal"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : qi0.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : qi0_not_external_contour.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : qi1.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws lines hidden by one surface.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : qi2.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws lines hidden by two surfaces.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : sequentialsplit_sketchy.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Use the sequential split with two different
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : sketchy_multiple_parameterization.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Builds sketchy strokes whose topology relies on a
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : sketchy_topology_broken.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The topology of the strokes is, first, built
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : sketchy_topology_preserved.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : The topology of the strokes is built
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : split_at_highest_2d_curvature.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : split_at_tvertices.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws strokes that starts and stops at Tvertices (visible or not)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : suggestive.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Draws the suggestive contours.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : thickness_fof_depth_discontinuity.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Assigns to strokes a thickness that depends on the depth discontinuity
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : tipremover.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Removes strokes extremities
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : tvertex_remover.py
|
||||
# Author : Stephane Grabli
|
||||
# Date : 04/08/2005
|
||||
# Purpose : Removes TVertices
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Filename : uniformpruning_zsort.py
|
||||
# Authors : Fredo Durand, Stephane Grabli, Francois Sillion, Emmanuel Turquin
|
||||
# Date : 08/04/2005
|
||||
|
||||
|
|
|
@ -441,9 +441,9 @@ def disable(module_name, *, default_set=False, handle_error=None):
|
|||
|
||||
mod = sys.modules.get(module_name)
|
||||
|
||||
# possible this addon is from a previous session and didn't load a
|
||||
# Possible this add-on is from a previous session and didn't load a
|
||||
# module this time. So even if the module is not found, still disable
|
||||
# the addon in the user prefs.
|
||||
# the add-on in the user preferences.
|
||||
if mod and getattr(mod, "__addon_enabled__", False) is not False:
|
||||
mod.__addon_enabled__ = False
|
||||
mod.__addon_persistent = False
|
||||
|
|
|
@ -23,7 +23,7 @@ _app_template = {
|
|||
"id": "",
|
||||
}
|
||||
|
||||
# instead of sys.modules
|
||||
# Instead of `sys.modules`
|
||||
# note that we only ever have one template enabled at a time
|
||||
# so it may not seem necessary to use this.
|
||||
#
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Copyright (c) 2009 www.stani.be
|
||||
# Copyright (c) 2009 https://www.stani.be
|
||||
|
||||
"""Package for console specific modules."""
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Copyright (c) 2009 www.stani.be
|
||||
# Copyright (c) 2009 https://www.stani.be
|
||||
|
||||
import inspect
|
||||
import re
|
||||
|
@ -131,7 +131,7 @@ def get_argspec(func, *, strip_self=True, doc=None, source=None):
|
|||
|
||||
|
||||
def complete(line, cursor, namespace):
|
||||
"""Complete callable with calltip.
|
||||
"""Complete callable with call-tip.
|
||||
|
||||
:arg line: incomplete text line
|
||||
:type line: str
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Copyright (c) 2009 Fernando Perez, www.stani.be
|
||||
# Copyright (c) 2009 Fernando Perez, https://www.stani.be
|
||||
|
||||
# Original copyright (see doc-string):
|
||||
# ****************************************************************************
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Copyright (c) 2009 www.stani.be
|
||||
# Copyright (c) 2009 https://www.stani.be
|
||||
|
||||
"""Autocomplete with the standard library"""
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Copyright (c) 2009 www.stani.be
|
||||
# Copyright (c) 2009 https://www.stani.be
|
||||
|
||||
"""This module provides intellisense features such as:
|
||||
|
||||
|
|
|
@ -1105,7 +1105,7 @@ def dump_addon_messages(module_name, do_checks, settings):
|
|||
dump_rna_messages(msgs, reports, settings)
|
||||
print("C")
|
||||
|
||||
# Now disable our addon, and rescan RNA.
|
||||
# Now disable our addon, and re-scan RNA.
|
||||
utils.enable_addons(addons={module_name}, disable=True)
|
||||
print("D")
|
||||
reports["check_ctxt"] = minus_check_ctxt
|
||||
|
|
|
@ -26,13 +26,13 @@ except ModuleNotFoundError:
|
|||
|
||||
# The languages defined in Blender.
|
||||
LANGUAGES_CATEGORIES = (
|
||||
# Min completeness level, UI english label.
|
||||
# Min completeness level, UI English label.
|
||||
(0.95, "Complete"),
|
||||
(0.33, "In Progress"),
|
||||
(-1.0, "Starting"),
|
||||
)
|
||||
LANGUAGES = (
|
||||
# ID, UI english label, ISO code.
|
||||
# ID, UI English label, ISO code.
|
||||
(0, "Automatic (Automatic)", "DEFAULT"),
|
||||
(1, "English (English)", "en_US"),
|
||||
(2, "Japanese (日本語)", "ja_JP"),
|
||||
|
@ -195,8 +195,8 @@ PYGETTEXT_CONTEXTS = "#define\\s+(BLT_I18NCONTEXT_[A-Z_0-9]+)\\s+\"([^\"]*)\""
|
|||
# autopep8: off
|
||||
|
||||
# Keywords' regex.
|
||||
# XXX Most unfortunately, we can't use named backreferences inside character sets,
|
||||
# which makes the regexes even more twisty... :/
|
||||
# XXX Most unfortunately, we can't use named back-references inside character sets,
|
||||
# which makes the REGEXES even more twisty... :/
|
||||
_str_base = (
|
||||
# Match void string
|
||||
"(?P<{_}1>[\"'])(?P={_}1)" # Get opening quote (' or "), and closing immediately.
|
||||
|
@ -258,7 +258,7 @@ PYGETTEXT_KEYWORDS = (() +
|
|||
tuple(("{}\\((?:[^,]+,){{2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
|
||||
for it in ("modifier_subpanel_register", "gpencil_modifier_subpanel_register")) +
|
||||
|
||||
# Node socket declarations: contextless names
|
||||
# Node socket declarations: context-less names.
|
||||
tuple((r"\.{}<decl::.*?>\(\s*" + _msg_re + r"(?:,[^),]+)*\s*\)"
|
||||
r"(?![^;]*\.translation_context\()").format(it)
|
||||
for it in ("add_input", "add_output")) +
|
||||
|
|
|
@ -133,9 +133,9 @@ def find_best_isocode_matches(uid, iso_codes):
|
|||
|
||||
def get_po_files_from_dir(root_dir, langs=set()):
|
||||
"""
|
||||
Yield tuples (uid, po_path) of translations for each po file found in the given dir, which should be either
|
||||
a dir containing po files using language uid's as names (e.g. fr.po, es_ES.po, etc.), or
|
||||
a dir containing dirs which names are language uids, and containing po files of the same names.
|
||||
Yield tuples (uid, po_path) of translations for each po file found in the given directory, which should be either
|
||||
a directory containing po files using language uid's as names (e.g. fr.po, es_ES.po, etc.), or
|
||||
a directory containing directories which names are language uids, and containing po files of the same names.
|
||||
"""
|
||||
found_uids = set()
|
||||
for p in os.listdir(root_dir):
|
||||
|
@ -324,12 +324,12 @@ class I18nMessage:
|
|||
sources = property(_get_sources, _set_sources)
|
||||
|
||||
def _get_is_tooltip(self):
|
||||
# XXX For now, we assume that all messages > 30 chars are tooltips!
|
||||
# XXX For now, we assume that all messages > 30 chars are tool-tips!
|
||||
return len(self.msgid) > 30
|
||||
is_tooltip = property(_get_is_tooltip)
|
||||
|
||||
def copy(self):
|
||||
# Deepcopy everything but the settings!
|
||||
# Deep-copy everything but the settings!
|
||||
return self.__class__(msgctxt_lines=self.msgctxt_lines[:], msgid_lines=self.msgid_lines[:],
|
||||
msgstr_lines=self.msgstr_lines[:], comment_lines=self.comment_lines[:],
|
||||
is_commented=self.is_commented, is_fuzzy=self.is_fuzzy, settings=self.settings)
|
||||
|
@ -345,7 +345,7 @@ class I18nMessage:
|
|||
lns = text.splitlines()
|
||||
return [l + "\n" for l in lns[:-1]] + lns[-1:]
|
||||
|
||||
# We do not need the full power of textwrap... We just split first at escaped new lines, then into each line
|
||||
# We do not need the full power of text-wrap... We just split first at escaped new lines, then into each line
|
||||
# if needed... No word splitting, nor fancy spaces handling!
|
||||
def _wrap(text, max_len, init_len):
|
||||
if len(text) + init_len < max_len:
|
||||
|
|
|
@ -22,7 +22,7 @@ FLAG_MESSAGES = {
|
|||
|
||||
def gen_menu_file(stats, settings):
|
||||
# Generate languages file content used by Blender's i18n system.
|
||||
# First, match all entries in LANGUAGES to a lang in stats, if possible!
|
||||
# First, match all entries in LANGUAGES to a `lang` in stats, if possible!
|
||||
# Returns a iterable of text lines.
|
||||
tmp = []
|
||||
for uid_num, label, uid in settings.LANGUAGES:
|
||||
|
|
|
@ -128,7 +128,7 @@ def protect_format_seq(msg):
|
|||
def log2vis(msgs, settings):
|
||||
"""
|
||||
Globally mimics deprecated fribidi_log2vis.
|
||||
msgs should be an iterable of messages to rtl-process.
|
||||
msgs should be an iterable of messages to RTL-process.
|
||||
"""
|
||||
fbd = ctypes.CDLL(settings.FRIBIDI_LIB)
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@ class SpellChecker:
|
|||
"freestyle",
|
||||
"enum", "enums",
|
||||
"gizmogroup",
|
||||
"gon", "gons", # N-Gon(s)
|
||||
"gon", "gons", # N-GON(s)
|
||||
"gpencil",
|
||||
"idcol",
|
||||
"keyframe", "keyframes", "keyframing", "keyframed",
|
||||
|
@ -786,7 +786,7 @@ class SpellChecker:
|
|||
"rgb", "rgba",
|
||||
"ris",
|
||||
"rhs",
|
||||
"rpp", # Eevee ray-tracing?
|
||||
"rpp", # EEVEE ray-tracing?
|
||||
"rv",
|
||||
"sdf",
|
||||
"sdl",
|
||||
|
@ -816,7 +816,7 @@ class SpellChecker:
|
|||
"bpy",
|
||||
"bvh",
|
||||
"dbvt",
|
||||
"dop", # BLI K-Dop BVH
|
||||
"dop", # BLI K-DOP BVH
|
||||
"ik",
|
||||
"nla",
|
||||
"py",
|
||||
|
|
|
@ -57,7 +57,9 @@ def main():
|
|||
|
||||
# Initializes Python classes.
|
||||
# (good place to run a profiler or trace).
|
||||
utils.load_scripts()
|
||||
# Postpone loading `extensions` scripts (add-ons & app-templates),
|
||||
# until after the key-maps have been initialized.
|
||||
utils.load_scripts(extensions=False)
|
||||
|
||||
|
||||
main()
|
||||
|
|
|
@ -189,7 +189,7 @@ _global_loaded_modules = [] # store loaded module names for reloading.
|
|||
import bpy_types as _bpy_types # keep for comparisons, never ever reload this.
|
||||
|
||||
|
||||
def load_scripts(*, reload_scripts=False, refresh_scripts=False):
|
||||
def load_scripts(*, reload_scripts=False, refresh_scripts=False, extensions=True):
|
||||
"""
|
||||
Load scripts and run each modules register function.
|
||||
|
||||
|
@ -199,6 +199,8 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False):
|
|||
:arg refresh_scripts: only load scripts which are not already loaded
|
||||
as modules.
|
||||
:type refresh_scripts: bool
|
||||
:arg: extensions: Loads additional scripts (add-ons & app-templates).
|
||||
:type: extensions: bool
|
||||
"""
|
||||
use_time = use_class_register_check = _bpy.app.debug_python
|
||||
use_user = not _is_factory_startup
|
||||
|
@ -306,21 +308,8 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False):
|
|||
for mod in modules_from_path(path, loaded_modules):
|
||||
test_register(mod)
|
||||
|
||||
# load template (if set)
|
||||
if any(_bpy.utils.app_template_paths()):
|
||||
import bl_app_template_utils
|
||||
bl_app_template_utils.reset(reload_scripts=reload_scripts)
|
||||
del bl_app_template_utils
|
||||
|
||||
# Deal with add-ons separately.
|
||||
_initialize_once = getattr(_addon_utils, "_initialize_once", None)
|
||||
if _initialize_once is not None:
|
||||
# First time, use fast-path.
|
||||
_initialize_once()
|
||||
del _addon_utils._initialize_once
|
||||
else:
|
||||
_addon_utils.reset_all(reload_scripts=reload_scripts)
|
||||
del _initialize_once
|
||||
if extensions:
|
||||
load_scripts_extensions(reload_scripts=reload_scripts)
|
||||
|
||||
if reload_scripts:
|
||||
_bpy.context.window_manager.tag_script_reload()
|
||||
|
@ -342,6 +331,31 @@ def load_scripts(*, reload_scripts=False, refresh_scripts=False):
|
|||
)
|
||||
|
||||
|
||||
def load_scripts_extensions(*, reload_scripts=False):
|
||||
"""
|
||||
Load extensions scripts (add-ons and app-templates)
|
||||
|
||||
:arg reload_scripts: Causes all scripts to have their unregister method
|
||||
called before loading.
|
||||
:type reload_scripts: bool
|
||||
"""
|
||||
# load template (if set)
|
||||
if any(_bpy.utils.app_template_paths()):
|
||||
import bl_app_template_utils
|
||||
bl_app_template_utils.reset(reload_scripts=reload_scripts)
|
||||
del bl_app_template_utils
|
||||
|
||||
# deal with addons separately
|
||||
_initialize = getattr(_addon_utils, "_initialize", None)
|
||||
if _initialize is not None:
|
||||
# first time, use fast-path
|
||||
_initialize()
|
||||
del _addon_utils._initialize
|
||||
else:
|
||||
_addon_utils.reset_all(reload_scripts=reload_scripts)
|
||||
del _initialize
|
||||
|
||||
|
||||
def script_path_user():
|
||||
"""returns the env var and falls back to home dir or None"""
|
||||
path = _user_resource('SCRIPTS')
|
||||
|
@ -659,17 +673,18 @@ def preset_find(name, preset_path, *, display_name=False, ext=".py"):
|
|||
def keyconfig_init():
|
||||
# Key configuration initialization and refresh, called from the Blender
|
||||
# window manager on startup and refresh.
|
||||
default_config = "Blender"
|
||||
active_config = _preferences.keymap.active_keyconfig
|
||||
|
||||
# Load the default key configuration.
|
||||
default_filepath = preset_find("Blender", "keyconfig")
|
||||
keyconfig_set(default_filepath)
|
||||
filepath = preset_find(default_config, "keyconfig")
|
||||
keyconfig_set(filepath)
|
||||
|
||||
# Set the active key configuration if different
|
||||
filepath = preset_find(active_config, "keyconfig")
|
||||
|
||||
if filepath and filepath != default_filepath:
|
||||
keyconfig_set(filepath)
|
||||
# Set the active key configuration if different.
|
||||
if default_config != active_config:
|
||||
filepath = preset_find(active_config, "keyconfig")
|
||||
if filepath:
|
||||
keyconfig_set(filepath)
|
||||
|
||||
|
||||
def keyconfig_set(filepath, *, report=None):
|
||||
|
@ -679,6 +694,10 @@ def keyconfig_set(filepath, *, report=None):
|
|||
print("loading preset:", filepath)
|
||||
|
||||
keyconfigs = _bpy.context.window_manager.keyconfigs
|
||||
name = splitext(basename(filepath))[0]
|
||||
|
||||
# Store the old key-configuration case of error, to know if it should be removed or not on failure.
|
||||
kc_old = keyconfigs.get(name)
|
||||
|
||||
try:
|
||||
error_msg = ""
|
||||
|
@ -687,14 +706,13 @@ def keyconfig_set(filepath, *, report=None):
|
|||
import traceback
|
||||
error_msg = traceback.format_exc()
|
||||
|
||||
name = splitext(basename(filepath))[0]
|
||||
kc_new = keyconfigs.get(name)
|
||||
|
||||
if error_msg:
|
||||
if report is not None:
|
||||
report({'ERROR'}, error_msg)
|
||||
print(error_msg)
|
||||
if kc_new is not None:
|
||||
if (kc_new is not None) and (kc_new != kc_old):
|
||||
keyconfigs.remove(kc_new)
|
||||
return False
|
||||
|
||||
|
|
|
@ -364,7 +364,7 @@ def bake_action_iter(
|
|||
while obj.constraints:
|
||||
obj.constraints.remove(obj.constraints[0])
|
||||
|
||||
# Create compatible eulers, quats.
|
||||
# Create compatible euler & quaternion rotations.
|
||||
euler_prev = None
|
||||
quat_prev = None
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ class ProgressReport:
|
|||
|
||||
This object can be used as a context manager.
|
||||
|
||||
It supports multiple levels of 'substeps' - you shall always enter at least one substep (because level 0
|
||||
It supports multiple levels of 'sub-steps' - you shall always enter at least one sub-step (because level 0
|
||||
has only one single step, representing the whole 'area' of the progress stuff).
|
||||
|
||||
You should give the expected number of substeps each time you enter a new one (you may then step more or less then
|
||||
You should give the expected number of sub-steps each time you enter a new one (you may then step more or less then
|
||||
given number, but this will give incoherent progression).
|
||||
|
||||
Leaving a substep automatically steps by one the parent level.
|
||||
Leaving a sub-step automatically steps by one the parent level.
|
||||
|
||||
with ProgressReport() as progress: # Not giving a WindowManager here will default to console printing.
|
||||
progress.enter_substeps(10)
|
||||
|
@ -110,7 +110,7 @@ class ProgressReportSubstep:
|
|||
|
||||
Its exit method always ensure ProgressReport is back on 'level' it was before entering this context.
|
||||
This means it is especially useful to ensure a coherent behavior around code that could return/continue/break
|
||||
from many places, without having to bother to explicitly leave substep in each and every possible place!
|
||||
from many places, without having to bother to explicitly leave sub-step in each and every possible place!
|
||||
|
||||
with ProgressReport() as progress: # Not giving a WindowManager here will default to console printing.
|
||||
with ProgressReportSubstep(progress, 10, final_msg="Finished!") as subprogress1:
|
||||
|
@ -122,7 +122,7 @@ class ProgressReportSubstep:
|
|||
__slots__ = ("progress", "nbr", "msg", "final_msg", "level")
|
||||
|
||||
def __init__(self, progress, nbr, msg="", final_msg=""):
|
||||
# Allows to generate a subprogress context handler from another one.
|
||||
# Allows to generate a sub-progress context handler from another one.
|
||||
progress = getattr(progress, "progress", progress)
|
||||
|
||||
self.progress = progress
|
||||
|
|
|
@ -973,7 +973,7 @@ class _GenericUI:
|
|||
for func in draw_ls._draw_funcs:
|
||||
|
||||
# Begin 'owner_id' filter.
|
||||
# Exclude Import/Export menus from this filtering (io addons should always show there)
|
||||
# Exclude Import/Export menus from this filtering (IO add-ons should always show there).
|
||||
if not getattr(self, "bl_owner_use_filter", True):
|
||||
pass
|
||||
elif owner_names is not None:
|
||||
|
|
|
@ -298,7 +298,7 @@ def copy_as_script(context):
|
|||
text = line.body
|
||||
type = line.type
|
||||
|
||||
if type == 'INFO': # ignore autocomp.
|
||||
if type == 'INFO': # Ignore auto-completion.
|
||||
continue
|
||||
if type == 'INPUT':
|
||||
if text.startswith(PROMPT):
|
||||
|
|
|
@ -118,7 +118,7 @@ def register_node_categories(identifier, cat_list):
|
|||
if cat.poll(context):
|
||||
layout.menu("NODE_MT_category_%s" % cat.identifier)
|
||||
|
||||
# stores: (categories list, menu draw function, submenu types)
|
||||
# Stores: (categories list, menu draw function, sub-menu types).
|
||||
_node_categories[identifier] = (cat_list, draw_add_menu, menu_types)
|
||||
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ def draw(layout, context, context_member, property_type, *, use_edit=True):
|
|||
operator_row.alignment = 'RIGHT'
|
||||
|
||||
# Do not allow editing of overridden properties (we cannot use a poll function
|
||||
# of the operators here since they's have no access to the specific property).
|
||||
# of the operators here since they have no access to the specific property).
|
||||
operator_row.enabled = not (is_lib_override and key in rna_item.id_data.override_library.reference)
|
||||
|
||||
if use_edit:
|
||||
|
|
|
@ -106,7 +106,7 @@ def rna2xml(
|
|||
if issubclass(value_type, skip_classes):
|
||||
return
|
||||
|
||||
# XXX, fixme, pointcache has eternal nested pointer to itself.
|
||||
# XXX, FIXME, point-cache has eternal nested pointer to itself.
|
||||
if value == parent:
|
||||
return
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
>
|
||||
<wcol_regular>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#dbdbdbff"
|
||||
inner_sel="#668cccff"
|
||||
item="#191919ff"
|
||||
|
@ -48,7 +48,7 @@
|
|||
</wcol_regular>
|
||||
<wcol_tool>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#dbdbdbff"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#191919ff"
|
||||
|
@ -63,7 +63,7 @@
|
|||
</wcol_tool>
|
||||
<wcol_toolbar_item>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#434343ff"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#e6e6e6cc"
|
||||
|
@ -78,7 +78,7 @@
|
|||
</wcol_toolbar_item>
|
||||
<wcol_radio>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#3b3b3bff"
|
||||
inner_sel="#5680c2e6"
|
||||
item="#ffffffff"
|
||||
|
@ -93,10 +93,10 @@
|
|||
</wcol_radio>
|
||||
<wcol_text>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#282828ff"
|
||||
inner_sel="#333333ff"
|
||||
item="#5680c2ff"
|
||||
item="#8aace6ff"
|
||||
text="#dddddd"
|
||||
text_sel="#ffffff"
|
||||
show_shaded="TRUE"
|
||||
|
@ -108,7 +108,7 @@
|
|||
</wcol_text>
|
||||
<wcol_option>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#3c3c3cff"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#ffffffff"
|
||||
|
@ -123,7 +123,7 @@
|
|||
</wcol_option>
|
||||
<wcol_toggle>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#dbdbdbff"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#191919ff"
|
||||
|
@ -138,7 +138,7 @@
|
|||
</wcol_toggle>
|
||||
<wcol_num>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#d3d3d3ff"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#80b1ffff"
|
||||
|
@ -153,7 +153,7 @@
|
|||
</wcol_num>
|
||||
<wcol_numslider>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#999999ff"
|
||||
inner_sel="#999999ff"
|
||||
item="#e6e6e6ff"
|
||||
|
@ -168,7 +168,7 @@
|
|||
</wcol_numslider>
|
||||
<wcol_box>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#80808080"
|
||||
inner_sel="#5680c2ff"
|
||||
item="#191919ff"
|
||||
|
@ -183,7 +183,7 @@
|
|||
</wcol_box>
|
||||
<wcol_menu>
|
||||
<ThemeWidgetColors
|
||||
outline="#3d3d3d"
|
||||
outline="#3d3d3dff"
|
||||
inner="#3b3b3bff"
|
||||
inner_sel="#767676ff"
|
||||
item="#808080ff"
|
||||
|
@ -198,7 +198,7 @@
|
|||
</wcol_menu>
|
||||
<wcol_pulldown>
|
||||
<ThemeWidgetColors
|
||||
outline="#4d4d4d"
|
||||
outline="#4d4d4dff"
|
||||
inner="#b3b3b3cc"
|
||||
inner_sel="#5680c2e6"
|
||||
item="#727272ff"
|
||||
|
@ -213,7 +213,7 @@
|
|||
</wcol_pulldown>
|
||||
<wcol_menu_back>
|
||||
<ThemeWidgetColors
|
||||
outline="#a6a6a6"
|
||||
outline="#a6a6a6ff"
|
||||
inner="#c0c0c0ff"
|
||||
inner_sel="#cdcdcdff"
|
||||
item="#727272ff"
|
||||
|
@ -228,7 +228,7 @@
|
|||
</wcol_menu_back>
|
||||
<wcol_pie_menu>
|
||||
<ThemeWidgetColors
|
||||
outline="#333333"
|
||||
outline="#333333ff"
|
||||
inner="#212121ef"
|
||||
inner_sel="#5680c2e6"
|
||||
item="#585858ff"
|
||||
|
@ -243,7 +243,7 @@
|
|||
</wcol_pie_menu>
|
||||
<wcol_tooltip>
|
||||
<ThemeWidgetColors
|
||||
outline="#19191a"
|
||||
outline="#19191aff"
|
||||
inner="#19191aef"
|
||||
inner_sel="#19191aef"
|
||||
item="#19191aef"
|
||||
|
@ -258,7 +258,7 @@
|
|||
</wcol_tooltip>
|
||||
<wcol_menu_item>
|
||||
<ThemeWidgetColors
|
||||
outline="#000000"
|
||||
outline="#00000000"
|
||||
inner="#00000000"
|
||||
inner_sel="#5680c2e6"
|
||||
item="#ffffff8f"
|
||||
|
@ -273,7 +273,7 @@
|
|||
</wcol_menu_item>
|
||||
<wcol_scroll>
|
||||
<ThemeWidgetColors
|
||||
outline="#999999"
|
||||
outline="#999999ff"
|
||||
inner="#50505000"
|
||||
inner_sel="#646464b3"
|
||||
item="#c2c2c299"
|
||||
|
@ -288,7 +288,7 @@
|
|||
</wcol_scroll>
|
||||
<wcol_progress>
|
||||
<ThemeWidgetColors
|
||||
outline="#b3b3b3"
|
||||
outline="#b3b3b3ff"
|
||||
inner="#ccccccff"
|
||||
inner_sel="#646464b4"
|
||||
item="#5094ffff"
|
||||
|
@ -303,12 +303,12 @@
|
|||
</wcol_progress>
|
||||
<wcol_list_item>
|
||||
<ThemeWidgetColors
|
||||
outline="#e6e6e6"
|
||||
outline="#e6e6e6ff"
|
||||
inner="#1a1a1a00"
|
||||
inner_sel="#668cccff"
|
||||
item="#1a1a1aff"
|
||||
item="#8aace6ff"
|
||||
text="#1a1a1a"
|
||||
text_sel="#000000"
|
||||
text_sel="#ffffff"
|
||||
show_shaded="FALSE"
|
||||
shadetop="0"
|
||||
shadedown="0"
|
||||
|
@ -334,7 +334,7 @@
|
|||
</wcol_state>
|
||||
<wcol_tab>
|
||||
<ThemeWidgetColors
|
||||
outline="#333333"
|
||||
outline="#333333ff"
|
||||
inner="#808080cc"
|
||||
inner_sel="#b3b3b3ff"
|
||||
item="#28292dff"
|
||||
|
@ -355,6 +355,7 @@
|
|||
clipping_border_3d="#606060ff"
|
||||
wire="#000000"
|
||||
wire_edit="#000000"
|
||||
edge_width="1"
|
||||
gp_vertex="#000000"
|
||||
gp_vertex_select="#ff8500"
|
||||
gp_vertex_size="3"
|
||||
|
@ -384,6 +385,7 @@
|
|||
face_dot="#ff8500"
|
||||
facedot_size="4"
|
||||
freestyle_face_mark="#7fff7f33"
|
||||
face_retopology="#50c8ff1e"
|
||||
face_back="#ff0000b3"
|
||||
face_front="#0000ffb3"
|
||||
nurb_uline="#909000"
|
||||
|
@ -441,7 +443,7 @@
|
|||
tab_active="#b3b3b3"
|
||||
tab_inactive="#8e8e8e"
|
||||
tab_back="#656565ff"
|
||||
tab_outline="#4d4d4d"
|
||||
tab_outline="#4d4d4dff"
|
||||
>
|
||||
<gradients>
|
||||
<ThemeGradientColors
|
||||
|
@ -461,6 +463,13 @@
|
|||
</panelcolors>
|
||||
</ThemeSpaceGradient>
|
||||
</space>
|
||||
<asset_shelf>
|
||||
<ThemeAssetShelf
|
||||
header_back="#1d1d1dff"
|
||||
back="#303030ff"
|
||||
>
|
||||
</ThemeAssetShelf>
|
||||
</asset_shelf>
|
||||
</ThemeView3D>
|
||||
</view_3d>
|
||||
<graph_editor>
|
||||
|
@ -516,7 +525,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#cccccc"
|
||||
tab_back="#999999ff"
|
||||
tab_outline="#999999"
|
||||
tab_outline="#999999ff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -562,7 +571,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#cccccc"
|
||||
tab_back="#999999ff"
|
||||
tab_outline="#999999"
|
||||
tab_outline="#999999ff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -620,7 +629,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -676,6 +685,7 @@
|
|||
summary="#d3660066"
|
||||
preview_range="#a14d0066"
|
||||
interpolation_line="#94e575cc"
|
||||
simulated_frames="#721e65ff"
|
||||
>
|
||||
<space>
|
||||
<ThemeSpaceGeneric
|
||||
|
@ -695,7 +705,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -732,10 +742,12 @@
|
|||
face_dot="#ff8500"
|
||||
facedot_size="3"
|
||||
freestyle_face_mark="#7fff7f33"
|
||||
face_back="#00000000"
|
||||
face_front="#00000000"
|
||||
face_retopology="#50c8ff1e"
|
||||
face_back="#ff0000b3"
|
||||
face_front="#0000ffb3"
|
||||
editmesh_active="#ffffff40"
|
||||
wire_edit="#c0c0c0"
|
||||
edge_width="1"
|
||||
edge_select="#ff8500"
|
||||
scope_back="#727272ff"
|
||||
preview_stitch_face="#7f7f0033"
|
||||
|
@ -780,7 +792,7 @@
|
|||
tab_active="#b3b3b3"
|
||||
tab_inactive="#8e8e8e"
|
||||
tab_back="#656565ff"
|
||||
tab_outline="#4d4d4d"
|
||||
tab_outline="#4d4d4dff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -804,7 +816,7 @@
|
|||
scene_strip="#828f50"
|
||||
audio_strip="#4c8f8f"
|
||||
effect_strip="#4c456c"
|
||||
transition_strip="#50458F"
|
||||
transition_strip="#50458f"
|
||||
color_strip="#8f8f8f"
|
||||
meta_strip="#5b4d91"
|
||||
mask_strip="#8f5656"
|
||||
|
@ -841,7 +853,7 @@
|
|||
tab_active="#b3b3b3"
|
||||
tab_inactive="#8e8e8e"
|
||||
tab_back="#656565ff"
|
||||
tab_outline="#4d4d4d"
|
||||
tab_outline="#4d4d4dff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -887,7 +899,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -934,7 +946,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -979,6 +991,8 @@
|
|||
layout_node="#6c696f"
|
||||
geometry_node="#00d6a3"
|
||||
attribute_node="#001566"
|
||||
simulation_zone="#66416233"
|
||||
repeat_zone="#76512f33"
|
||||
>
|
||||
<space>
|
||||
<ThemeSpaceGeneric
|
||||
|
@ -998,7 +1012,7 @@
|
|||
tab_active="#b3b3b3"
|
||||
tab_inactive="#8e8e8e"
|
||||
tab_back="#656565ff"
|
||||
tab_outline="#4d4d4d"
|
||||
tab_outline="#4d4d4dff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1049,7 +1063,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1098,7 +1112,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1132,7 +1146,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1173,7 +1187,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1238,7 +1252,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#535353"
|
||||
tab_back="#404040ff"
|
||||
tab_outline="#3c3c3c"
|
||||
tab_outline="#3c3c3cff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1281,7 +1295,7 @@
|
|||
tab_active="#446499"
|
||||
tab_inactive="#28292d"
|
||||
tab_back="#28292dff"
|
||||
tab_outline="#28292d"
|
||||
tab_outline="#28292dff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1315,7 +1329,7 @@
|
|||
tab_active="#446499"
|
||||
tab_inactive="#28292d"
|
||||
tab_back="#28292dff"
|
||||
tab_outline="#28292d"
|
||||
tab_outline="#28292dff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
@ -1351,7 +1365,7 @@
|
|||
tab_active="#6697e6"
|
||||
tab_inactive="#cccccc"
|
||||
tab_back="#999999ff"
|
||||
tab_outline="#999999"
|
||||
tab_outline="#999999ff"
|
||||
>
|
||||
<panelcolors>
|
||||
<ThemePanelColors
|
||||
|
|
|
@ -267,7 +267,7 @@ def any_except(*args):
|
|||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Keymap Item Wrappers
|
||||
# Key-map Item Wrappers
|
||||
|
||||
def op_menu(menu, kmi_args):
|
||||
return ("wm.call_menu", kmi_args, {"properties": [("name", menu)]})
|
||||
|
@ -918,7 +918,7 @@ def km_view2d(_params):
|
|||
)
|
||||
|
||||
items.extend([
|
||||
# Scrollbars
|
||||
# Scroll-bars.
|
||||
("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
|
||||
("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
|
||||
# Pan/scroll
|
||||
|
@ -960,7 +960,7 @@ def km_view2d_buttons_list(_params):
|
|||
)
|
||||
|
||||
items.extend([
|
||||
# Scrollbars
|
||||
# Scroll-bars.
|
||||
("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
|
||||
("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
|
||||
# Pan scroll
|
||||
|
@ -1198,6 +1198,7 @@ def km_property_editor(_params):
|
|||
("object.modifier_remove", {"type": 'X', "value": 'PRESS'}, {"properties": [("report", True)]}),
|
||||
("object.modifier_remove", {"type": 'DEL', "value": 'PRESS'}, {"properties": [("report", True)]}),
|
||||
("object.modifier_copy", {"type": 'D', "value": 'PRESS', "shift": True}, None),
|
||||
("object.add_modifier_menu", {"type": 'A', "value": 'PRESS', "shift": True}, None),
|
||||
("object.modifier_apply", {"type": 'A', "value": 'PRESS', "ctrl": True}, {"properties": [("report", True)]}),
|
||||
# Grease pencil modifier panels
|
||||
("object.gpencil_modifier_remove",
|
||||
|
@ -5717,7 +5718,7 @@ def km_edit_armature(params):
|
|||
return keymap
|
||||
|
||||
|
||||
# Metaball edit mode.
|
||||
# Meta-ball edit mode.
|
||||
def km_edit_metaball(params):
|
||||
items = []
|
||||
keymap = (
|
||||
|
@ -6743,7 +6744,7 @@ def km_generic_gizmo_tweak_modal_map(_params):
|
|||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Popup Keymaps
|
||||
# Popup Key-maps
|
||||
|
||||
def km_popup_toolbar(_params):
|
||||
return (
|
||||
|
@ -8472,7 +8473,7 @@ def generate_keymaps(params=None):
|
|||
km_generic_gizmo_select(params),
|
||||
km_generic_gizmo_tweak_modal_map(params),
|
||||
|
||||
# Pop-Up Keymaps.
|
||||
# Pop-Up Key-maps.
|
||||
km_popup_toolbar(params),
|
||||
|
||||
# Tool System.
|
||||
|
|
|
@ -315,7 +315,7 @@ def km_view2d(params):
|
|||
)
|
||||
|
||||
items.extend([
|
||||
# Scrollbars
|
||||
# Scroll-bars.
|
||||
("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
|
||||
("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
|
||||
# Pan/scroll
|
||||
|
@ -359,7 +359,7 @@ def km_view2d_buttons_list(params):
|
|||
)
|
||||
|
||||
items.extend([
|
||||
# Scrollbars
|
||||
# Scroll-bars.
|
||||
("view2d.scroller_activate", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
|
||||
("view2d.scroller_activate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
|
||||
# Pan scroll
|
||||
|
@ -3673,7 +3673,8 @@ def km_sculpt(params):
|
|||
("wm.context_toggle", {"type": 'L', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'tool_settings.sculpt.brush.use_smooth_stroke')]}),
|
||||
# Tools
|
||||
# This is the only mode without an Annotate shortcut. The multires shortcuts took precedence instead.
|
||||
# This is the only mode without an Annotate shortcut.
|
||||
# The multi-resolution shortcuts took precedence instead.
|
||||
op_tool_cycle("builtin.box_mask", {"type": 'Q', "value": 'PRESS'}),
|
||||
op_tool_cycle("builtin.move", {"type": 'W', "value": 'PRESS'}),
|
||||
op_tool_cycle("builtin.rotate", {"type": 'E', "value": 'PRESS'}),
|
||||
|
@ -4268,7 +4269,7 @@ def km_transform_modal_map(_params):
|
|||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Tool System Keymaps
|
||||
# Tool System Key-maps
|
||||
#
|
||||
# Named are auto-generated based on the tool name and it's toolbar.
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ def update_factory_startup_screens():
|
|||
space = area.spaces.active
|
||||
space.context = 'TOOL'
|
||||
elif area.type == 'DOPESHEET_EDITOR':
|
||||
# Open sidebar in Dopesheet.
|
||||
# Open sidebar in Dope-sheet.
|
||||
space = area.spaces.active
|
||||
space.show_region_ui = True
|
||||
|
||||
|
|
|
@ -89,13 +89,13 @@ class ANIM_OT_keying_set_export(Operator):
|
|||
if ksp.id in id_to_paths_cache:
|
||||
continue
|
||||
|
||||
# - idtype_list is used to get the list of id-datablocks from
|
||||
# bpy.data.* since this info isn't available elsewhere
|
||||
# - id.bl_rna.name gives a name suitable for UI,
|
||||
# - `idtype_list` is used to get the list of ID-data-blocks from
|
||||
# `bpy.data.*` since this info isn't available elsewhere.
|
||||
# - `id.bl_rna.name` gives a name suitable for UI,
|
||||
# with a capitalized first letter, but we need
|
||||
# the plural form that's all lower case
|
||||
# the plural form that's all lower case.
|
||||
# - special handling is needed for "nested" ID-blocks
|
||||
# (e.g. nodetree in Material)
|
||||
# (e.g. node-tree in Material).
|
||||
if ksp.id.bl_rna.identifier.startswith("ShaderNodeTree"):
|
||||
# Find material or light using this node tree...
|
||||
id_bpy_path = "bpy.data.nodes[\"%s\"]"
|
||||
|
@ -120,7 +120,7 @@ class ANIM_OT_keying_set_export(Operator):
|
|||
tip_("Could not find material or light using Shader Node Tree - %s") %
|
||||
(ksp.id))
|
||||
elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"):
|
||||
# Find compositor nodetree using this node tree...
|
||||
# Find compositor node-tree using this node tree.
|
||||
for scene in bpy.data.scenes:
|
||||
if scene.node_tree == ksp.id:
|
||||
id_bpy_path = "bpy.data.scenes[\"%s\"].node_tree" % (scene.name)
|
||||
|
|
|
@ -230,6 +230,7 @@ class NewGeometryNodesModifier(Operator):
|
|||
return {'CANCELLED'}
|
||||
|
||||
group = geometry_node_group_empty_new()
|
||||
group.is_modifier = True
|
||||
modifier.node_group = group
|
||||
|
||||
return {'FINISHED'}
|
||||
|
@ -257,6 +258,7 @@ class NewGeometryNodeTreeAssign(Operator):
|
|||
if not modifier:
|
||||
return {'CANCELLED'}
|
||||
group = geometry_node_group_empty_new()
|
||||
group.is_modifier = True
|
||||
modifier.node_group = group
|
||||
|
||||
return {'FINISHED'}
|
||||
|
|
|
@ -85,7 +85,7 @@ class MeshMirrorUV(Operator):
|
|||
puvs_cpy[i] = tuple(uv.copy() for uv in puvs[i])
|
||||
puvsel[i] = (False not in
|
||||
(uv.select for uv in uv_loops[lstart:lend]))
|
||||
# Vert idx of the poly.
|
||||
# Vert index of the poly.
|
||||
vidxs[i] = tuple(l.vertex_index for l in loops[lstart:lend])
|
||||
pcents[i] = p.center
|
||||
# Preparing next step finding matching polys.
|
||||
|
|
|
@ -493,7 +493,7 @@ class QuickSmoke(ObjectModeOperator, Operator):
|
|||
|
||||
# Setup material
|
||||
|
||||
# Cycles and Eevee
|
||||
# Cycles and EEVEE.
|
||||
bpy.ops.object.material_slot_add()
|
||||
|
||||
mat = bpy.data.materials.new("Smoke Domain Material")
|
||||
|
|
|
@ -22,6 +22,26 @@ def guess_player_path(preset):
|
|||
test_path = "/Applications/DJV2.app/Contents/Resources/bin/djv"
|
||||
if os.path.exists(test_path):
|
||||
player_path = test_path
|
||||
elif sys.platform == "win32":
|
||||
import winreg
|
||||
|
||||
# NOTE: This can be removed if/when DJV adds their executable to the PATH.
|
||||
# See issue 449 on their GITHUB project page.
|
||||
reg_path = r"SOFTWARE\Classes\djv\shell\open\command"
|
||||
reg_value = None
|
||||
try:
|
||||
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, reg_path, 0, winreg.KEY_READ) as regkey:
|
||||
reg_value = winreg.QueryValue(regkey, None)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if reg_value:
|
||||
# Remove trailing command line arguments from the path. The
|
||||
# registry value looks like: `<full path>\djv.exe "%1"`.
|
||||
binary = "djv.exe"
|
||||
index = reg_value.find(binary)
|
||||
if index > 0:
|
||||
player_path = reg_value[:index + len(binary)]
|
||||
|
||||
elif preset == 'FRAMECYCLER':
|
||||
player_path = "framecycler"
|
||||
|
|
|
@ -936,7 +936,7 @@ class PREFERENCES_OT_app_template_install(Operator):
|
|||
return {'CANCELLED'}
|
||||
|
||||
else:
|
||||
# Only support installing zipfiles
|
||||
# Only support installing zip-files.
|
||||
self.report({'WARNING'}, tip_("Expected a zip-file %r\n") % filepath)
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
|
|
@ -2273,7 +2273,7 @@ class WM_OT_owner_disable(Operator):
|
|||
|
||||
|
||||
class WM_OT_tool_set_by_id(Operator):
|
||||
"""Set the tool by name (for keymaps)"""
|
||||
"""Set the tool by name (for key-maps)"""
|
||||
bl_idname = "wm.tool_set_by_id"
|
||||
bl_label = "Set Tool by Name"
|
||||
|
||||
|
@ -2319,7 +2319,7 @@ class WM_OT_tool_set_by_id(Operator):
|
|||
|
||||
|
||||
class WM_OT_tool_set_by_index(Operator):
|
||||
"""Set the tool by index (for keymaps)"""
|
||||
"""Set the tool by index (for key-maps)"""
|
||||
bl_idname = "wm.tool_set_by_index"
|
||||
bl_label = "Set Tool by Index"
|
||||
index: IntProperty(
|
||||
|
@ -2798,7 +2798,7 @@ class WM_OT_batch_rename(Operator):
|
|||
'ARMATURE': ("armatures", iface_("Armature(s)"), bpy.types.Armature),
|
||||
'LATTICE': ("lattices", iface_("Lattice(s)"), bpy.types.Lattice),
|
||||
'LIGHT': ("lights", iface_("Light(s)"), bpy.types.Light),
|
||||
'LIGHT_PROBE': ("light_probes", iface_("Light Probe(s)"), bpy.types.LightProbe),
|
||||
'LIGHT_PROBE': ("lightprobes", iface_("Light Probe(s)"), bpy.types.LightProbe),
|
||||
'CAMERA': ("cameras", iface_("Camera(s)"), bpy.types.Camera),
|
||||
'SPEAKER': ("speakers", iface_("Speaker(s)"), bpy.types.Speaker),
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue