diff options
617 files changed, 12175 insertions, 14531 deletions
diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index 5db1a4e56fa..8d75f0ff0ed 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later ## Update and uncomment this in the release branch -set(BLENDER_VERSION 3.4) +# set(BLENDER_VERSION 3.1) function(download_source dep) set(TARGET_FILE ${${dep}_FILE}) diff --git a/build_files/config/pipeline_config.yaml b/build_files/config/pipeline_config.yaml index 7c8f15de777..3359f89c41e 100644 --- a/build_files/config/pipeline_config.yaml +++ b/build_files/config/pipeline_config.yaml @@ -5,38 +5,38 @@ update-code: git: submodules: - - branch: blender-v3.4-release + - branch: master commit_id: HEAD path: release/scripts/addons - - branch: blender-v3.4-release + - branch: master commit_id: HEAD path: release/scripts/addons_contrib - - branch: blender-v3.4-release + - branch: master commit_id: HEAD path: release/datafiles/locale - - branch: blender-v3.4-release + - branch: master commit_id: HEAD path: source/tools svn: libraries: darwin-arm64: - branch: tags/blender-3.4-release + branch: trunk commit_id: HEAD path: lib/darwin_arm64 darwin-x86_64: - branch: tags/blender-3.4-release + branch: trunk commit_id: HEAD path: lib/darwin linux-x86_64: - branch: tags/blender-3.4-release + branch: trunk commit_id: HEAD path: lib/linux_centos7_x86_64 windows-amd64: - branch: tags/blender-3.4-release + branch: trunk commit_id: HEAD path: lib/win64_vc15 tests: - branch: tags/blender-3.4-release + branch: trunk commit_id: HEAD path: lib/tests benchmarks: diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index 18c16a60993..e1d8ac39bcf 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = Blender # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = V3.4 +PROJECT_NUMBER = V3.5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/intern/cycles/device/metal/kernel.mm b/intern/cycles/device/metal/kernel.mm index 55938d1a03a..dc8af9a5358 100644 --- a/intern/cycles/device/metal/kernel.mm +++ b/intern/cycles/device/metal/kernel.mm @@ -45,6 +45,36 @@ bool kernel_has_intersection(DeviceKernel device_kernel) struct ShaderCache { ShaderCache(id<MTLDevice> _mtlDevice) : mtlDevice(_mtlDevice) { + /* Initialize occupancy tuning LUT. */ + if (MetalInfo::get_device_vendor(mtlDevice) == METAL_GPU_APPLE) { + switch (MetalInfo::get_apple_gpu_architecture(mtlDevice)) { + default: + case APPLE_M2: + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_STATES] = {32, 32}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INIT_FROM_CAMERA] = {832, 32}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST] = {64, 64}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW] = {64, 64}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE] = {704, 32}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_QUEUED_PATHS_ARRAY] = {1024, 256}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND] = {64, 32}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW] = {256, 256}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE] = {448, 384}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SORTED_PATHS_ARRAY] = {1024, 1024}; + break; + case APPLE_M1: + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_STATES] = {256, 128}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INIT_FROM_CAMERA] = {768, 32}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST] = {512, 128}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW] = {384, 128}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE] = {512, 64}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_QUEUED_PATHS_ARRAY] = {512, 256}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND] = {512, 128}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW] = {384, 32}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE] = {576, 384}; + occupancy_tuning[DEVICE_KERNEL_INTEGRATOR_SORTED_PATHS_ARRAY] = {832, 832}; + break; + } + } } ~ShaderCache(); @@ -73,6 +103,11 @@ struct ShaderCache { std::function<void(MetalKernelPipeline *)> completionHandler; }; + struct OccupancyTuningParameters { + int threads_per_threadgroup = 0; + int num_threads_per_block = 0; + } occupancy_tuning[DEVICE_KERNEL_NUM]; + std::mutex cache_mutex; PipelineCollection pipelines[DEVICE_KERNEL_NUM]; @@ -230,6 +265,13 @@ void ShaderCache::load_kernel(DeviceKernel device_kernel, request.pipeline->device_kernel = device_kernel; request.pipeline->threads_per_threadgroup = device->max_threads_per_threadgroup; + if (occupancy_tuning[device_kernel].threads_per_threadgroup) { + request.pipeline->threads_per_threadgroup = + occupancy_tuning[device_kernel].threads_per_threadgroup; + request.pipeline->num_threads_per_block = + occupancy_tuning[device_kernel].num_threads_per_block; + } + /* metalrt options */ request.pipeline->use_metalrt = device->use_metalrt; request.pipeline->metalrt_hair = device->use_metalrt && @@ -374,13 +416,6 @@ void MetalKernelPipeline::compile() const std::string function_name = std::string("cycles_metal_") + device_kernel_as_string(device_kernel); - int threads_per_threadgroup = this->threads_per_threadgroup; - if (device_kernel > DEVICE_KERNEL_INTEGRATOR_MEGAKERNEL && - device_kernel < DEVICE_KERNEL_INTEGRATOR_RESET) { - /* Always use 512 for the sorting kernels */ - threads_per_threadgroup = 512; - } - NSString *entryPoint = [@(function_name.c_str()) copy]; NSError *error = NULL; @@ -644,12 +679,14 @@ void MetalKernelPipeline::compile() return; } - int num_threads_per_block = round_down(computePipelineState.maxTotalThreadsPerThreadgroup, - computePipelineState.threadExecutionWidth); - num_threads_per_block = std::max(num_threads_per_block, - (int)computePipelineState.threadExecutionWidth); + if (!num_threads_per_block) { + num_threads_per_block = round_down(computePipelineState.maxTotalThreadsPerThreadgroup, + computePipelineState.threadExecutionWidth); + num_threads_per_block = std::max(num_threads_per_block, + (int)computePipelineState.threadExecutionWidth); + } + this->pipeline = computePipelineState; - this->num_threads_per_block = num_threads_per_block; if (@available(macOS 11.0, *)) { if (creating_new_archive || recreate_archive) { diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 3779fdc697a..3fbb346e94f 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -328,6 +328,7 @@ set(SRC_UTIL_HEADERS ../util/math_int2.h ../util/math_int3.h ../util/math_int4.h + ../util/math_int8.h ../util/math_matrix.h ../util/projection.h ../util/rect.h @@ -350,6 +351,8 @@ set(SRC_UTIL_HEADERS ../util/types_int3_impl.h ../util/types_int4.h ../util/types_int4_impl.h + ../util/types_int8.h + ../util/types_int8_impl.h ../util/types_spectrum.h ../util/types_uchar2.h ../util/types_uchar2_impl.h diff --git a/intern/cycles/kernel/device/cpu/kernel.cpp b/intern/cycles/kernel/device/cpu/kernel.cpp index 01087c96dd6..558431961ab 100644 --- a/intern/cycles/kernel/device/cpu/kernel.cpp +++ b/intern/cycles/kernel/device/cpu/kernel.cpp @@ -7,6 +7,7 @@ * one with SSE2 intrinsics. */ #if defined(__x86_64__) || defined(_M_X64) +# define __KERNEL_SSE__ # define __KERNEL_SSE2__ #endif @@ -29,11 +30,15 @@ # define __KERNEL_SSE41__ # endif # ifdef __AVX__ -# define __KERNEL_SSE__ +# ifndef __KERNEL_SSE__ +# define __KERNEL_SSE__ +# endif # define __KERNEL_AVX__ # endif # ifdef __AVX2__ -# define __KERNEL_SSE__ +# ifndef __KERNEL_SSE__ +# define __KERNEL_SSE__ +# endif # define __KERNEL_AVX2__ # endif #endif diff --git a/intern/cycles/kernel/svm/noise.h b/intern/cycles/kernel/svm/noise.h index 31e77d87413..209195a03f1 100644 --- a/intern/cycles/kernel/svm/noise.h +++ b/intern/cycles/kernel/svm/noise.h @@ -39,11 +39,11 @@ ccl_device_noinline_cpu float perlin_1d(float x) } /* 2D, 3D, and 4D noise can be accelerated using SSE, so we first check if - * SSE is supported, that is, if __KERNEL_SSE2__ is defined. If it is not + * SSE is supported, that is, if __KERNEL_SSE__ is defined. If it is not * supported, we do a standard implementation, but if it is supported, we * do an implementation using SSE intrinsics. */ -#if !defined(__KERNEL_SSE2__) +#if !defined(__KERNEL_SSE__) /* ** Standard Implementation ** */ @@ -250,18 +250,18 @@ ccl_device_noinline_cpu float perlin_4d(float x, float y, float z, float w) /* SSE Bilinear Interpolation: * - * The function takes two ssef inputs: + * The function takes two float4 inputs: * - p : Contains the values at the points (v0, v1, v2, v3). * - f : Contains the values (x, y, _, _). The third and fourth values are unused. * * The interpolation is done in two steps: * 1. Interpolate (v0, v1) and (v2, v3) along the x axis to get g (g0, g1). * (v2, v3) is generated by moving v2 and v3 to the first and second - * places of the ssef using the shuffle mask <2, 3, 2, 3>. The third and + * places of the float4 using the shuffle mask <2, 3, 2, 3>. The third and * fourth values are unused. * 2. Interpolate g0 and g1 along the y axis to get the final value. - * g1 is generated by populating an ssef with the second value of g. - * Only the first value is important in the final ssef. + * g1 is generated by populating an float4 with the second value of g. + * Only the first value is important in the final float4. * * v1 v3 g1 * @ + + + + @ @ y @@ -272,27 +272,27 @@ ccl_device_noinline_cpu float perlin_4d(float x, float y, float z, float w) * v0 v2 g0 * */ -ccl_device_inline ssef bi_mix(ssef p, ssef f) +ccl_device_inline float4 bi_mix(float4 p, float4 f) { - ssef g = mix(p, shuffle<2, 3, 2, 3>(p), shuffle<0>(f)); + float4 g = mix(p, shuffle<2, 3, 2, 3>(p), shuffle<0>(f)); return mix(g, shuffle<1>(g), shuffle<1>(f)); } -ccl_device_inline ssef fade(const ssef &t) +ccl_device_inline float4 fade(const float4 t) { - ssef a = madd(t, 6.0f, -15.0f); - ssef b = madd(t, a, 10.0f); + float4 a = madd(t, make_float4(6.0f), make_float4(-15.0f)); + float4 b = madd(t, a, make_float4(10.0f)); return (t * t) * (t * b); } /* Negate val if the nth bit of h is 1. */ # define negate_if_nth_bit(val, h, n) ((val) ^ cast(((h) & (1 << (n))) << (31 - (n)))) -ccl_device_inline ssef grad(const ssei &hash, const ssef &x, const ssef &y) +ccl_device_inline float4 grad(const int4 hash, const float4 x, const float4 y) { - ssei h = hash & 7; - ssef u = select(h < 4, x, y); - ssef v = 2.0f * select(h < 4, y, x); + int4 h = hash & 7; + float4 u = select(h < 4, x, y); + float4 v = 2.0f * select(h < 4, y, x); return negate_if_nth_bit(u, h, 0) + negate_if_nth_bit(v, h, 1); } @@ -310,28 +310,28 @@ ccl_device_inline ssef grad(const ssei &hash, const ssef &x, const ssef &y) */ ccl_device_noinline_cpu float perlin_2d(float x, float y) { - ssei XY; - ssef fxy = floorfrac(ssef(x, y, 0.0f, 0.0f), &XY); - ssef uv = fade(fxy); + int4 XY; + float4 fxy = floorfrac(make_float4(x, y, 0.0f, 0.0f), &XY); + float4 uv = fade(fxy); - ssei XY1 = XY + 1; - ssei X = shuffle<0, 0, 0, 0>(XY, XY1); - ssei Y = shuffle<0, 2, 0, 2>(shuffle<1, 1, 1, 1>(XY, XY1)); + int4 XY1 = XY + make_int4(1); + int4 X = shuffle<0, 0, 0, 0>(XY, XY1); + int4 Y = shuffle<0, 2, 0, 2>(shuffle<1, 1, 1, 1>(XY, XY1)); - ssei h = hash_ssei2(X, Y); + int4 h = hash_int4_2(X, Y); - ssef fxy1 = fxy - 1.0f; - ssef fx = shuffle<0, 0, 0, 0>(fxy, fxy1); - ssef fy = shuffle<0, 2, 0, 2>(shuffle<1, 1, 1, 1>(fxy, fxy1)); + float4 fxy1 = fxy - make_float4(1.0f); + float4 fx = shuffle<0, 0, 0, 0>(fxy, fxy1); + float4 fy = shuffle<0, 2, 0, 2>(shuffle<1, 1, 1, 1>(fxy, fxy1)); - ssef g = grad(h, fx, fy); + float4 g = grad(h, fx, fy); return extract<0>(bi_mix(g, uv)); } /* SSE Trilinear Interpolation: * - * The function takes three ssef inputs: + * The function takes three float4 inputs: * - p : Contains the values at the points (v0, v1, v2, v3). * - q : Contains the values at the points (v4, v5, v6, v7). * - f : Contains the values (x, y, z, _). The fourth value is unused. @@ -340,11 +340,11 @@ ccl_device_noinline_cpu float perlin_2d(float x, float y) * 1. Interpolate p and q along the x axis to get s (s0, s1, s2, s3). * 2. Interpolate (s0, s1) and (s2, s3) along the y axis to get g (g0, g1). * (s2, s3) is generated by moving v2 and v3 to the first and second - * places of the ssef using the shuffle mask <2, 3, 2, 3>. The third and + * places of the float4 using the shuffle mask <2, 3, 2, 3>. The third and * fourth values are unused. * 3. Interpolate g0 and g1 along the z axis to get the final value. - * g1 is generated by populating an ssef with the second value of g. - * Only the first value is important in the final ssef. + * g1 is generated by populating an float4 with the second value of g. + * Only the first value is important in the final float4. * * v3 v7 * @ + + + + + + @ s3 @ @@ -362,10 +362,10 @@ ccl_device_noinline_cpu float perlin_2d(float x, float y) * @ + + + + + + @ @ * v0 v4 s0 */ -ccl_device_inline ssef tri_mix(ssef p, ssef q, ssef f) +ccl_device_inline float4 tri_mix(float4 p, float4 q, float4 f) { - ssef s = mix(p, q, shuffle<0>(f)); - ssef g = mix(s, shuffle<2, 3, 2, 3>(s), shuffle<1>(f)); + float4 s = mix(p, q, shuffle<0>(f)); + float4 g = mix(s, shuffle<2, 3, 2, 3>(s), shuffle<1>(f)); return mix(g, shuffle<1>(g), shuffle<2>(f)); } @@ -374,24 +374,24 @@ ccl_device_inline ssef tri_mix(ssef p, ssef q, ssef f) * supported, we do an SSE implementation, but if it is supported, * we do an implementation using AVX intrinsics. */ -# if !defined(__KERNEL_AVX__) +# if !defined(__KERNEL_AVX2__) -ccl_device_inline ssef grad(const ssei &hash, const ssef &x, const ssef &y, const ssef &z) +ccl_device_inline float4 grad(const int4 hash, const float4 x, const float4 y, const float4 z) { - ssei h = hash & 15; - ssef u = select(h < 8, x, y); - ssef vt = select((h == 12) | (h == 14), x, z); - ssef v = select(h < 4, y, vt); + int4 h = hash & 15; + float4 u = select(h < 8, x, y); + float4 vt = select((h == 12) | (h == 14), x, z); + float4 v = select(h < 4, y, vt); return negate_if_nth_bit(u, h, 0) + negate_if_nth_bit(v, h, 1); } -ccl_device_inline ssef -grad(const ssei &hash, const ssef &x, const ssef &y, const ssef &z, const ssef &w) +ccl_device_inline float4 +grad(const int4 hash, const float4 x, const float4 y, const float4 z, const float4 w) { - ssei h = hash & 31; - ssef u = select(h < 24, x, y); - ssef v = select(h < 16, y, z); - ssef s = select(h < 8, z, w); + int4 h = hash & 31; + float4 u = select(h < 24, x, y); + float4 v = select(h < 16, y, z); + float4 s = select(h < 8, z, w); return negate_if_nth_bit(u, h, 0) + negate_if_nth_bit(v, h, 1) + negate_if_nth_bit(s, h, 2); } @@ -401,7 +401,7 @@ grad(const ssei &hash, const ssef &x, const ssef &y, const ssef &z, const ssef & * between two trilinear interpolations. * */ -ccl_device_inline ssef quad_mix(ssef p, ssef q, ssef r, ssef s, ssef f) +ccl_device_inline float4 quad_mix(float4 p, float4 q, float4 r, float4 s, float4 f) { return mix(tri_mix(p, q, f), tri_mix(r, s, f), shuffle<3>(f)); } @@ -427,23 +427,23 @@ ccl_device_inline ssef quad_mix(ssef p, ssef q, ssef r, ssef s, ssef f) */ ccl_device_noinline_cpu float perlin_3d(float x, float y, float z) { - ssei XYZ; - ssef fxyz = floorfrac(ssef(x, y, z, 0.0f), &XYZ); - ssef uvw = fade(fxyz); + int4 XYZ; + float4 fxyz = floorfrac(make_float4(x, y, z, 0.0f), &XYZ); + float4 uvw = fade(fxyz); - ssei XYZ1 = XYZ + 1; - ssei Y = shuffle<1, 1, 1, 1>(XYZ, XYZ1); - ssei Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZ, XYZ1)); + int4 XYZ1 = XYZ + make_int4(1); + int4 Y = shuffle<1, 1, 1, 1>(XYZ, XYZ1); + int4 Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZ, XYZ1)); - ssei h1 = hash_ssei3(shuffle<0>(XYZ), Y, Z); - ssei h2 = hash_ssei3(shuffle<0>(XYZ1), Y, Z); + int4 h1 = hash_int4_3(shuffle<0>(XYZ), Y, Z); + int4 h2 = hash_int4_3(shuffle<0>(XYZ1), Y, Z); - ssef fxyz1 = fxyz - 1.0f; - ssef fy = shuffle<1, 1, 1, 1>(fxyz, fxyz1); - ssef fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyz, fxyz1)); + float4 fxyz1 = fxyz - make_float4(1.0f); + float4 fy = shuffle<1, 1, 1, 1>(fxyz, fxyz1); + float4 fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyz, fxyz1)); - ssef g1 = grad(h1, shuffle<0>(fxyz), fy, fz); - ssef g2 = grad(h2, shuffle<0>(fxyz1), fy, fz); + float4 g1 = grad(h1, shuffle<0>(fxyz), fy, fz); + float4 g2 = grad(h2, shuffle<0>(fxyz1), fy, fz); return extract<0>(tri_mix(g1, g2, uvw)); } @@ -481,29 +481,29 @@ ccl_device_noinline_cpu float perlin_3d(float x, float y, float z) */ ccl_device_noinline_cpu float perlin_4d(float x, float y, float z, float w) { - ssei XYZW; - ssef fxyzw = floorfrac(ssef(x, y, z, w), &XYZW); - ssef uvws = fade(fxyzw); + int4 XYZW; + float4 fxyzw = floorfrac(make_float4(x, y, z, w), &XYZW); + float4 uvws = fade(fxyzw); - ssei XYZW1 = XYZW + 1; - ssei Y = shuffle<1, 1, 1, 1>(XYZW, XYZW1); - ssei Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZW, XYZW1)); + int4 XYZW1 = XYZW + make_int4(1); + int4 Y = shuffle<1, 1, 1, 1>(XYZW, XYZW1); + int4 Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZW, XYZW1)); - ssei h1 = hash_ssei4(shuffle<0>(XYZW), Y, Z, shuffle<3>(XYZW)); - ssei h2 = hash_ssei4(shuffle<0>(XYZW1), Y, Z, shuffle<3>(XYZW)); + int4 h1 = hash_int4_4(shuffle<0>(XYZW), Y, Z, shuffle<3>(XYZW)); + int4 h2 = hash_int4_4(shuffle<0>(XYZW1), Y, Z, shuffle<3>(XYZW)); - ssei h3 = hash_ssei4(shuffle<0>(XYZW), Y, Z, shuffle<3>(XYZW1)); - ssei h4 = hash_ssei4(shuffle<0>(XYZW1), Y, Z, shuffle<3>(XYZW1)); + int4 h3 = hash_int4_4(shuffle<0>(XYZW), Y, Z, shuffle<3>(XYZW1)); + int4 h4 = hash_int4_4(shuffle<0>(XYZW1), Y, Z, shuffle<3>(XYZW1)); - ssef fxyzw1 = fxyzw - 1.0f; - ssef fy = shuffle<1, 1, 1, 1>(fxyzw, fxyzw1); - ssef fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyzw, fxyzw1)); + float4 fxyzw1 = fxyzw - make_float4(1.0f); + float4 fy = shuffle<1, 1, 1, 1>(fxyzw, fxyzw1); + float4 fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyzw, fxyzw1)); - ssef g1 = grad(h1, shuffle<0>(fxyzw), fy, fz, shuffle<3>(fxyzw)); - ssef g2 = grad(h2, shuffle<0>(fxyzw1), fy, fz, shuffle<3>(fxyzw)); + float4 g1 = grad(h1, shuffle<0>(fxyzw), fy, fz, shuffle<3>(fxyzw)); + float4 g2 = grad(h2, shuffle<0>(fxyzw1), fy, fz, shuffle<3>(fxyzw)); - ssef g3 = grad(h3, shuffle<0>(fxyzw), fy, fz, shuffle<3>(fxyzw1)); - ssef g4 = grad(h4, shuffle<0>(fxyzw1), fy, fz, shuffle<3>(fxyzw1)); + float4 g3 = grad(h3, shuffle<0>(fxyzw), fy, fz, shuffle<3>(fxyzw1)); + float4 g4 = grad(h4, shuffle<0>(fxyzw1), fy, fz, shuffle<3>(fxyzw1)); return extract<0>(quad_mix(g1, g2, g3, g4, uvws)); } @@ -512,22 +512,22 @@ ccl_device_noinline_cpu float perlin_4d(float x, float y, float z, float w) /* AVX Implementation */ -ccl_device_inline avxf grad(const avxi &hash, const avxf &x, const avxf &y, const avxf &z) +ccl_device_inline vfloat8 grad(const vint8 hash, const vfloat8 x, const vfloat8 y, const vfloat8 z) { - avxi h = hash & 15; - avxf u = select(h < 8, x, y); - avxf vt = select((h == 12) | (h == 14), x, z); - avxf v = select(h < 4, y, vt); + vint8 h = hash & 15; + vfloat8 u = select(h < 8, x, y); + vfloat8 vt = select((h == 12) | (h == 14), x, z); + vfloat8 v = select(h < 4, y, vt); return negate_if_nth_bit(u, h, 0) + negate_if_nth_bit(v, h, 1); } -ccl_device_inline avxf -grad(const avxi &hash, const avxf &x, const avxf &y, const avxf &z, const avxf &w) +ccl_device_inline vfloat8 +grad(const vint8 hash, const vfloat8 x, const vfloat8 y, const vfloat8 z, const vfloat8 w) { - avxi h = hash & 31; - avxf u = select(h < 24, x, y); - avxf v = select(h < 16, y, z); - avxf s = select(h < 8, z, w); + vint8 h = hash & 31; + vfloat8 u = select(h < 24, x, y); + vfloat8 v = select(h < 16, y, z); + vfloat8 s = select(h < 8, z, w); return negate_if_nth_bit(u, h, 0) + negate_if_nth_bit(v, h, 1) + negate_if_nth_bit(s, h, 2); } @@ -537,13 +537,13 @@ grad(const avxi &hash, const avxf &x, const avxf &y, const avxf &z, const avxf & * 1. Interpolate p and q along the w axis to get s. * 2. Trilinearly interpolate (s0, s1, s2, s3) and (s4, s5, s6, s7) to get the final * value. (s0, s1, s2, s3) and (s4, s5, s6, s7) are generated by extracting the - * low and high ssef from s. + * low and high float4 from s. * */ -ccl_device_inline ssef quad_mix(avxf p, avxf q, ssef f) +ccl_device_inline float4 quad_mix(vfloat8 p, vfloat8 q, float4 f) { - ssef fv = shuffle<3>(f); - avxf s = mix(p, q, avxf(fv, fv)); + float4 fv = shuffle<3>(f); + vfloat8 s = mix(p, q, make_vfloat8(fv, fv)); return tri_mix(low(s), high(s), f); } @@ -565,25 +565,25 @@ ccl_device_inline ssef quad_mix(avxf p, avxf q, ssef f) */ ccl_device_noinline_cpu float perlin_3d(float x, float y, float z) { - ssei XYZ; - ssef fxyz = floorfrac(ssef(x, y, z, 0.0f), &XYZ); - ssef uvw = fade(fxyz); + int4 XYZ; + float4 fxyz = floorfrac(make_float4(x, y, z, 0.0f), &XYZ); + float4 uvw = fade(fxyz); - ssei XYZ1 = XYZ + 1; - ssei X = shuffle<0>(XYZ); - ssei X1 = shuffle<0>(XYZ1); - ssei Y = shuffle<1, 1, 1, 1>(XYZ, XYZ1); - ssei Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZ, XYZ1)); + int4 XYZ1 = XYZ + make_int4(1); + int4 X = shuffle<0>(XYZ); + int4 X1 = shuffle<0>(XYZ1); + int4 Y = shuffle<1, 1, 1, 1>(XYZ, XYZ1); + int4 Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZ, XYZ1)); - avxi h = hash_avxi3(avxi(X, X1), avxi(Y, Y), avxi(Z, Z)); + vint8 h = hash_int8_3(make_vint8(X, X1), make_vint8(Y, Y), make_vint8(Z, Z)); - ssef fxyz1 = fxyz - 1.0f; - ssef fx = shuffle<0>(fxyz); - ssef fx1 = shuffle<0>(fxyz1); - ssef fy = shuffle<1, 1, 1, 1>(fxyz, fxyz1); - ssef fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyz, fxyz1)); + float4 fxyz1 = fxyz - make_float4(1.0f); + float4 fx = shuffle<0>(fxyz); + float4 fx1 = shuffle<0>(fxyz1); + float4 fy = shuffle<1, 1, 1, 1>(fxyz, fxyz1); + float4 fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyz, fxyz1)); - avxf g = grad(h, avxf(fx, fx1), avxf(fy, fy), avxf(fz, fz)); + vfloat8 g = grad(h, make_vfloat8(fx, fx1), make_vfloat8(fy, fy), make_vfloat8(fz, fz)); return extract<0>(tri_mix(low(g), high(g), uvw)); } @@ -617,31 +617,37 @@ ccl_device_noinline_cpu float perlin_3d(float x, float y, float z) */ ccl_device_noinline_cpu float perlin_4d(float x, float y, float z, float w) { - ssei XYZW; - ssef fxyzw = floorfrac(ssef(x, y, z, w), &XYZW); - ssef uvws = fade(fxyzw); - - ssei XYZW1 = XYZW + 1; - ssei X = shuffle<0>(XYZW); - ssei X1 = shuffle<0>(XYZW1); - ssei Y = shuffle<1, 1, 1, 1>(XYZW, XYZW1); - ssei Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZW, XYZW1)); - ssei W = shuffle<3>(XYZW); - ssei W1 = shuffle<3>(XYZW1); - - avxi h1 = hash_avxi4(avxi(X, X1), avxi(Y, Y), avxi(Z, Z), avxi(W, W)); - avxi h2 = hash_avxi4(avxi(X, X1), avxi(Y, Y), avxi(Z, Z), avxi(W1, W1)); - - ssef fxyzw1 = fxyzw - 1.0f; - ssef fx = shuffle<0>(fxyzw); - ssef fx1 = shuffle<0>(fxyzw1); - ssef fy = shuffle<1, 1, 1, 1>(fxyzw, fxyzw1); - ssef fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyzw, fxyzw1)); - ssef fw = shuffle<3>(fxyzw); - ssef fw1 = shuffle<3>(fxyzw1); - - avxf g1 = grad(h1, avxf(fx, fx1), avxf(fy, fy), avxf(fz, fz), avxf(fw, fw)); - avxf g2 = grad(h2, avxf(fx, fx1), avxf(fy, fy), avxf(fz, fz), avxf(fw1, fw1)); + int4 XYZW; + float4 fxyzw = floorfrac(make_float4(x, y, z, w), &XYZW); + float4 uvws = fade(fxyzw); + + int4 XYZW1 = XYZW + make_int4(1); + int4 X = shuffle<0>(XYZW); + int4 X1 = shuffle<0>(XYZW1); + int4 Y = shuffle<1, 1, 1, 1>(XYZW, XYZW1); + int4 Z = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(XYZW, XYZW1)); + int4 W = shuffle<3>(XYZW); + int4 W1 = shuffle<3>(XYZW1); + + vint8 h1 = hash_int8_4(make_vint8(X, X1), make_vint8(Y, Y), make_vint8(Z, Z), make_vint8(W, W)); + vint8 h2 = hash_int8_4( + make_vint8(X, X1), make_vint8(Y, Y), make_vint8(Z, Z), make_vint8(W1, W1)); + + float4 fxyzw1 = fxyzw - make_float4(1.0f); + float4 fx = shuffle<0>(fxyzw); + float4 fx1 = shuffle<0>(fxyzw1); + float4 fy = shuffle<1, 1, 1, 1>(fxyzw, fxyzw1); + float4 fz = shuffle<0, 2, 0, 2>(shuffle<2, 2, 2, 2>(fxyzw, fxyzw1)); + float4 fw = shuffle<3>(fxyzw); + float4 fw1 = shuffle<3>(fxyzw1); + + vfloat8 g1 = grad( + h1, make_vfloat8(fx, fx1), make_vfloat8(fy, fy), make_vfloat8(fz, fz), make_vfloat8(fw, fw)); + vfloat8 g2 = grad(h2, + make_vfloat8(fx, fx1), + make_vfloat8(fy, fy), + make_vfloat8(fz, fz), + make_vfloat8(fw1, fw1)); return extract<0>(quad_mix(g1, g2, uvws)); } diff --git a/intern/cycles/test/CMakeLists.txt b/intern/cycles/test/CMakeLists.txt index c3ae81ed1db..34e5a4770ea 100644 --- a/intern/cycles/test/CMakeLists.txt +++ b/intern/cycles/test/CMakeLists.txt @@ -45,17 +45,24 @@ set(SRC # Disable AVX tests on macOS. Rosetta has problems running them, and other # platforms should be enough to verify AVX operations are implemented correctly. if(NOT APPLE) + if(CXX_HAS_SSE) + list(APPEND SRC + util_float8_sse2_test.cpp + ) + set_source_files_properties(util_float8_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}") + endif() + if(CXX_HAS_AVX) list(APPEND SRC - util_avxf_avx_test.cpp + util_float8_avx_test.cpp ) - set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") + set_source_files_properties(util_float8_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}") endif() if(CXX_HAS_AVX2) list(APPEND SRC - util_avxf_avx2_test.cpp + util_float8_avx2_test.cpp ) - set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") + set_source_files_properties(util_float8_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}") endif() endif() diff --git a/intern/cycles/test/util_avxf_test.h b/intern/cycles/test/util_avxf_test.h deleted file mode 100644 index 34d966cc1a4..00000000000 --- a/intern/cycles/test/util_avxf_test.h +++ /dev/null @@ -1,211 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2011-2022 Blender Foundation */ - -#include "testing/testing.h" -#include "util/system.h" -#include "util/types.h" - -CCL_NAMESPACE_BEGIN - -static bool validate_cpu_capabilities() -{ - -#ifdef __KERNEL_AVX2__ - return system_cpu_support_avx2(); -#else -# ifdef __KERNEL_AVX__ - return system_cpu_support_avx(); -# endif -#endif -} - -#define INIT_AVX_TEST \ - if (!validate_cpu_capabilities()) \ - return; \ -\ - const avxf avxf_a(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f); \ - const avxf avxf_b(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); \ - const avxf avxf_c(1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f); - -#define compare_vector_scalar(a, b) \ - for (size_t index = 0; index < a.size; index++) \ - EXPECT_FLOAT_EQ(a[index], b); - -#define compare_vector_vector(a, b) \ - for (size_t index = 0; index < a.size; index++) \ - EXPECT_FLOAT_EQ(a[index], b[index]); - -#define compare_vector_vector_near(a, b, abserror) \ - for (size_t index = 0; index < a.size; index++) \ - EXPECT_NEAR(a[index], b[index], abserror); - -#define basic_test_vv(a, b, op) \ - INIT_AVX_TEST \ - avxf c = a op b; \ - for (size_t i = 0; i < a.size; i++) \ - EXPECT_FLOAT_EQ(c[i], a[i] op b[i]); - -/* vector op float tests */ -#define basic_test_vf(a, b, op) \ - INIT_AVX_TEST \ - avxf c = a op b; \ - for (size_t i = 0; i < a.size; i++) \ - EXPECT_FLOAT_EQ(c[i], a[i] op b); - -static const float float_b = 1.5f; - -TEST(TEST_CATEGORY_NAME, avxf_add_vv){basic_test_vv(avxf_a, avxf_b, +)} TEST(TEST_CATEGORY_NAME, - avxf_sub_vv){ - basic_test_vv(avxf_a, avxf_b, -)} TEST(TEST_CATEGORY_NAME, avxf_mul_vv){ - basic_test_vv(avxf_a, avxf_b, *)} TEST(TEST_CATEGORY_NAME, avxf_div_vv){ - basic_test_vv(avxf_a, avxf_b, /)} TEST(TEST_CATEGORY_NAME, avxf_add_vf){ - basic_test_vf(avxf_a, float_b, +)} TEST(TEST_CATEGORY_NAME, avxf_sub_vf){ - basic_test_vf(avxf_a, float_b, -)} TEST(TEST_CATEGORY_NAME, avxf_mul_vf){ - basic_test_vf(avxf_a, float_b, *)} TEST(TEST_CATEGORY_NAME, - avxf_div_vf){basic_test_vf(avxf_a, float_b, /)} - -TEST(TEST_CATEGORY_NAME, avxf_ctor) -{ - INIT_AVX_TEST - compare_vector_scalar(avxf(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f), - static_cast<float>(index)); - compare_vector_scalar(avxf(1.0f), 1.0f); - compare_vector_vector(avxf(1.0f, 2.0f), avxf(1.0f, 1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f, 2.0f)); - compare_vector_vector(avxf(1.0f, 2.0f, 3.0f, 4.0f), - avxf(1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f)); - compare_vector_vector(avxf(make_float3(1.0f, 2.0f, 3.0f)), - avxf(0.0f, 3.0f, 2.0f, 1.0f, 0.0f, 3.0f, 2.0f, 1.0f)); -} - -TEST(TEST_CATEGORY_NAME, avxf_sqrt) -{ - INIT_AVX_TEST - compare_vector_vector(mm256_sqrt(avxf(1.0f, 4.0f, 9.0f, 16.0f, 25.0f, 36.0f, 49.0f, 64.0f)), - avxf(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); -} - -TEST(TEST_CATEGORY_NAME, avxf_min_max) -{ - INIT_AVX_TEST - compare_vector_vector(min(avxf_a, avxf_b), avxf_a); - compare_vector_vector(max(avxf_a, avxf_b), avxf_b); -} - -TEST(TEST_CATEGORY_NAME, avxf_set_sign) -{ - INIT_AVX_TEST - avxf res = set_sign_bit<1, 0, 0, 0, 0, 0, 0, 0>(avxf_a); - compare_vector_vector(res, avxf(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, -0.8f)); -} - -TEST(TEST_CATEGORY_NAME, avxf_msub) -{ - INIT_AVX_TEST - avxf res = msub(avxf_a, avxf_b, avxf_c); - avxf exp = avxf((avxf_a[7] * avxf_b[7]) - avxf_c[7], - (avxf_a[6] * avxf_b[6]) - avxf_c[6], - (avxf_a[5] * avxf_b[5]) - avxf_c[5], - (avxf_a[4] * avxf_b[4]) - avxf_c[4], - (avxf_a[3] * avxf_b[3]) - avxf_c[3], - (avxf_a[2] * avxf_b[2]) - avxf_c[2], - (avxf_a[1] * avxf_b[1]) - avxf_c[1], - (avxf_a[0] * avxf_b[0]) - avxf_c[0]); - compare_vector_vector(res, exp); -} - -TEST(TEST_CATEGORY_NAME, avxf_madd) -{ - INIT_AVX_TEST - avxf res = madd(avxf_a, avxf_b, avxf_c); - avxf exp = avxf((avxf_a[7] * avxf_b[7]) + avxf_c[7], - (avxf_a[6] * avxf_b[6]) + avxf_c[6], - (avxf_a[5] * avxf_b[5]) + avxf_c[5], - (avxf_a[4] * avxf_b[4]) + avxf_c[4], - (avxf_a[3] * avxf_b[3]) + avxf_c[3], - (avxf_a[2] * avxf_b[2]) + avxf_c[2], - (avxf_a[1] * avxf_b[1]) + avxf_c[1], - (avxf_a[0] * avxf_b[0]) + avxf_c[0]); - compare_vector_vector(res, exp); -} - -TEST(TEST_CATEGORY_NAME, avxf_nmadd) -{ - INIT_AVX_TEST - avxf res = nmadd(avxf_a, avxf_b, avxf_c); - avxf exp = avxf(avxf_c[7] - (avxf_a[7] * avxf_b[7]), - avxf_c[6] - (avxf_a[6] * avxf_b[6]), - avxf_c[5] - (avxf_a[5] * avxf_b[5]), - avxf_c[4] - (avxf_a[4] * avxf_b[4]), - avxf_c[3] - (avxf_a[3] * avxf_b[3]), - avxf_c[2] - (avxf_a[2] * avxf_b[2]), - avxf_c[1] - (avxf_a[1] * avxf_b[1]), - avxf_c[0] - (avxf_a[0] * avxf_b[0])); - compare_vector_vector(res, exp); -} - -TEST(TEST_CATEGORY_NAME, avxf_compare) -{ - INIT_AVX_TEST - avxf a(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f); - avxf b(7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f, 0.0f); - avxb res = a <= b; - int exp[8] = { - a[0] <= b[0] ? -1 : 0, - a[1] <= b[1] ? -1 : 0, - a[2] <= b[2] ? -1 : 0, - a[3] <= b[3] ? -1 : 0, - a[4] <= b[4] ? -1 : 0, - a[5] <= b[5] ? -1 : 0, - a[6] <= b[6] ? -1 : 0, - a[7] <= b[7] ? -1 : 0, - }; - compare_vector_vector(res, exp); -} - -TEST(TEST_CATEGORY_NAME, avxf_permute) -{ - INIT_AVX_TEST - avxf res = permute<3, 0, 1, 7, 6, 5, 2, 4>(avxf_b); - compare_vector_vector(res, avxf(4.0f, 6.0f, 3.0f, 2.0f, 1.0f, 7.0f, 8.0f, 5.0f)); -} - -TEST(TEST_CATEGORY_NAME, avxf_blend) -{ - INIT_AVX_TEST - avxf res = blend<0, 0, 1, 0, 1, 0, 1, 0>(avxf_a, avxf_b); - compare_vector_vector(res, avxf(0.1f, 0.2f, 3.0f, 0.4f, 5.0f, 0.6f, 7.0f, 0.8f)); -} - -TEST(TEST_CATEGORY_NAME, avxf_shuffle) -{ - INIT_AVX_TEST - avxf res = shuffle<0, 1, 2, 3, 1, 3, 2, 0>(avxf_a); - compare_vector_vector(res, avxf(0.4f, 0.2f, 0.1f, 0.3f, 0.5f, 0.6f, 0.7f, 0.8f)); -} - -TEST(TEST_CATEGORY_NAME, avxf_cross) -{ - INIT_AVX_TEST - avxf res = cross(avxf_b, avxf_c); - compare_vector_vector_near(res, - avxf(0.0f, - -9.5367432e-07f, - 0.0f, - 4.7683716e-07f, - 0.0f, - -3.8146973e-06f, - 3.8146973e-06f, - 3.8146973e-06f), - 0.000002000f); -} - -TEST(TEST_CATEGORY_NAME, avxf_dot3) -{ - INIT_AVX_TEST - float den, den2; - dot3(avxf_a, avxf_b, den, den2); - EXPECT_FLOAT_EQ(den, 14.9f); - EXPECT_FLOAT_EQ(den2, 2.9f); -} - -CCL_NAMESPACE_END diff --git a/intern/cycles/test/util_avxf_avx2_test.cpp b/intern/cycles/test/util_float8_avx2_test.cpp index 992c4d9a913..4682dce5b23 100644 --- a/intern/cycles/test/util_avxf_avx2_test.cpp +++ b/intern/cycles/test/util_float8_avx2_test.cpp @@ -1,11 +1,13 @@ /* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2022 Blender Foundation */ +#define __KERNEL_SSE__ +#define __KERNEL_AVX__ #define __KERNEL_AVX2__ #define TEST_CATEGORY_NAME util_avx2 #if (defined(i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)) && \ defined(__AVX2__) -# include "util_avxf_test.h" +# include "util_float8_test.h" #endif diff --git a/intern/cycles/test/util_avxf_avx_test.cpp b/intern/cycles/test/util_float8_avx_test.cpp index abb98cdfb38..34fe750e766 100644 --- a/intern/cycles/test/util_avxf_avx_test.cpp +++ b/intern/cycles/test/util_float8_avx_test.cpp @@ -1,11 +1,12 @@ /* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2022 Blender Foundation */ +#define __KERNEL_SSE__ #define __KERNEL_AVX__ #define TEST_CATEGORY_NAME util_avx #if (defined(i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)) && \ defined(__AVX__) -# include "util_avxf_test.h" +# include "util_float8_test.h" #endif diff --git a/intern/cycles/test/util_float8_sse2_test.cpp b/intern/cycles/test/util_float8_sse2_test.cpp new file mode 100644 index 00000000000..ba8952a2b08 --- /dev/null +++ b/intern/cycles/test/util_float8_sse2_test.cpp @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2022 Blender Foundation */ + +#define __KERNEL_SSE__ +#define __KERNEL_SSE2__ + +#define TEST_CATEGORY_NAME util_sse2 + +#if (defined(i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)) && \ + defined(__SSE2__) +# include "util_float8_test.h" +#endif diff --git a/intern/cycles/test/util_float8_test.h b/intern/cycles/test/util_float8_test.h new file mode 100644 index 00000000000..54701afaf8b --- /dev/null +++ b/intern/cycles/test/util_float8_test.h @@ -0,0 +1,103 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2022 Blender Foundation */ + +#include "testing/testing.h" +#include "util/math.h" +#include "util/system.h" +#include "util/types.h" + +CCL_NAMESPACE_BEGIN + +static bool validate_cpu_capabilities() +{ + +#if defined(__KERNEL_AVX2__) + return system_cpu_support_avx2(); +#elif defined(__KERNEL_AVX__) + return system_cpu_support_avx(); +#elif defined(__KERNEL_SSE2__) + return system_cpu_support_sse2(); +#else + return false; +#endif +} + +#define INIT_FLOAT8_TEST \ + if (!validate_cpu_capabilities()) \ + return; \ +\ + const vfloat8 float8_a = make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f); \ + const vfloat8 float8_b = make_vfloat8(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); \ + const vfloat8 float8_c = make_vfloat8(1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f); + +#define compare_vector_scalar(a, b) \ + for (size_t index = 0; index < 8; index++) \ + EXPECT_FLOAT_EQ(a[index], b); + +#define compare_vector_vector(a, b) \ + for (size_t index = 0; index < 8; index++) \ + EXPECT_FLOAT_EQ(a[index], b[index]); + +#define compare_vector_vector_near(a, b, abserror) \ + for (size_t index = 0; index < 8; index++) \ + EXPECT_NEAR(a[index], b[index], abserror); + +#define basic_test_vv(a, b, op) \ + INIT_FLOAT8_TEST \ + vfloat8 c = a op b; \ + for (size_t i = 0; i < 8; i++) \ + EXPECT_FLOAT_EQ(c[i], a[i] op b[i]); + +/* vector op float tests */ +#define basic_test_vf(a, b, op) \ + INIT_FLOAT8_TEST \ + vfloat8 c = a op b; \ + for (size_t i = 0; i < 8; i++) \ + EXPECT_FLOAT_EQ(c[i], a[i] op b); + +static const float float_b = 1.5f; + +TEST(TEST_CATEGORY_NAME, + float8_add_vv){basic_test_vv(float8_a, float8_b, +)} TEST(TEST_CATEGORY_NAME, float8_sub_vv){ + basic_test_vv(float8_a, float8_b, -)} TEST(TEST_CATEGORY_NAME, float8_mul_vv){ + basic_test_vv(float8_a, float8_b, *)} TEST(TEST_CATEGORY_NAME, float8_div_vv){ + basic_test_vv(float8_a, float8_b, /)} TEST(TEST_CATEGORY_NAME, float8_add_vf){ + basic_test_vf(float8_a, float_b, +)} TEST(TEST_CATEGORY_NAME, float8_sub_vf){ + basic_test_vf(float8_a, float_b, -)} TEST(TEST_CATEGORY_NAME, float8_mul_vf){ + basic_test_vf(float8_a, float_b, *)} TEST(TEST_CATEGORY_NAME, + float8_div_vf){basic_test_vf(float8_a, float_b, /)} + +TEST(TEST_CATEGORY_NAME, float8_ctor) +{ + INIT_FLOAT8_TEST + compare_vector_scalar(make_vfloat8(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f), + static_cast<float>(index)); + compare_vector_scalar(make_vfloat8(1.0f), 1.0f); +} + +TEST(TEST_CATEGORY_NAME, float8_sqrt) +{ + INIT_FLOAT8_TEST + compare_vector_vector(sqrt(make_vfloat8(1.0f, 4.0f, 9.0f, 16.0f, 25.0f, 36.0f, 49.0f, 64.0f)), + make_vfloat8(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); +} + +TEST(TEST_CATEGORY_NAME, float8_min_max) +{ + INIT_FLOAT8_TEST + compare_vector_vector(min(float8_a, float8_b), float8_a); + compare_vector_vector(max(float8_a, float8_b), float8_b); +} + +TEST(TEST_CATEGORY_NAME, float8_shuffle) +{ + INIT_FLOAT8_TEST + vfloat8 res0 = shuffle<0, 1, 2, 3, 1, 3, 2, 0>(float8_a); + compare_vector_vector(res0, make_vfloat8(0.1f, 0.2f, 0.3f, 0.4f, 0.6f, 0.8f, 0.7f, 0.5f)); + vfloat8 res1 = shuffle<3>(float8_a); + compare_vector_vector(res1, make_vfloat8(0.4f, 0.4f, 0.4f, 0.4f, 0.8f, 0.8f, 0.8f, 0.8f)); + vfloat8 res2 = shuffle<3, 2, 1, 0>(float8_a, float8_b); + compare_vector_vector(res2, make_vfloat8(0.4f, 0.3f, 2.0f, 1.0f, 0.8f, 0.7f, 6.0f, 5.0f)); +} + +CCL_NAMESPACE_END diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index 57628f99e35..7f8f4a5ce76 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -69,6 +69,7 @@ set(SRC_HEADERS math_int2.h math_int3.h math_int4.h + math_int8.h math_matrix.h md5.h murmurhash.h @@ -85,13 +86,7 @@ set(SRC_HEADERS rect.h set.h simd.h - avxf.h - avxb.h - avxi.h semaphore.h - sseb.h - ssef.h - ssei.h stack_allocator.h static_assert.h stats.h @@ -118,6 +113,8 @@ set(SRC_HEADERS types_int3_impl.h types_int4.h types_int4_impl.h + types_int8.h + types_int8_impl.h types_spectrum.h types_uchar2.h types_uchar2_impl.h diff --git a/intern/cycles/util/avxb.h b/intern/cycles/util/avxb.h deleted file mode 100644 index fa3cb565309..00000000000 --- a/intern/cycles/util/avxb.h +++ /dev/null @@ -1,230 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2011-2013 Intel Corporation - * Modifications Copyright 2014-2022 Blender Foundation. */ - -#ifndef __UTIL_AVXB_H__ -#define __UTIL_AVXB_H__ - -CCL_NAMESPACE_BEGIN - -struct avxf; - -/*! 4-wide SSE bool type. */ -struct avxb { - typedef avxb Mask; // mask type - typedef avxf Float; // float type - - enum { size = 8 }; // number of SIMD elements - union { - __m256 m256; - int32_t v[8]; - }; // data - - //////////////////////////////////////////////////////////////////////////////// - /// Constructors, Assignment & Cast Operators - //////////////////////////////////////////////////////////////////////////////// - - __forceinline avxb() - { - } - __forceinline avxb(const avxb &other) - { - m256 = other.m256; - } - __forceinline avxb &operator=(const avxb &other) - { - m256 = other.m256; - return *this; - } - - __forceinline avxb(const __m256 input) : m256(input) - { - } - __forceinline avxb(const __m128 &a, const __m128 &b) - : m256(_mm256_insertf128_ps(_mm256_castps128_ps256(a), b, 1)) - { - } - __forceinline operator const __m256 &(void) const - { - return m256; - } - __forceinline operator const __m256i(void) const - { - return _mm256_castps_si256(m256); - } - __forceinline operator const __m256d(void) const - { - return _mm256_castps_pd(m256); - } - - //////////////////////////////////////////////////////////////////////////////// - /// Constants - //////////////////////////////////////////////////////////////////////////////// - - __forceinline avxb(FalseTy) : m256(_mm256_setzero_ps()) - { - } - __forceinline avxb(TrueTy) : m256(_mm256_castsi256_ps(_mm256_set1_epi32(-1))) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Array Access - //////////////////////////////////////////////////////////////////////////////// - - __forceinline bool operator[](const size_t i) const - { - assert(i < 8); - return (_mm256_movemask_ps(m256) >> i) & 1; - } - __forceinline int32_t &operator[](const size_t i) - { - assert(i < 8); - return v[i]; - } -}; - -//////////////////////////////////////////////////////////////////////////////// -/// Unary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxb operator!(const avxb &a) -{ - return _mm256_xor_ps(a, avxb(True)); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Binary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxb operator&(const avxb &a, const avxb &b) -{ - return _mm256_and_ps(a, b); -} -__forceinline const avxb operator|(const avxb &a, const avxb &b) -{ - return _mm256_or_ps(a, b); -} -__forceinline const avxb operator^(const avxb &a, const avxb &b) -{ - return _mm256_xor_ps(a, b); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Assignment Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxb operator&=(avxb &a, const avxb &b) -{ - return a = a & b; -} -__forceinline const avxb operator|=(avxb &a, const avxb &b) -{ - return a = a | b; -} -__forceinline const avxb operator^=(avxb &a, const avxb &b) -{ - return a = a ^ b; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Comparison Operators + Select -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxb operator!=(const avxb &a, const avxb &b) -{ - return _mm256_xor_ps(a, b); -} -__forceinline const avxb operator==(const avxb &a, const avxb &b) -{ -#ifdef __KERNEL_AVX2__ - return _mm256_castsi256_ps(_mm256_cmpeq_epi32(a, b)); -#else - __m128i a_lo = _mm_castps_si128(_mm256_extractf128_ps(a, 0)); - __m128i a_hi = _mm_castps_si128(_mm256_extractf128_ps(a, 1)); - __m128i b_lo = _mm_castps_si128(_mm256_extractf128_ps(b, 0)); - __m128i b_hi = _mm_castps_si128(_mm256_extractf128_ps(b, 1)); - __m128i c_lo = _mm_cmpeq_epi32(a_lo, b_lo); - __m128i c_hi = _mm_cmpeq_epi32(a_hi, b_hi); - __m256i result = _mm256_insertf128_si256(_mm256_castsi128_si256(c_lo), c_hi, 1); - return _mm256_castsi256_ps(result); -#endif -} - -__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f) -{ -#if defined(__KERNEL_SSE41__) - return _mm256_blendv_ps(f, t, m); -#else - return _mm256_or_ps(_mm256_and_ps(m, t), _mm256_andnot_ps(m, f)); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Movement/Shifting/Shuffling Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxb unpacklo(const avxb &a, const avxb &b) -{ - return _mm256_unpacklo_ps(a, b); -} -__forceinline const avxb unpackhi(const avxb &a, const avxb &b) -{ - return _mm256_unpackhi_ps(a, b); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Reduction Operations -//////////////////////////////////////////////////////////////////////////////// - -#if defined(__KERNEL_SSE41__) -__forceinline uint32_t popcnt(const avxb &a) -{ - return _mm_popcnt_u32(_mm256_movemask_ps(a)); -} -#else -__forceinline uint32_t popcnt(const avxb &a) -{ - return bool(a[0]) + bool(a[1]) + bool(a[2]) + bool(a[3]) + bool(a[4]) + bool(a[5]) + bool(a[6]) + - bool(a[7]); -} -#endif - -__forceinline bool reduce_and(const avxb &a) -{ - return _mm256_movemask_ps(a) == 0xf; -} -__forceinline bool reduce_or(const avxb &a) -{ - return _mm256_movemask_ps(a) != 0x0; -} -__forceinline bool all(const avxb &b) -{ - return _mm256_movemask_ps(b) == 0xf; -} -__forceinline bool any(const avxb &b) -{ - return _mm256_movemask_ps(b) != 0x0; -} -__forceinline bool none(const avxb &b) -{ - return _mm256_movemask_ps(b) == 0x0; -} - -__forceinline uint32_t movemask(const avxb &a) -{ - return _mm256_movemask_ps(a); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Debug Functions -//////////////////////////////////////////////////////////////////////////////// - -ccl_device_inline void print_avxb(const char *label, const avxb &a) -{ - printf("%s: %d %d %d %d %d %d %d %d\n", label, a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]); -} - -CCL_NAMESPACE_END - -#endif diff --git a/intern/cycles/util/avxf.h b/intern/cycles/util/avxf.h deleted file mode 100644 index 03a13f30490..00000000000 --- a/intern/cycles/util/avxf.h +++ /dev/null @@ -1,379 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2016 Intel Corporation */ - -#ifndef __UTIL_AVXF_H__ -#define __UTIL_AVXF_H__ - -CCL_NAMESPACE_BEGIN - -struct avxb; - -struct avxf { - typedef avxf Float; - - enum { size = 8 }; /* Number of SIMD elements. */ - - union { - __m256 m256; - float f[8]; - int i[8]; - }; - - __forceinline avxf() - { - } - __forceinline avxf(const avxf &other) - { - m256 = other.m256; - } - __forceinline avxf &operator=(const avxf &other) - { - m256 = other.m256; - return *this; - } - - __forceinline avxf(const __m256 a) : m256(a) - { - } - __forceinline avxf(const __m256i a) : m256(_mm256_castsi256_ps(a)) - { - } - - __forceinline operator const __m256 &() const - { - return m256; - } - __forceinline operator __m256 &() - { - return m256; - } - - __forceinline avxf(float a) : m256(_mm256_set1_ps(a)) - { - } - - __forceinline avxf(float high32x4, float low32x4) - : m256(_mm256_set_ps( - high32x4, high32x4, high32x4, high32x4, low32x4, low32x4, low32x4, low32x4)) - { - } - - __forceinline avxf(float a3, float a2, float a1, float a0) - : m256(_mm256_set_ps(a3, a2, a1, a0, a3, a2, a1, a0)) - { - } - - __forceinline avxf( - float a7, float a6, float a5, float a4, float a3, float a2, float a1, float a0) - : m256(_mm256_set_ps(a7, a6, a5, a4, a3, a2, a1, a0)) - { - } - - __forceinline avxf(float3 a) : m256(_mm256_set_ps(a.w, a.z, a.y, a.x, a.w, a.z, a.y, a.x)) - { - } - - __forceinline avxf(int a3, int a2, int a1, int a0) - { - const __m256i foo = _mm256_set_epi32(a3, a2, a1, a0, a3, a2, a1, a0); - m256 = _mm256_castsi256_ps(foo); - } - - __forceinline avxf(int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0) - { - const __m256i foo = _mm256_set_epi32(a7, a6, a5, a4, a3, a2, a1, a0); - m256 = _mm256_castsi256_ps(foo); - } - - __forceinline avxf(__m128 a, __m128 b) - { - const __m256 foo = _mm256_castps128_ps256(a); - m256 = _mm256_insertf128_ps(foo, b, 1); - } - - __forceinline const float &operator[](const size_t i) const - { - assert(i < 8); - return f[i]; - } - __forceinline float &operator[](const size_t i) - { - assert(i < 8); - return f[i]; - } -}; - -__forceinline avxf cross(const avxf &a, const avxf &b) -{ - avxf r(0.0, - a[4] * b[5] - a[5] * b[4], - a[6] * b[4] - a[4] * b[6], - a[5] * b[6] - a[6] * b[5], - 0.0, - a[0] * b[1] - a[1] * b[0], - a[2] * b[0] - a[0] * b[2], - a[1] * b[2] - a[2] * b[1]); - return r; -} - -__forceinline void dot3(const avxf &a, const avxf &b, float &den, float &den2) -{ - const avxf t = _mm256_mul_ps(a.m256, b.m256); - den = ((float *)&t)[0] + ((float *)&t)[1] + ((float *)&t)[2]; - den2 = ((float *)&t)[4] + ((float *)&t)[5] + ((float *)&t)[6]; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Unary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxf cast(const __m256i &a) -{ - return _mm256_castsi256_ps(a); -} - -__forceinline const avxf mm256_sqrt(const avxf &a) -{ - return _mm256_sqrt_ps(a.m256); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Binary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxf operator+(const avxf &a, const avxf &b) -{ - return _mm256_add_ps(a.m256, b.m256); -} -__forceinline const avxf operator+(const avxf &a, const float &b) -{ - return a + avxf(b); -} -__forceinline const avxf operator+(const float &a, const avxf &b) -{ - return avxf(a) + b; -} - -__forceinline const avxf operator-(const avxf &a, const avxf &b) -{ - return _mm256_sub_ps(a.m256, b.m256); -} -__forceinline const avxf operator-(const avxf &a, const float &b) -{ - return a - avxf(b); -} -__forceinline const avxf operator-(const float &a, const avxf &b) -{ - return avxf(a) - b; -} - -__forceinline const avxf operator*(const avxf &a, const avxf &b) -{ - return _mm256_mul_ps(a.m256, b.m256); -} -__forceinline const avxf operator*(const avxf &a, const float &b) -{ - return a * avxf(b); -} -__forceinline const avxf operator*(const float &a, const avxf &b) -{ - return avxf(a) * b; -} - -__forceinline const avxf operator/(const avxf &a, const avxf &b) -{ - return _mm256_div_ps(a.m256, b.m256); -} -__forceinline const avxf operator/(const avxf &a, const float &b) -{ - return a / avxf(b); -} -__forceinline const avxf operator/(const float &a, const avxf &b) -{ - return avxf(a) / b; -} - -__forceinline const avxf operator|(const avxf &a, const avxf &b) -{ - return _mm256_or_ps(a.m256, b.m256); -} - -__forceinline const avxf operator^(const avxf &a, const avxf &b) -{ - return _mm256_xor_ps(a.m256, b.m256); -} - -__forceinline const avxf operator&(const avxf &a, const avxf &b) -{ - return _mm256_and_ps(a.m256, b.m256); -} - -__forceinline const avxf max(const avxf &a, const avxf &b) -{ - return _mm256_max_ps(a.m256, b.m256); -} -__forceinline const avxf min(const avxf &a, const avxf &b) -{ - return _mm256_min_ps(a.m256, b.m256); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Movement/Shifting/Shuffling Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxf shuffle(const avxf &a, const __m256i &shuf) -{ - return _mm256_permutevar_ps(a, shuf); -} - -template<int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7> -__forceinline const avxf shuffle(const avxf &a) -{ - return _mm256_permutevar_ps(a, _mm256_set_epi32(i7, i6, i5, i4, i3, i2, i1, i0)); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const avxf shuffle(const avxf &a, const avxf &b) -{ - return _mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); -} -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const avxf shuffle(const avxf &a) -{ - return shuffle<i0, i1, i2, i3>(a, a); -} -template<size_t i0> __forceinline const avxf shuffle(const avxf &a, const avxf &b) -{ - return shuffle<i0, i0, i0, i0>(a, b); -} -template<size_t i0> __forceinline const avxf shuffle(const avxf &a) -{ - return shuffle<i0>(a, a); -} - -template<size_t i> __forceinline float extract(const avxf &a) -{ - __m256 b = shuffle<i, i, i, i>(a).m256; - return _mm256_cvtss_f32(b); -} -template<> __forceinline float extract<0>(const avxf &a) -{ - return _mm256_cvtss_f32(a.m256); -} - -__forceinline ssef low(const avxf &a) -{ - return _mm256_extractf128_ps(a.m256, 0); -} -__forceinline ssef high(const avxf &a) -{ - return _mm256_extractf128_ps(a.m256, 1); -} - -template<int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7> -__forceinline const avxf permute(const avxf &a) -{ -#ifdef __KERNEL_AVX2__ - return _mm256_permutevar8x32_ps(a, _mm256_set_epi32(i7, i6, i5, i4, i3, i2, i1, i0)); -#else - float temp[8]; - _mm256_storeu_ps((float *)&temp, a); - return avxf(temp[i7], temp[i6], temp[i5], temp[i4], temp[i3], temp[i2], temp[i1], temp[i0]); -#endif -} - -template<int S0, int S1, int S2, int S3, int S4, int S5, int S6, int S7> -ccl_device_inline const avxf set_sign_bit(const avxf &a) -{ - return a ^ avxf(S7 << 31, S6 << 31, S5 << 31, S4 << 31, S3 << 31, S2 << 31, S1 << 31, S0 << 31); -} - -template<size_t S0, size_t S1, size_t S2, size_t S3, size_t S4, size_t S5, size_t S6, size_t S7> -ccl_device_inline const avxf blend(const avxf &a, const avxf &b) -{ - return _mm256_blend_ps( - a, b, S7 << 0 | S6 << 1 | S5 << 2 | S4 << 3 | S3 << 4 | S2 << 5 | S1 << 6 | S0 << 7); -} - -template<size_t S0, size_t S1, size_t S2, size_t S3> -ccl_device_inline const avxf blend(const avxf &a, const avxf &b) -{ - return blend<S0, S1, S2, S3, S0, S1, S2, S3>(a, b); -} - -//#if defined(__KERNEL_SSE41__) -__forceinline avxf maxi(const avxf &a, const avxf &b) -{ - const avxf ci = _mm256_max_ps(a, b); - return ci; -} - -__forceinline avxf mini(const avxf &a, const avxf &b) -{ - const avxf ci = _mm256_min_ps(a, b); - return ci; -} -//#endif - -//////////////////////////////////////////////////////////////////////////////// -/// Ternary Operators -//////////////////////////////////////////////////////////////////////////////// -__forceinline const avxf madd(const avxf &a, const avxf &b, const avxf &c) -{ -#ifdef __KERNEL_AVX2__ - return _mm256_fmadd_ps(a, b, c); -#else - return c + (a * b); -#endif -} - -__forceinline const avxf nmadd(const avxf &a, const avxf &b, const avxf &c) -{ -#ifdef __KERNEL_AVX2__ - return _mm256_fnmadd_ps(a, b, c); -#else - return c - (a * b); -#endif -} -__forceinline const avxf msub(const avxf &a, const avxf &b, const avxf &c) -{ -#ifdef __KERNEL_AVX2__ - return _mm256_fmsub_ps(a, b, c); -#else - return (a * b) - c; -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Comparison Operators + Select -//////////////////////////////////////////////////////////////////////////////// -__forceinline const avxb operator<=(const avxf &a, const avxf &b) -{ - return _mm256_cmp_ps(a.m256, b.m256, _CMP_LE_OS); -} - -__forceinline const avxf select(const avxb &m, const avxf &t, const avxf &f) -{ - return _mm256_blendv_ps(f, t, m); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Common Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline avxf mix(const avxf &a, const avxf &b, const avxf &t) -{ - return madd(t, b, (avxf(1.0f) - t) * a); -} - -#ifndef _mm256_set_m128 -# define _mm256_set_m128(/* __m128 */ hi, /* __m128 */ lo) \ - _mm256_insertf128_ps(_mm256_castps128_ps256(lo), (hi), 0x1) -#endif - -#define _mm256_loadu2_m128(/* float const* */ hiaddr, /* float const* */ loaddr) \ - _mm256_set_m128(_mm_loadu_ps(hiaddr), _mm_loadu_ps(loaddr)) - -CCL_NAMESPACE_END - -#endif diff --git a/intern/cycles/util/avxi.h b/intern/cycles/util/avxi.h deleted file mode 100644 index 966a04a6b97..00000000000 --- a/intern/cycles/util/avxi.h +++ /dev/null @@ -1,732 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2009-2013 Intel Corporation */ - -#ifndef __UTIL_AVXI_H__ -#define __UTIL_AVXI_H__ - -CCL_NAMESPACE_BEGIN - -struct avxb; - -struct avxi { - typedef avxb Mask; // mask type for us - enum { size = 8 }; // number of SIMD elements - union { // data - __m256i m256; -#if !defined(__KERNEL_AVX2__) - struct { - __m128i l, h; - }; -#endif - int32_t v[8]; - }; - - //////////////////////////////////////////////////////////////////////////////// - /// Constructors, Assignment & Cast Operators - //////////////////////////////////////////////////////////////////////////////// - - __forceinline avxi() - { - } - __forceinline avxi(const avxi &a) - { - m256 = a.m256; - } - __forceinline avxi &operator=(const avxi &a) - { - m256 = a.m256; - return *this; - } - - __forceinline avxi(const __m256i a) : m256(a) - { - } - __forceinline operator const __m256i &(void) const - { - return m256; - } - __forceinline operator __m256i &(void) - { - return m256; - } - - __forceinline explicit avxi(const ssei &a) - : m256(_mm256_insertf128_si256(_mm256_castsi128_si256(a), a, 1)) - { - } - __forceinline avxi(const ssei &a, const ssei &b) - : m256(_mm256_insertf128_si256(_mm256_castsi128_si256(a), b, 1)) - { - } -#if defined(__KERNEL_AVX2__) - __forceinline avxi(const __m128i &a, const __m128i &b) - : m256(_mm256_insertf128_si256(_mm256_castsi128_si256(a), b, 1)) - { - } -#else - __forceinline avxi(const __m128i &a, const __m128i &b) : l(a), h(b) - { - } -#endif - __forceinline explicit avxi(const int32_t *const a) - : m256(_mm256_castps_si256(_mm256_loadu_ps((const float *)a))) - { - } - __forceinline avxi(int32_t a) : m256(_mm256_set1_epi32(a)) - { - } - __forceinline avxi(int32_t a, int32_t b) : m256(_mm256_set_epi32(b, a, b, a, b, a, b, a)) - { - } - __forceinline avxi(int32_t a, int32_t b, int32_t c, int32_t d) - : m256(_mm256_set_epi32(d, c, b, a, d, c, b, a)) - { - } - __forceinline avxi( - int32_t a, int32_t b, int32_t c, int32_t d, int32_t e, int32_t f, int32_t g, int32_t h) - : m256(_mm256_set_epi32(h, g, f, e, d, c, b, a)) - { - } - - __forceinline explicit avxi(const __m256 a) : m256(_mm256_cvtps_epi32(a)) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Constants - //////////////////////////////////////////////////////////////////////////////// - - __forceinline avxi(ZeroTy) : m256(_mm256_setzero_si256()) - { - } -#if defined(__KERNEL_AVX2__) - __forceinline avxi(OneTy) : m256(_mm256_set1_epi32(1)) - { - } - __forceinline avxi(PosInfTy) : m256(_mm256_set1_epi32(pos_inf)) - { - } - __forceinline avxi(NegInfTy) : m256(_mm256_set1_epi32(neg_inf)) - { - } -#else - __forceinline avxi(OneTy) : m256(_mm256_set_epi32(1, 1, 1, 1, 1, 1, 1, 1)) - { - } - __forceinline avxi(PosInfTy) - : m256(_mm256_set_epi32( - pos_inf, pos_inf, pos_inf, pos_inf, pos_inf, pos_inf, pos_inf, pos_inf)) - { - } - __forceinline avxi(NegInfTy) - : m256(_mm256_set_epi32( - neg_inf, neg_inf, neg_inf, neg_inf, neg_inf, neg_inf, neg_inf, neg_inf)) - { - } -#endif - __forceinline avxi(StepTy) : m256(_mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0)) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Array Access - //////////////////////////////////////////////////////////////////////////////// - - __forceinline const int32_t &operator[](const size_t i) const - { - assert(i < 8); - return v[i]; - } - __forceinline int32_t &operator[](const size_t i) - { - assert(i < 8); - return v[i]; - } -}; - -//////////////////////////////////////////////////////////////////////////////// -/// Unary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxi cast(const __m256 &a) -{ - return _mm256_castps_si256(a); -} -__forceinline const avxi operator+(const avxi &a) -{ - return a; -} -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator-(const avxi &a) -{ - return _mm256_sub_epi32(_mm256_setzero_si256(), a.m256); -} -__forceinline const avxi abs(const avxi &a) -{ - return _mm256_abs_epi32(a.m256); -} -#else -__forceinline const avxi operator-(const avxi &a) -{ - return avxi(_mm_sub_epi32(_mm_setzero_si128(), a.l), _mm_sub_epi32(_mm_setzero_si128(), a.h)); -} -__forceinline const avxi abs(const avxi &a) -{ - return avxi(_mm_abs_epi32(a.l), _mm_abs_epi32(a.h)); -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -/// Binary Operators -//////////////////////////////////////////////////////////////////////////////// - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator+(const avxi &a, const avxi &b) -{ - return _mm256_add_epi32(a.m256, b.m256); -} -#else -__forceinline const avxi operator+(const avxi &a, const avxi &b) -{ - return avxi(_mm_add_epi32(a.l, b.l), _mm_add_epi32(a.h, b.h)); -} -#endif -__forceinline const avxi operator+(const avxi &a, const int32_t b) -{ - return a + avxi(b); -} -__forceinline const avxi operator+(const int32_t a, const avxi &b) -{ - return avxi(a) + b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator-(const avxi &a, const avxi &b) -{ - return _mm256_sub_epi32(a.m256, b.m256); -} -#else -__forceinline const avxi operator-(const avxi &a, const avxi &b) -{ - return avxi(_mm_sub_epi32(a.l, b.l), _mm_sub_epi32(a.h, b.h)); -} -#endif -__forceinline const avxi operator-(const avxi &a, const int32_t b) -{ - return a - avxi(b); -} -__forceinline const avxi operator-(const int32_t a, const avxi &b) -{ - return avxi(a) - b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator*(const avxi &a, const avxi &b) -{ - return _mm256_mullo_epi32(a.m256, b.m256); -} -#else -__forceinline const avxi operator*(const avxi &a, const avxi &b) -{ - return avxi(_mm_mullo_epi32(a.l, b.l), _mm_mullo_epi32(a.h, b.h)); -} -#endif -__forceinline const avxi operator*(const avxi &a, const int32_t b) -{ - return a * avxi(b); -} -__forceinline const avxi operator*(const int32_t a, const avxi &b) -{ - return avxi(a) * b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator&(const avxi &a, const avxi &b) -{ - return _mm256_and_si256(a.m256, b.m256); -} -#else -__forceinline const avxi operator&(const avxi &a, const avxi &b) -{ - return _mm256_castps_si256(_mm256_and_ps(_mm256_castsi256_ps(a), _mm256_castsi256_ps(b))); -} -#endif -__forceinline const avxi operator&(const avxi &a, const int32_t b) -{ - return a & avxi(b); -} -__forceinline const avxi operator&(const int32_t a, const avxi &b) -{ - return avxi(a) & b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator|(const avxi &a, const avxi &b) -{ - return _mm256_or_si256(a.m256, b.m256); -} -#else -__forceinline const avxi operator|(const avxi &a, const avxi &b) -{ - return _mm256_castps_si256(_mm256_or_ps(_mm256_castsi256_ps(a), _mm256_castsi256_ps(b))); -} -#endif -__forceinline const avxi operator|(const avxi &a, const int32_t b) -{ - return a | avxi(b); -} -__forceinline const avxi operator|(const int32_t a, const avxi &b) -{ - return avxi(a) | b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator^(const avxi &a, const avxi &b) -{ - return _mm256_xor_si256(a.m256, b.m256); -} -#else -__forceinline const avxi operator^(const avxi &a, const avxi &b) -{ - return _mm256_castps_si256(_mm256_xor_ps(_mm256_castsi256_ps(a), _mm256_castsi256_ps(b))); -} -#endif -__forceinline const avxi operator^(const avxi &a, const int32_t b) -{ - return a ^ avxi(b); -} -__forceinline const avxi operator^(const int32_t a, const avxi &b) -{ - return avxi(a) ^ b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi operator<<(const avxi &a, const int32_t n) -{ - return _mm256_slli_epi32(a.m256, n); -} -__forceinline const avxi operator>>(const avxi &a, const int32_t n) -{ - return _mm256_srai_epi32(a.m256, n); -} - -__forceinline const avxi sra(const avxi &a, const int32_t b) -{ - return _mm256_srai_epi32(a.m256, b); -} -__forceinline const avxi srl(const avxi &a, const int32_t b) -{ - return _mm256_srli_epi32(a.m256, b); -} -#else -__forceinline const avxi operator<<(const avxi &a, const int32_t n) -{ - return avxi(_mm_slli_epi32(a.l, n), _mm_slli_epi32(a.h, n)); -} -__forceinline const avxi operator>>(const avxi &a, const int32_t n) -{ - return avxi(_mm_srai_epi32(a.l, n), _mm_srai_epi32(a.h, n)); -} - -__forceinline const avxi sra(const avxi &a, const int32_t b) -{ - return avxi(_mm_srai_epi32(a.l, b), _mm_srai_epi32(a.h, b)); -} -__forceinline const avxi srl(const avxi &a, const int32_t b) -{ - return avxi(_mm_srli_epi32(a.l, b), _mm_srli_epi32(a.h, b)); -} -#endif - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi min(const avxi &a, const avxi &b) -{ - return _mm256_min_epi32(a.m256, b.m256); -} -#else -__forceinline const avxi min(const avxi &a, const avxi &b) -{ - return avxi(_mm_min_epi32(a.l, b.l), _mm_min_epi32(a.h, b.h)); -} -#endif -__forceinline const avxi min(const avxi &a, const int32_t b) -{ - return min(a, avxi(b)); -} -__forceinline const avxi min(const int32_t a, const avxi &b) -{ - return min(avxi(a), b); -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxi max(const avxi &a, const avxi &b) -{ - return _mm256_max_epi32(a.m256, b.m256); -} -#else -__forceinline const avxi max(const avxi &a, const avxi &b) -{ - return avxi(_mm_max_epi32(a.l, b.l), _mm_max_epi32(a.h, b.h)); -} -#endif -__forceinline const avxi max(const avxi &a, const int32_t b) -{ - return max(a, avxi(b)); -} -__forceinline const avxi max(const int32_t a, const avxi &b) -{ - return max(avxi(a), b); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Assignment Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline avxi &operator+=(avxi &a, const avxi &b) -{ - return a = a + b; -} -__forceinline avxi &operator+=(avxi &a, const int32_t b) -{ - return a = a + b; -} - -__forceinline avxi &operator-=(avxi &a, const avxi &b) -{ - return a = a - b; -} -__forceinline avxi &operator-=(avxi &a, const int32_t b) -{ - return a = a - b; -} - -__forceinline avxi &operator*=(avxi &a, const avxi &b) -{ - return a = a * b; -} -__forceinline avxi &operator*=(avxi &a, const int32_t b) -{ - return a = a * b; -} - -__forceinline avxi &operator&=(avxi &a, const avxi &b) -{ - return a = a & b; -} -__forceinline avxi &operator&=(avxi &a, const int32_t b) -{ - return a = a & b; -} - -__forceinline avxi &operator|=(avxi &a, const avxi &b) -{ - return a = a | b; -} -__forceinline avxi &operator|=(avxi &a, const int32_t b) -{ - return a = a | b; -} - -__forceinline avxi &operator^=(avxi &a, const avxi &b) -{ - return a = a ^ b; -} -__forceinline avxi &operator^=(avxi &a, const int32_t b) -{ - return a = a ^ b; -} - -__forceinline avxi &operator<<=(avxi &a, const int32_t b) -{ - return a = a << b; -} -__forceinline avxi &operator>>=(avxi &a, const int32_t b) -{ - return a = a >> b; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Comparison Operators + Select -//////////////////////////////////////////////////////////////////////////////// - -#if defined(__KERNEL_AVX2__) -__forceinline const avxb operator==(const avxi &a, const avxi &b) -{ - return _mm256_castsi256_ps(_mm256_cmpeq_epi32(a.m256, b.m256)); -} -#else -__forceinline const avxb operator==(const avxi &a, const avxi &b) -{ - return avxb(_mm_castsi128_ps(_mm_cmpeq_epi32(a.l, b.l)), - _mm_castsi128_ps(_mm_cmpeq_epi32(a.h, b.h))); -} -#endif -__forceinline const avxb operator==(const avxi &a, const int32_t b) -{ - return a == avxi(b); -} -__forceinline const avxb operator==(const int32_t a, const avxi &b) -{ - return avxi(a) == b; -} - -__forceinline const avxb operator!=(const avxi &a, const avxi &b) -{ - return !(a == b); -} -__forceinline const avxb operator!=(const avxi &a, const int32_t b) -{ - return a != avxi(b); -} -__forceinline const avxb operator!=(const int32_t a, const avxi &b) -{ - return avxi(a) != b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxb operator<(const avxi &a, const avxi &b) -{ - return _mm256_castsi256_ps(_mm256_cmpgt_epi32(b.m256, a.m256)); -} -#else -__forceinline const avxb operator<(const avxi &a, const avxi &b) -{ - return avxb(_mm_castsi128_ps(_mm_cmplt_epi32(a.l, b.l)), - _mm_castsi128_ps(_mm_cmplt_epi32(a.h, b.h))); -} -#endif -__forceinline const avxb operator<(const avxi &a, const int32_t b) -{ - return a < avxi(b); -} -__forceinline const avxb operator<(const int32_t a, const avxi &b) -{ - return avxi(a) < b; -} - -__forceinline const avxb operator>=(const avxi &a, const avxi &b) -{ - return !(a < b); -} -__forceinline const avxb operator>=(const avxi &a, const int32_t b) -{ - return a >= avxi(b); -} -__forceinline const avxb operator>=(const int32_t a, const avxi &b) -{ - return avxi(a) >= b; -} - -#if defined(__KERNEL_AVX2__) -__forceinline const avxb operator>(const avxi &a, const avxi &b) -{ - return _mm256_castsi256_ps(_mm256_cmpgt_epi32(a.m256, b.m256)); -} -#else -__forceinline const avxb operator>(const avxi &a, const avxi &b) -{ - return avxb(_mm_castsi128_ps(_mm_cmpgt_epi32(a.l, b.l)), - _mm_castsi128_ps(_mm_cmpgt_epi32(a.h, b.h))); -} -#endif -__forceinline const avxb operator>(const avxi &a, const int32_t b) -{ - return a > avxi(b); -} -__forceinline const avxb operator>(const int32_t a, const avxi &b) -{ - return avxi(a) > b; -} - -__forceinline const avxb operator<=(const avxi &a, const avxi &b) -{ - return !(a > b); -} -__forceinline const avxb operator<=(const avxi &a, const int32_t b) -{ - return a <= avxi(b); -} -__forceinline const avxb operator<=(const int32_t a, const avxi &b) -{ - return avxi(a) <= b; -} - -__forceinline const avxi select(const avxb &m, const avxi &t, const avxi &f) -{ - return _mm256_castps_si256(_mm256_blendv_ps(_mm256_castsi256_ps(f), _mm256_castsi256_ps(t), m)); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Movement/Shifting/Shuffling Functions -//////////////////////////////////////////////////////////////////////////////// - -#if defined(__KERNEL_AVX2__) -__forceinline avxi unpacklo(const avxi &a, const avxi &b) -{ - return _mm256_unpacklo_epi32(a.m256, b.m256); -} -__forceinline avxi unpackhi(const avxi &a, const avxi &b) -{ - return _mm256_unpackhi_epi32(a.m256, b.m256); -} -#else -__forceinline avxi unpacklo(const avxi &a, const avxi &b) -{ - return _mm256_castps_si256(_mm256_unpacklo_ps(_mm256_castsi256_ps(a), _mm256_castsi256_ps(b))); -} -__forceinline avxi unpackhi(const avxi &a, const avxi &b) -{ - return _mm256_castps_si256(_mm256_unpackhi_ps(_mm256_castsi256_ps(a), _mm256_castsi256_ps(b))); -} -#endif - -template<size_t i> __forceinline const avxi shuffle(const avxi &a) -{ - return _mm256_castps_si256(_mm256_permute_ps(_mm256_castsi256_ps(a), _MM_SHUFFLE(i, i, i, i))); -} - -template<size_t i0, size_t i1> __forceinline const avxi shuffle(const avxi &a) -{ - return _mm256_permute2f128_si256(a, a, (i1 << 4) | (i0 << 0)); -} - -template<size_t i0, size_t i1> __forceinline const avxi shuffle(const avxi &a, const avxi &b) -{ - return _mm256_permute2f128_si256(a, b, (i1 << 4) | (i0 << 0)); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const avxi shuffle(const avxi &a) -{ - return _mm256_castps_si256( - _mm256_permute_ps(_mm256_castsi256_ps(a), _MM_SHUFFLE(i3, i2, i1, i0))); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const avxi shuffle(const avxi &a, const avxi &b) -{ - return _mm256_castps_si256(_mm256_shuffle_ps( - _mm256_castsi256_ps(a), _mm256_castsi256_ps(b), _MM_SHUFFLE(i3, i2, i1, i0))); -} - -template<> __forceinline const avxi shuffle<0, 0, 2, 2>(const avxi &b) -{ - return _mm256_castps_si256(_mm256_moveldup_ps(_mm256_castsi256_ps(b))); -} -template<> __forceinline const avxi shuffle<1, 1, 3, 3>(const avxi &b) -{ - return _mm256_castps_si256(_mm256_movehdup_ps(_mm256_castsi256_ps(b))); -} -template<> __forceinline const avxi shuffle<0, 1, 0, 1>(const avxi &b) -{ - return _mm256_castps_si256( - _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(_mm256_castsi256_ps(b))))); -} - -__forceinline const avxi broadcast(const int *ptr) -{ - return _mm256_castps_si256(_mm256_broadcast_ss((const float *)ptr)); -} -template<size_t i> __forceinline const avxi insert(const avxi &a, const ssei &b) -{ - return _mm256_insertf128_si256(a, b, i); -} -template<size_t i> __forceinline const ssei extract(const avxi &a) -{ - return _mm256_extractf128_si256(a, i); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Reductions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const avxi vreduce_min2(const avxi &v) -{ - return min(v, shuffle<1, 0, 3, 2>(v)); -} -__forceinline const avxi vreduce_min4(const avxi &v) -{ - avxi v1 = vreduce_min2(v); - return min(v1, shuffle<2, 3, 0, 1>(v1)); -} -__forceinline const avxi vreduce_min(const avxi &v) -{ - avxi v1 = vreduce_min4(v); - return min(v1, shuffle<1, 0>(v1)); -} - -__forceinline const avxi vreduce_max2(const avxi &v) -{ - return max(v, shuffle<1, 0, 3, 2>(v)); -} -__forceinline const avxi vreduce_max4(const avxi &v) -{ - avxi v1 = vreduce_max2(v); - return max(v1, shuffle<2, 3, 0, 1>(v1)); -} -__forceinline const avxi vreduce_max(const avxi &v) -{ - avxi v1 = vreduce_max4(v); - return max(v1, shuffle<1, 0>(v1)); -} - -__forceinline const avxi vreduce_add2(const avxi &v) -{ - return v + shuffle<1, 0, 3, 2>(v); -} -__forceinline const avxi vreduce_add4(const avxi &v) -{ - avxi v1 = vreduce_add2(v); - return v1 + shuffle<2, 3, 0, 1>(v1); -} -__forceinline const avxi vreduce_add(const avxi &v) -{ - avxi v1 = vreduce_add4(v); - return v1 + shuffle<1, 0>(v1); -} - -__forceinline int reduce_min(const avxi &v) -{ - return extract<0>(extract<0>(vreduce_min(v))); -} -__forceinline int reduce_max(const avxi &v) -{ - return extract<0>(extract<0>(vreduce_max(v))); -} -__forceinline int reduce_add(const avxi &v) -{ - return extract<0>(extract<0>(vreduce_add(v))); -} - -__forceinline uint32_t select_min(const avxi &v) -{ - return __bsf(movemask(v == vreduce_min(v))); -} -__forceinline uint32_t select_max(const avxi &v) -{ - return __bsf(movemask(v == vreduce_max(v))); -} - -__forceinline uint32_t select_min(const avxb &valid, const avxi &v) -{ - const avxi a = select(valid, v, avxi(pos_inf)); - return __bsf(movemask(valid & (a == vreduce_min(a)))); -} -__forceinline uint32_t select_max(const avxb &valid, const avxi &v) -{ - const avxi a = select(valid, v, avxi(neg_inf)); - return __bsf(movemask(valid & (a == vreduce_max(a)))); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Output Operators -//////////////////////////////////////////////////////////////////////////////// - -ccl_device_inline void print_avxi(const char *label, const avxi &a) -{ - printf("%s: %d %d %d %d %d %d %d %d\n", label, a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]); -} - -CCL_NAMESPACE_END - -#endif diff --git a/intern/cycles/util/color.h b/intern/cycles/util/color.h index 537f8ab6771..93e984120f2 100644 --- a/intern/cycles/util/color.h +++ b/intern/cycles/util/color.h @@ -228,28 +228,27 @@ ccl_device float3 xyY_to_xyz(float x, float y, float Y) * exp = exponent, encoded as uint32_t * e2coeff = 2^(127/exponent - 127) * bias_coeff^(1/exponent), encoded as uint32_t */ -template<unsigned exp, unsigned e2coeff> ccl_device_inline ssef fastpow(const ssef &arg) +template<unsigned exp, unsigned e2coeff> ccl_device_inline float4 fastpow(const float4 &arg) { - ssef ret; - ret = arg * cast(ssei(e2coeff)); - ret = ssef(cast(ret)); - ret = ret * cast(ssei(exp)); - ret = cast(ssei(ret)); + float4 ret = arg * cast(make_int4(e2coeff)); + ret = make_float4(cast(ret)); + ret = ret * cast(make_int4(exp)); + ret = cast(make_int4(ret)); return ret; } /* Improve x ^ 1.0f/5.0f solution with Newton-Raphson method */ -ccl_device_inline ssef improve_5throot_solution(const ssef &old_result, const ssef &x) +ccl_device_inline float4 improve_5throot_solution(const float4 &old_result, const float4 &x) { - ssef approx2 = old_result * old_result; - ssef approx4 = approx2 * approx2; - ssef t = x / approx4; - ssef summ = madd(ssef(4.0f), old_result, t); - return summ * ssef(1.0f / 5.0f); + float4 approx2 = old_result * old_result; + float4 approx4 = approx2 * approx2; + float4 t = x / approx4; + float4 summ = madd(make_float4(4.0f), old_result, t); + return summ * make_float4(1.0f / 5.0f); } /* Calculate powf(x, 2.4). Working domain: 1e-10 < x < 1e+10 */ -ccl_device_inline ssef fastpow24(const ssef &arg) +ccl_device_inline float4 fastpow24(const float4 &arg) { /* max, avg and |avg| errors were calculated in gcc without FMA instructions * The final precision should be better than powf in glibc */ @@ -257,9 +256,10 @@ ccl_device_inline ssef fastpow24(const ssef &arg) /* Calculate x^4/5, coefficient 0.994 was constructed manually to minimize avg error */ /* 0x3F4CCCCD = 4/5 */ /* 0x4F55A7FB = 2^(127/(4/5) - 127) * 0.994^(1/(4/5)) */ - ssef x = fastpow<0x3F4CCCCD, 0x4F55A7FB>(arg); // error max = 0.17 avg = 0.0018 |avg| = 0.05 - ssef arg2 = arg * arg; - ssef arg4 = arg2 * arg2; + float4 x = fastpow<0x3F4CCCCD, 0x4F55A7FB>( + arg); // error max = 0.17 avg = 0.0018 |avg| = 0.05 + float4 arg2 = arg * arg; + float4 arg4 = arg2 * arg2; /* error max = 0.018 avg = 0.0031 |avg| = 0.0031 */ x = improve_5throot_solution(x, arg4); @@ -271,12 +271,12 @@ ccl_device_inline ssef fastpow24(const ssef &arg) return x * (x * x); } -ccl_device ssef color_srgb_to_linear(const ssef &c) +ccl_device float4 color_srgb_to_linear(const float4 &c) { - sseb cmp = c < ssef(0.04045f); - ssef lt = max(c * ssef(1.0f / 12.92f), ssef(0.0f)); - ssef gtebase = (c + ssef(0.055f)) * ssef(1.0f / 1.055f); /* fma */ - ssef gte = fastpow24(gtebase); + int4 cmp = c < make_float4(0.04045f); + float4 lt = max(c * make_float4(1.0f / 12.92f), make_float4(0.0f)); + float4 gtebase = (c + make_float4(0.055f)) * make_float4(1.0f / 1.055f); /* fma */ + float4 gte = fastpow24(gtebase); return select(cmp, lt, gte); } #endif /* __KERNEL_SSE2__ */ @@ -302,10 +302,8 @@ ccl_device float4 color_linear_to_srgb_v4(float4 c) ccl_device float4 color_srgb_to_linear_v4(float4 c) { #ifdef __KERNEL_SSE2__ - ssef r_ssef; - float4 &r = (float4 &)r_ssef; - r = c; - r_ssef = color_srgb_to_linear(r_ssef); + float4 r = c; + r = color_srgb_to_linear(r); r.w = c.w; return r; #else diff --git a/intern/cycles/util/half.h b/intern/cycles/util/half.h index c668638eb02..5665dd4c075 100644 --- a/intern/cycles/util/half.h +++ b/intern/cycles/util/half.h @@ -154,17 +154,17 @@ ccl_device_inline half float_to_half_display(const float f) ccl_device_inline half4 float4_to_half4_display(const float4 f) { -#ifdef __KERNEL_SSE2__ +#ifdef __KERNEL_SSE__ /* CPU: SSE and AVX. */ - ssef x = min(max(load4f(f), 0.0f), 65504.0f); + float4 x = min(max(f, make_float4(0.0f)), make_float4(65504.0f)); # ifdef __KERNEL_AVX2__ - ssei rpack = _mm_cvtps_ph(x, 0); + int4 rpack = int4(_mm_cvtps_ph(x, 0)); # else - ssei absolute = cast(x) & 0x7FFFFFFF; - ssei Z = absolute + 0xC8000000; - ssei result = andnot(absolute < 0x38800000, Z); - ssei rshift = (result >> 13) & 0x7FFF; - ssei rpack = _mm_packs_epi32(rshift, rshift); + int4 absolute = cast(x) & make_int4(0x7FFFFFFF); + int4 Z = absolute + make_int4(0xC8000000); + int4 result = andnot(absolute < make_int4(0x38800000), Z); + int4 rshift = (result >> 13) & make_int4(0x7FFF); + int4 rpack = int4(_mm_packs_epi32(rshift, rshift)); # endif half4 h; _mm_storel_pi((__m64 *)&h, _mm_castsi128_ps(rpack)); diff --git a/intern/cycles/util/hash.h b/intern/cycles/util/hash.h index 4f83f331229..74210ff020e 100644 --- a/intern/cycles/util/hash.h +++ b/intern/cycles/util/hash.h @@ -222,7 +222,7 @@ ccl_device_inline float3 hash_float4_to_float3(float4 k) /* SSE Versions Of Jenkins Lookup3 Hash Functions */ -#ifdef __KERNEL_SSE2__ +#ifdef __KERNEL_SSE__ # define rot(x, k) (((x) << (k)) | (srl(x, 32 - (k)))) # define mix(a, b, c) \ @@ -265,10 +265,10 @@ ccl_device_inline float3 hash_float4_to_float3(float4 k) c -= rot(b, 24); \ } -ccl_device_inline ssei hash_ssei(ssei kx) +ccl_device_inline int4 hash_int4(int4 kx) { - ssei a, b, c; - a = b = c = ssei(0xdeadbeef + (1 << 2) + 13); + int4 a, b, c; + a = b = c = make_int4(0xdeadbeef + (1 << 2) + 13); a += kx; final(a, b, c); @@ -276,10 +276,10 @@ ccl_device_inline ssei hash_ssei(ssei kx) return c; } -ccl_device_inline ssei hash_ssei2(ssei kx, ssei ky) +ccl_device_inline int4 hash_int4_2(int4 kx, int4 ky) { - ssei a, b, c; - a = b = c = ssei(0xdeadbeef + (2 << 2) + 13); + int4 a, b, c; + a = b = c = make_int4(0xdeadbeef + (2 << 2) + 13); b += ky; a += kx; @@ -288,10 +288,10 @@ ccl_device_inline ssei hash_ssei2(ssei kx, ssei ky) return c; } -ccl_device_inline ssei hash_ssei3(ssei kx, ssei ky, ssei kz) +ccl_device_inline int4 hash_int4_3(int4 kx, int4 ky, int4 kz) { - ssei a, b, c; - a = b = c = ssei(0xdeadbeef + (3 << 2) + 13); + int4 a, b, c; + a = b = c = make_int4(0xdeadbeef + (3 << 2) + 13); c += kz; b += ky; @@ -301,10 +301,10 @@ ccl_device_inline ssei hash_ssei3(ssei kx, ssei ky, ssei kz) return c; } -ccl_device_inline ssei hash_ssei4(ssei kx, ssei ky, ssei kz, ssei kw) +ccl_device_inline int4 hash_int4_4(int4 kx, int4 ky, int4 kz, int4 kw) { - ssei a, b, c; - a = b = c = ssei(0xdeadbeef + (4 << 2) + 13); + int4 a, b, c; + a = b = c = make_int4(0xdeadbeef + (4 << 2) + 13); a += kx; b += ky; @@ -317,11 +317,11 @@ ccl_device_inline ssei hash_ssei4(ssei kx, ssei ky, ssei kz, ssei kw) return c; } -# if defined(__KERNEL_AVX__) -ccl_device_inline avxi hash_avxi(avxi kx) +# if defined(__KERNEL_AVX2__) +ccl_device_inline vint8 hash_int8(vint8 kx) { - avxi a, b, c; - a = b = c = avxi(0xdeadbeef + (1 << 2) + 13); + vint8 a, b, c; + a = b = c = make_vint8(0xdeadbeef + (1 << 2) + 13); a += kx; final(a, b, c); @@ -329,10 +329,10 @@ ccl_device_inline avxi hash_avxi(avxi kx) return c; } -ccl_device_inline avxi hash_avxi2(avxi kx, avxi ky) +ccl_device_inline vint8 hash_int8_2(vint8 kx, vint8 ky) { - avxi a, b, c; - a = b = c = avxi(0xdeadbeef + (2 << 2) + 13); + vint8 a, b, c; + a = b = c = make_vint8(0xdeadbeef + (2 << 2) + 13); b += ky; a += kx; @@ -341,10 +341,10 @@ ccl_device_inline avxi hash_avxi2(avxi kx, avxi ky) return c; } -ccl_device_inline avxi hash_avxi3(avxi kx, avxi ky, avxi kz) +ccl_device_inline vint8 hash_int8_3(vint8 kx, vint8 ky, vint8 kz) { - avxi a, b, c; - a = b = c = avxi(0xdeadbeef + (3 << 2) + 13); + vint8 a, b, c; + a = b = c = make_vint8(0xdeadbeef + (3 << 2) + 13); c += kz; b += ky; @@ -354,10 +354,10 @@ ccl_device_inline avxi hash_avxi3(avxi kx, avxi ky, avxi kz) return c; } -ccl_device_inline avxi hash_avxi4(avxi kx, avxi ky, avxi kz, avxi kw) +ccl_device_inline vint8 hash_int8_4(vint8 kx, vint8 ky, vint8 kz, vint8 kw) { - avxi a, b, c; - a = b = c = avxi(0xdeadbeef + (4 << 2) + 13); + vint8 a, b, c; + a = b = c = make_vint8(0xdeadbeef + (4 << 2) + 13); a += kx; b += ky; diff --git a/intern/cycles/util/math.h b/intern/cycles/util/math.h index 3a2e0e074a2..0fbe7a67a4f 100644 --- a/intern/cycles/util/math.h +++ b/intern/cycles/util/math.h @@ -532,12 +532,14 @@ CCL_NAMESPACE_END #include "util/math_int2.h" #include "util/math_int3.h" #include "util/math_int4.h" +#include "util/math_int8.h" #include "util/math_float2.h" -#include "util/math_float3.h" #include "util/math_float4.h" #include "util/math_float8.h" +#include "util/math_float3.h" + #include "util/rect.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/math_float2.h b/intern/cycles/util/math_float2.h index 542dad93467..ad806d0f08a 100644 --- a/intern/cycles/util/math_float2.h +++ b/intern/cycles/util/math_float2.h @@ -10,55 +10,6 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - -#if !defined(__KERNEL_METAL__) -ccl_device_inline float2 operator-(const float2 &a); -ccl_device_inline float2 operator*(const float2 &a, const float2 &b); -ccl_device_inline float2 operator*(const float2 &a, float f); -ccl_device_inline float2 operator*(float f, const float2 &a); -ccl_device_inline float2 operator/(float f, const float2 &a); -ccl_device_inline float2 operator/(const float2 &a, float f); -ccl_device_inline float2 operator/(const float2 &a, const float2 &b); -ccl_device_inline float2 operator+(const float2 &a, const float f); -ccl_device_inline float2 operator+(const float2 &a, const float2 &b); -ccl_device_inline float2 operator-(const float2 &a, const float f); -ccl_device_inline float2 operator-(const float2 &a, const float2 &b); -ccl_device_inline float2 operator+=(float2 &a, const float2 &b); -ccl_device_inline float2 operator*=(float2 &a, const float2 &b); -ccl_device_inline float2 operator*=(float2 &a, float f); -ccl_device_inline float2 operator/=(float2 &a, const float2 &b); -ccl_device_inline float2 operator/=(float2 &a, float f); - -ccl_device_inline bool operator==(const float2 &a, const float2 &b); -ccl_device_inline bool operator!=(const float2 &a, const float2 &b); - -ccl_device_inline bool is_zero(const float2 &a); -ccl_device_inline float average(const float2 &a); -ccl_device_inline float distance(const float2 &a, const float2 &b); -ccl_device_inline float dot(const float2 &a, const float2 &b); -ccl_device_inline float cross(const float2 &a, const float2 &b); -ccl_device_inline float len(const float2 a); -ccl_device_inline float2 normalize(const float2 &a); -ccl_device_inline float2 normalize_len(const float2 &a, float *t); -ccl_device_inline float2 safe_normalize(const float2 &a); -ccl_device_inline float2 min(const float2 &a, const float2 &b); -ccl_device_inline float2 max(const float2 &a, const float2 &b); -ccl_device_inline float2 clamp(const float2 &a, const float2 &mn, const float2 &mx); -ccl_device_inline float2 fabs(const float2 &a); -ccl_device_inline float2 as_float2(const float4 &a); -ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t); -ccl_device_inline float2 floor(const float2 &a); -#endif /* !__KERNEL_METAL__ */ - -ccl_device_inline float2 safe_divide_float2_float(const float2 a, const float b); - -/******************************************************************************* - * Definition. - */ - ccl_device_inline float2 zero_float2() { return make_float2(0.0f, 0.0f); @@ -75,63 +26,63 @@ ccl_device_inline float2 operator-(const float2 &a) return make_float2(-a.x, -a.y); } -ccl_device_inline float2 operator*(const float2 &a, const float2 &b) +ccl_device_inline float2 operator*(const float2 a, const float2 b) { return make_float2(a.x * b.x, a.y * b.y); } -ccl_device_inline float2 operator*(const float2 &a, float f) +ccl_device_inline float2 operator*(const float2 a, float f) { return make_float2(a.x * f, a.y * f); } -ccl_device_inline float2 operator*(float f, const float2 &a) +ccl_device_inline float2 operator*(float f, const float2 a) { return make_float2(a.x * f, a.y * f); } -ccl_device_inline float2 operator/(float f, const float2 &a) +ccl_device_inline float2 operator/(float f, const float2 a) { return make_float2(f / a.x, f / a.y); } -ccl_device_inline float2 operator/(const float2 &a, float f) +ccl_device_inline float2 operator/(const float2 a, float f) { float invf = 1.0f / f; return make_float2(a.x * invf, a.y * invf); } -ccl_device_inline float2 operator/(const float2 &a, const float2 &b) +ccl_device_inline float2 operator/(const float2 a, const float2 b) { return make_float2(a.x / b.x, a.y / b.y); } -ccl_device_inline float2 operator+(const float2 &a, const float f) +ccl_device_inline float2 operator+(const float2 a, const float2 b) { - return a + make_float2(f, f); + return make_float2(a.x + b.x, a.y + b.y); } -ccl_device_inline float2 operator+(const float2 &a, const float2 &b) +ccl_device_inline float2 operator+(const float2 a, const float f) { - return make_float2(a.x + b.x, a.y + b.y); + return a + make_float2(f, f); } -ccl_device_inline float2 operator-(const float2 &a, const float f) +ccl_device_inline float2 operator-(const float2 a, const float2 b) { - return a - make_float2(f, f); + return make_float2(a.x - b.x, a.y - b.y); } -ccl_device_inline float2 operator-(const float2 &a, const float2 &b) +ccl_device_inline float2 operator-(const float2 a, const float f) { - return make_float2(a.x - b.x, a.y - b.y); + return a - make_float2(f, f); } -ccl_device_inline float2 operator+=(float2 &a, const float2 &b) +ccl_device_inline float2 operator+=(float2 &a, const float2 b) { return a = a + b; } -ccl_device_inline float2 operator*=(float2 &a, const float2 &b) +ccl_device_inline float2 operator*=(float2 &a, const float2 b) { return a = a * b; } @@ -141,7 +92,7 @@ ccl_device_inline float2 operator*=(float2 &a, float f) return a = a * f; } -ccl_device_inline float2 operator/=(float2 &a, const float2 &b) +ccl_device_inline float2 operator/=(float2 &a, const float2 b) { return a = a / b; } @@ -152,74 +103,81 @@ ccl_device_inline float2 operator/=(float2 &a, float f) return a = a * invf; } -ccl_device_inline bool operator==(const float2 &a, const float2 &b) +ccl_device_inline bool operator==(const float2 a, const float2 b) { return (a.x == b.x && a.y == b.y); } -ccl_device_inline bool operator!=(const float2 &a, const float2 &b) +ccl_device_inline bool operator!=(const float2 a, const float2 b) { return !(a == b); } -ccl_device_inline bool is_zero(const float2 &a) +ccl_device_inline bool is_zero(const float2 a) { return (a.x == 0.0f && a.y == 0.0f); } -ccl_device_inline float average(const float2 &a) +ccl_device_inline float average(const float2 a) { return (a.x + a.y) * (1.0f / 2.0f); } -ccl_device_inline float distance(const float2 &a, const float2 &b) +ccl_device_inline float dot(const float2 a, const float2 b) { - return len(a - b); + return a.x * b.x + a.y * b.y; } +#endif -ccl_device_inline float dot(const float2 &a, const float2 &b) +ccl_device_inline float len(const float2 a) { - return a.x * b.x + a.y * b.y; + return sqrtf(dot(a, a)); } -ccl_device_inline float cross(const float2 &a, const float2 &b) +#if !defined(__KERNEL_METAL__) +ccl_device_inline float distance(const float2 a, const float2 b) +{ + return len(a - b); +} + +ccl_device_inline float cross(const float2 a, const float2 b) { return (a.x * b.y - a.y * b.x); } -ccl_device_inline float2 normalize(const float2 &a) +ccl_device_inline float2 normalize(const float2 a) { return a / len(a); } -ccl_device_inline float2 normalize_len(const float2 &a, ccl_private float *t) +ccl_device_inline float2 normalize_len(const float2 a, ccl_private float *t) { *t = len(a); return a / (*t); } -ccl_device_inline float2 safe_normalize(const float2 &a) +ccl_device_inline float2 safe_normalize(const float2 a) { float t = len(a); return (t != 0.0f) ? a / t : a; } -ccl_device_inline float2 min(const float2 &a, const float2 &b) +ccl_device_inline float2 min(const float2 a, const float2 b) { return make_float2(min(a.x, b.x), min(a.y, b.y)); } -ccl_device_inline float2 max(const float2 &a, const float2 &b) +ccl_device_inline float2 max(const float2 a, const float2 b) { return make_float2(max(a.x, b.x), max(a.y, b.y)); } -ccl_device_inline float2 clamp(const float2 &a, const float2 &mn, const float2 &mx) +ccl_device_inline float2 clamp(const float2 a, const float2 mn, const float2 mx) { return min(max(a, mn), mx); } -ccl_device_inline float2 fabs(const float2 &a) +ccl_device_inline float2 fabs(const float2 a) { return make_float2(fabsf(a.x), fabsf(a.y)); } @@ -229,28 +187,23 @@ ccl_device_inline float2 as_float2(const float4 &a) return make_float2(a.x, a.y); } -ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t) +ccl_device_inline float2 interp(const float2 a, const float2 b, float t) { return a + t * (b - a); } -ccl_device_inline float2 mix(const float2 &a, const float2 &b, float t) +ccl_device_inline float2 mix(const float2 a, const float2 b, float t) { return a + t * (b - a); } -ccl_device_inline float2 floor(const float2 &a) +ccl_device_inline float2 floor(const float2 a) { return make_float2(floorf(a.x), floorf(a.y)); } #endif /* !__KERNEL_METAL__ */ -ccl_device_inline float len(const float2 a) -{ - return sqrtf(dot(a, a)); -} - ccl_device_inline float2 safe_divide_float2_float(const float2 a, const float b) { return (b != 0.0f) ? a / b : zero_float2(); diff --git a/intern/cycles/util/math_float3.h b/intern/cycles/util/math_float3.h index eec7122b9dc..79ee86d9c82 100644 --- a/intern/cycles/util/math_float3.h +++ b/intern/cycles/util/math_float3.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2013 Intel Corporation * Copyright 2011-2022 Blender Foundation */ #ifndef __UTIL_MATH_FLOAT3_H__ @@ -10,73 +11,6 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - -#if !defined(__KERNEL_METAL__) -ccl_device_inline float3 operator-(const float3 &a); -ccl_device_inline float3 operator*(const float3 &a, const float3 &b); -ccl_device_inline float3 operator*(const float3 &a, const float f); -ccl_device_inline float3 operator*(const float f, const float3 &a); -ccl_device_inline float3 operator/(const float f, const float3 &a); -ccl_device_inline float3 operator/(const float3 &a, const float f); -ccl_device_inline float3 operator/(const float3 &a, const float3 &b); -ccl_device_inline float3 operator+(const float3 &a, const float f); -ccl_device_inline float3 operator+(const float3 &a, const float3 &b); -ccl_device_inline float3 operator-(const float3 &a, const float f); -ccl_device_inline float3 operator-(const float3 &a, const float3 &b); -ccl_device_inline float3 operator+=(float3 &a, const float3 &b); -ccl_device_inline float3 operator-=(float3 &a, const float3 &b); -ccl_device_inline float3 operator*=(float3 &a, const float3 &b); -ccl_device_inline float3 operator*=(float3 &a, float f); -ccl_device_inline float3 operator/=(float3 &a, const float3 &b); -ccl_device_inline float3 operator/=(float3 &a, float f); - -ccl_device_inline bool operator==(const float3 &a, const float3 &b); -ccl_device_inline bool operator!=(const float3 &a, const float3 &b); - -ccl_device_inline float distance(const float3 &a, const float3 &b); -ccl_device_inline float dot(const float3 &a, const float3 &b); -ccl_device_inline float dot_xy(const float3 &a, const float3 &b); -ccl_device_inline float3 cross(const float3 &a, const float3 &b); -ccl_device_inline float3 normalize(const float3 &a); -ccl_device_inline float3 min(const float3 &a, const float3 &b); -ccl_device_inline float3 max(const float3 &a, const float3 &b); -ccl_device_inline float3 clamp(const float3 &a, const float3 &mn, const float3 &mx); -ccl_device_inline float3 fabs(const float3 &a); -ccl_device_inline float3 mix(const float3 &a, const float3 &b, float t); -ccl_device_inline float3 rcp(const float3 &a); -ccl_device_inline float3 sqrt(const float3 &a); -ccl_device_inline float3 floor(const float3 &a); -ccl_device_inline float3 ceil(const float3 &a); -ccl_device_inline float3 reflect(const float3 incident, const float3 normal); -#endif /* !defined(__KERNEL_METAL__) */ - -ccl_device_inline float reduce_min(float3 a); -ccl_device_inline float reduce_max(float3 a); -ccl_device_inline float len(const float3 a); -ccl_device_inline float len_squared(const float3 a); - -ccl_device_inline float3 project(const float3 v, const float3 v_proj); - -ccl_device_inline float3 safe_normalize(const float3 a); -ccl_device_inline float3 normalize_len(const float3 a, ccl_private float *t); -ccl_device_inline float3 safe_normalize_len(const float3 a, ccl_private float *t); -ccl_device_inline float3 safe_divide(const float3 a, const float3 b); -ccl_device_inline float3 safe_divide(const float3 a, const float b); -ccl_device_inline float3 interp(float3 a, float3 b, float t); -ccl_device_inline float3 sqr(float3 a); - -ccl_device_inline bool is_zero(const float3 a); -ccl_device_inline float reduce_add(const float3 a); -ccl_device_inline float average(const float3 a); -ccl_device_inline bool isequal(const float3 a, const float3 b); - -/******************************************************************************* - * Definition. - */ - ccl_device_inline float3 zero_float3() { #ifdef __KERNEL_SSE__ @@ -109,7 +43,7 @@ ccl_device_inline float3 operator-(const float3 &a) # endif } -ccl_device_inline float3 operator*(const float3 &a, const float3 &b) +ccl_device_inline float3 operator*(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ return float3(_mm_mul_ps(a.m128, b.m128)); @@ -118,7 +52,7 @@ ccl_device_inline float3 operator*(const float3 &a, const float3 &b) # endif } -ccl_device_inline float3 operator*(const float3 &a, const float f) +ccl_device_inline float3 operator*(const float3 a, const float f) { # ifdef __KERNEL_SSE__ return float3(_mm_mul_ps(a.m128, _mm_set1_ps(f))); @@ -127,7 +61,7 @@ ccl_device_inline float3 operator*(const float3 &a, const float f) # endif } -ccl_device_inline float3 operator*(const float f, const float3 &a) +ccl_device_inline float3 operator*(const float f, const float3 a) { # if defined(__KERNEL_SSE__) return float3(_mm_mul_ps(_mm_set1_ps(f), a.m128)); @@ -136,7 +70,7 @@ ccl_device_inline float3 operator*(const float f, const float3 &a) # endif } -ccl_device_inline float3 operator/(const float f, const float3 &a) +ccl_device_inline float3 operator/(const float f, const float3 a) { # if defined(__KERNEL_SSE__) return float3(_mm_div_ps(_mm_set1_ps(f), a.m128)); @@ -145,7 +79,7 @@ ccl_device_inline float3 operator/(const float f, const float3 &a) # endif } -ccl_device_inline float3 operator/(const float3 &a, const float f) +ccl_device_inline float3 operator/(const float3 a, const float f) { # if defined(__KERNEL_SSE__) return float3(_mm_div_ps(a.m128, _mm_set1_ps(f))); @@ -154,7 +88,7 @@ ccl_device_inline float3 operator/(const float3 &a, const float f) # endif } -ccl_device_inline float3 operator/(const float3 &a, const float3 &b) +ccl_device_inline float3 operator/(const float3 a, const float3 b) { # if defined(__KERNEL_SSE__) return float3(_mm_div_ps(a.m128, b.m128)); @@ -163,12 +97,7 @@ ccl_device_inline float3 operator/(const float3 &a, const float3 &b) # endif } -ccl_device_inline float3 operator+(const float3 &a, const float f) -{ - return a + make_float3(f, f, f); -} - -ccl_device_inline float3 operator+(const float3 &a, const float3 &b) +ccl_device_inline float3 operator+(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ return float3(_mm_add_ps(a.m128, b.m128)); @@ -177,12 +106,12 @@ ccl_device_inline float3 operator+(const float3 &a, const float3 &b) # endif } -ccl_device_inline float3 operator-(const float3 &a, const float f) +ccl_device_inline float3 operator+(const float3 a, const float f) { - return a - make_float3(f, f, f); + return a + make_float3(f, f, f); } -ccl_device_inline float3 operator-(const float3 &a, const float3 &b) +ccl_device_inline float3 operator-(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ return float3(_mm_sub_ps(a.m128, b.m128)); @@ -191,17 +120,22 @@ ccl_device_inline float3 operator-(const float3 &a, const float3 &b) # endif } -ccl_device_inline float3 operator+=(float3 &a, const float3 &b) +ccl_device_inline float3 operator-(const float3 a, const float f) +{ + return a - make_float3(f, f, f); +} + +ccl_device_inline float3 operator+=(float3 &a, const float3 b) { return a = a + b; } -ccl_device_inline float3 operator-=(float3 &a, const float3 &b) +ccl_device_inline float3 operator-=(float3 &a, const float3 b) { return a = a - b; } -ccl_device_inline float3 operator*=(float3 &a, const float3 &b) +ccl_device_inline float3 operator*=(float3 &a, const float3 b) { return a = a * b; } @@ -211,7 +145,7 @@ ccl_device_inline float3 operator*=(float3 &a, float f) return a = a * f; } -ccl_device_inline float3 operator/=(float3 &a, const float3 &b) +ccl_device_inline float3 operator/=(float3 &a, const float3 b) { return a = a / b; } @@ -223,7 +157,7 @@ ccl_device_inline float3 operator/=(float3 &a, float f) } # if !(defined(__KERNEL_METAL__) || defined(__KERNEL_CUDA__)) -ccl_device_inline packed_float3 operator*=(packed_float3 &a, const float3 &b) +ccl_device_inline packed_float3 operator*=(packed_float3 &a, const float3 b) { a = float3(a) * b; return a; @@ -235,7 +169,7 @@ ccl_device_inline packed_float3 operator*=(packed_float3 &a, float f) return a; } -ccl_device_inline packed_float3 operator/=(packed_float3 &a, const float3 &b) +ccl_device_inline packed_float3 operator/=(packed_float3 &a, const float3 b) { a = float3(a) / b; return a; @@ -248,7 +182,7 @@ ccl_device_inline packed_float3 operator/=(packed_float3 &a, float f) } # endif -ccl_device_inline bool operator==(const float3 &a, const float3 &b) +ccl_device_inline bool operator==(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ return (_mm_movemask_ps(_mm_cmpeq_ps(a.m128, b.m128)) & 7) == 7; @@ -257,17 +191,12 @@ ccl_device_inline bool operator==(const float3 &a, const float3 &b) # endif } -ccl_device_inline bool operator!=(const float3 &a, const float3 &b) +ccl_device_inline bool operator!=(const float3 a, const float3 b) { return !(a == b); } -ccl_device_inline float distance(const float3 &a, const float3 &b) -{ - return len(a - b); -} - -ccl_device_inline float dot(const float3 &a, const float3 &b) +ccl_device_inline float dot(const float3 a, const float3 b) { # if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) return _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7F)); @@ -276,26 +205,62 @@ ccl_device_inline float dot(const float3 &a, const float3 &b) # endif } -ccl_device_inline float dot_xy(const float3 &a, const float3 &b) +#endif + +ccl_device_inline float dot_xy(const float3 a, const float3 b) { -# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) +#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) return _mm_cvtss_f32(_mm_hadd_ps(_mm_mul_ps(a, b), b)); -# else +#else return a.x * b.x + a.y * b.y; -# endif +#endif +} + +ccl_device_inline float len(const float3 a) +{ +#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) + return _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(a.m128, a.m128, 0x7F))); +#else + return sqrtf(dot(a, a)); +#endif +} + +ccl_device_inline float reduce_min(float3 a) +{ + return min(min(a.x, a.y), a.z); +} + +ccl_device_inline float reduce_max(float3 a) +{ + return max(max(a.x, a.y), a.z); +} + +ccl_device_inline float len_squared(const float3 a) +{ + return dot(a, a); +} + +#ifndef __KERNEL_METAL__ + +ccl_device_inline float distance(const float3 a, const float3 b) +{ + return len(a - b); } -ccl_device_inline float3 cross(const float3 &a, const float3 &b) +ccl_device_inline float3 cross(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ - return float3(shuffle<1, 2, 0, 3>( - msub(ssef(a), shuffle<1, 2, 0, 3>(ssef(b)), shuffle<1, 2, 0, 3>(ssef(a)) * ssef(b)))); + const float4 x = float4(a.m128); + const float4 y = shuffle<1, 2, 0, 3>(float4(b.m128)); + const float4 z = float4(_mm_mul_ps(shuffle<1, 2, 0, 3>(float4(a.m128)), float4(b.m128))); + + return float3(shuffle<1, 2, 0, 3>(msub(x, y, z)).m128); # else return make_float3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); # endif } -ccl_device_inline float3 normalize(const float3 &a) +ccl_device_inline float3 normalize(const float3 a) { # if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) __m128 norm = _mm_sqrt_ps(_mm_dp_ps(a.m128, a.m128, 0x7F)); @@ -305,7 +270,7 @@ ccl_device_inline float3 normalize(const float3 &a) # endif } -ccl_device_inline float3 min(const float3 &a, const float3 &b) +ccl_device_inline float3 min(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ return float3(_mm_min_ps(a.m128, b.m128)); @@ -314,7 +279,7 @@ ccl_device_inline float3 min(const float3 &a, const float3 &b) # endif } -ccl_device_inline float3 max(const float3 &a, const float3 &b) +ccl_device_inline float3 max(const float3 a, const float3 b) { # ifdef __KERNEL_SSE__ return float3(_mm_max_ps(a.m128, b.m128)); @@ -323,12 +288,12 @@ ccl_device_inline float3 max(const float3 &a, const float3 &b) # endif } -ccl_device_inline float3 clamp(const float3 &a, const float3 &mn, const float3 &mx) +ccl_device_inline float3 clamp(const float3 a, const float3 mn, const float3 mx) { return min(max(a, mn), mx); } -ccl_device_inline float3 fabs(const float3 &a) +ccl_device_inline float3 fabs(const float3 a) { # ifdef __KERNEL_SSE__ # ifdef __KERNEL_NEON__ @@ -342,7 +307,7 @@ ccl_device_inline float3 fabs(const float3 &a) # endif } -ccl_device_inline float3 sqrt(const float3 &a) +ccl_device_inline float3 sqrt(const float3 a) { # ifdef __KERNEL_SSE__ return float3(_mm_sqrt_ps(a)); @@ -351,7 +316,7 @@ ccl_device_inline float3 sqrt(const float3 &a) # endif } -ccl_device_inline float3 floor(const float3 &a) +ccl_device_inline float3 floor(const float3 a) { # ifdef __KERNEL_SSE__ return float3(_mm_floor_ps(a)); @@ -360,7 +325,7 @@ ccl_device_inline float3 floor(const float3 &a) # endif } -ccl_device_inline float3 ceil(const float3 &a) +ccl_device_inline float3 ceil(const float3 a) { # ifdef __KERNEL_SSE__ return float3(_mm_ceil_ps(a)); @@ -369,12 +334,12 @@ ccl_device_inline float3 ceil(const float3 &a) # endif } -ccl_device_inline float3 mix(const float3 &a, const float3 &b, float t) +ccl_device_inline float3 mix(const float3 a, const float3 b, float t) { return a + t * (b - a); } -ccl_device_inline float3 rcp(const float3 &a) +ccl_device_inline float3 rcp(const float3 a) { # ifdef __KERNEL_SSE__ /* Don't use _mm_rcp_ps due to poor precision. */ @@ -399,33 +364,6 @@ ccl_device_inline float3 log(float3 v) return make_float3(logf(v.x), logf(v.y), logf(v.z)); } -#endif /* !__KERNEL_METAL__ */ - -ccl_device_inline float reduce_min(float3 a) -{ - return min(min(a.x, a.y), a.z); -} - -ccl_device_inline float reduce_max(float3 a) -{ - return max(max(a.x, a.y), a.z); -} - -ccl_device_inline float len(const float3 a) -{ -#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) - return _mm_cvtss_f32(_mm_sqrt_ss(_mm_dp_ps(a.m128, a.m128, 0x7F))); -#else - return sqrtf(dot(a, a)); -#endif -} - -ccl_device_inline float len_squared(const float3 a) -{ - return dot(a, a); -} - -#if !defined(__KERNEL_METAL__) ccl_device_inline float3 reflect(const float3 incident, const float3 normal) { float3 unit_normal = normalize(normal); diff --git a/intern/cycles/util/math_float4.h b/intern/cycles/util/math_float4.h index c2721873037..301d2d789c0 100644 --- a/intern/cycles/util/math_float4.h +++ b/intern/cycles/util/math_float4.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2013 Intel Corporation * Copyright 2011-2022 Blender Foundation */ #ifndef __UTIL_MATH_FLOAT4_H__ @@ -10,85 +11,6 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - -#if !defined(__KERNEL_METAL__) -ccl_device_inline float4 operator-(const float4 &a); -ccl_device_inline float4 operator*(const float4 &a, const float4 &b); -ccl_device_inline float4 operator*(const float4 &a, float f); -ccl_device_inline float4 operator*(float f, const float4 &a); -ccl_device_inline float4 operator/(const float4 &a, float f); -ccl_device_inline float4 operator/(const float4 &a, const float4 &b); -ccl_device_inline float4 operator+(const float4 &a, const float f); -ccl_device_inline float4 operator+(const float4 &a, const float4 &b); -ccl_device_inline float4 operator-(const float4 &a, const float f); -ccl_device_inline float4 operator-(const float4 &a, const float4 &b); -ccl_device_inline float4 operator+=(float4 &a, const float4 &b); -ccl_device_inline float4 operator*=(float4 &a, const float4 &b); -ccl_device_inline float4 operator*=(float4 &a, float f); -ccl_device_inline float4 operator/=(float4 &a, float f); - -ccl_device_inline int4 operator<(const float4 &a, const float4 &b); -ccl_device_inline int4 operator>=(const float4 &a, const float4 &b); -ccl_device_inline int4 operator<=(const float4 &a, const float4 &b); -ccl_device_inline bool operator==(const float4 &a, const float4 &b); - -ccl_device_inline float distance(const float4 &a, const float4 &b); -ccl_device_inline float dot(const float4 &a, const float4 &b); -ccl_device_inline float len_squared(const float4 &a); -ccl_device_inline float4 rcp(const float4 &a); -ccl_device_inline float4 sqrt(const float4 &a); -ccl_device_inline float4 sqr(const float4 &a); -ccl_device_inline float4 cross(const float4 &a, const float4 &b); -ccl_device_inline bool is_zero(const float4 &a); -ccl_device_inline float average(const float4 &a); -ccl_device_inline float len(const float4 &a); -ccl_device_inline float4 normalize(const float4 &a); -ccl_device_inline float4 safe_normalize(const float4 &a); -ccl_device_inline float4 min(const float4 &a, const float4 &b); -ccl_device_inline float4 max(const float4 &a, const float4 &b); -ccl_device_inline float4 clamp(const float4 &a, const float4 &mn, const float4 &mx); -ccl_device_inline float4 fabs(const float4 &a); -ccl_device_inline float4 floor(const float4 &a); -ccl_device_inline float4 mix(const float4 &a, const float4 &b, float t); -#endif /* !__KERNEL_METAL__*/ - -ccl_device_inline float4 safe_divide(const float4 a, const float4 b); -ccl_device_inline float4 safe_divide(const float4 a, const float b); - -#ifdef __KERNEL_SSE__ -template<size_t index_0, size_t index_1, size_t index_2, size_t index_3> -__forceinline const float4 shuffle(const float4 &b); -template<size_t index_0, size_t index_1, size_t index_2, size_t index_3> -__forceinline const float4 shuffle(const float4 &a, const float4 &b); - -template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &b); - -template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &a, const float4 &b); -template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4 &a, const float4 &b); - -# ifdef __KERNEL_SSE3__ -template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4 &b); -template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4 &b); -# endif -#endif /* __KERNEL_SSE__ */ - -ccl_device_inline float reduce_min(const float4 a); -ccl_device_inline float reduce_max(const float4 a); -ccl_device_inline float reduce_add(const float4 a); - -ccl_device_inline bool isequal(const float4 a, const float4 b); - -#ifndef __KERNEL_GPU__ -ccl_device_inline float4 select(const int4 &mask, const float4 &a, const float4 &b); -#endif /* !__KERNEL_GPU__ */ - -/******************************************************************************* - * Definition. - */ - ccl_device_inline float4 zero_float4() { #ifdef __KERNEL_SSE__ @@ -103,6 +25,16 @@ ccl_device_inline float4 one_float4() return make_float4(1.0f, 1.0f, 1.0f, 1.0f); } +ccl_device_inline int4 cast(const float4 a) +{ +#ifdef __KERNEL_SSE__ + return int4(_mm_castps_si128(a)); +#else + return make_int4( + __float_as_int(a.x), __float_as_int(a.y), __float_as_int(a.z), __float_as_int(a.w)); +#endif +} + #if !defined(__KERNEL_METAL__) ccl_device_inline float4 operator-(const float4 &a) { @@ -114,7 +46,7 @@ ccl_device_inline float4 operator-(const float4 &a) # endif } -ccl_device_inline float4 operator*(const float4 &a, const float4 &b) +ccl_device_inline float4 operator*(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return float4(_mm_mul_ps(a.m128, b.m128)); @@ -123,7 +55,7 @@ ccl_device_inline float4 operator*(const float4 &a, const float4 &b) # endif } -ccl_device_inline float4 operator*(const float4 &a, float f) +ccl_device_inline float4 operator*(const float4 a, float f) { # if defined(__KERNEL_SSE__) return a * make_float4(f); @@ -132,17 +64,17 @@ ccl_device_inline float4 operator*(const float4 &a, float f) # endif } -ccl_device_inline float4 operator*(float f, const float4 &a) +ccl_device_inline float4 operator*(float f, const float4 a) { return a * f; } -ccl_device_inline float4 operator/(const float4 &a, float f) +ccl_device_inline float4 operator/(const float4 a, float f) { return a * (1.0f / f); } -ccl_device_inline float4 operator/(const float4 &a, const float4 &b) +ccl_device_inline float4 operator/(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return float4(_mm_div_ps(a.m128, b.m128)); @@ -151,12 +83,7 @@ ccl_device_inline float4 operator/(const float4 &a, const float4 &b) # endif } -ccl_device_inline float4 operator+(const float4 &a, const float f) -{ - return a + make_float4(f, f, f, f); -} - -ccl_device_inline float4 operator+(const float4 &a, const float4 &b) +ccl_device_inline float4 operator+(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return float4(_mm_add_ps(a.m128, b.m128)); @@ -165,12 +92,12 @@ ccl_device_inline float4 operator+(const float4 &a, const float4 &b) # endif } -ccl_device_inline float4 operator-(const float4 &a, const float f) +ccl_device_inline float4 operator+(const float4 a, const float f) { - return a - make_float4(f, f, f, f); + return a + make_float4(f); } -ccl_device_inline float4 operator-(const float4 &a, const float4 &b) +ccl_device_inline float4 operator-(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return float4(_mm_sub_ps(a.m128, b.m128)); @@ -179,17 +106,22 @@ ccl_device_inline float4 operator-(const float4 &a, const float4 &b) # endif } -ccl_device_inline float4 operator+=(float4 &a, const float4 &b) +ccl_device_inline float4 operator-(const float4 a, const float f) +{ + return a - make_float4(f); +} + +ccl_device_inline float4 operator+=(float4 &a, const float4 b) { return a = a + b; } -ccl_device_inline float4 operator-=(float4 &a, const float4 &b) +ccl_device_inline float4 operator-=(float4 &a, const float4 b) { return a = a - b; } -ccl_device_inline float4 operator*=(float4 &a, const float4 &b) +ccl_device_inline float4 operator*=(float4 &a, const float4 b) { return a = a * b; } @@ -204,7 +136,7 @@ ccl_device_inline float4 operator/=(float4 &a, float f) return a = a / f; } -ccl_device_inline int4 operator<(const float4 &a, const float4 &b) +ccl_device_inline int4 operator<(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_castps_si128(_mm_cmplt_ps(a.m128, b.m128))); @@ -213,7 +145,7 @@ ccl_device_inline int4 operator<(const float4 &a, const float4 &b) # endif } -ccl_device_inline int4 operator>=(const float4 &a, const float4 &b) +ccl_device_inline int4 operator>=(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_castps_si128(_mm_cmpge_ps(a.m128, b.m128))); @@ -222,7 +154,7 @@ ccl_device_inline int4 operator>=(const float4 &a, const float4 &b) # endif } -ccl_device_inline int4 operator<=(const float4 &a, const float4 &b) +ccl_device_inline int4 operator<=(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_castps_si128(_mm_cmple_ps(a.m128, b.m128))); @@ -231,7 +163,7 @@ ccl_device_inline int4 operator<=(const float4 &a, const float4 &b) # endif } -ccl_device_inline bool operator==(const float4 &a, const float4 &b) +ccl_device_inline bool operator==(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ return (_mm_movemask_ps(_mm_cmpeq_ps(a.m128, b.m128)) & 15) == 15; @@ -240,160 +172,148 @@ ccl_device_inline bool operator==(const float4 &a, const float4 &b) # endif } -ccl_device_inline float distance(const float4 &a, const float4 &b) -{ - return len(a - b); -} - -ccl_device_inline float dot(const float4 &a, const float4 &b) +ccl_device_inline const float4 operator^(const float4 a, const float4 b) { -# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) -# if defined(__KERNEL_NEON__) - __m128 t = vmulq_f32(a, b); - return vaddvq_f32(t); -# else - return _mm_cvtss_f32(_mm_dp_ps(a, b, 0xFF)); -# endif +# ifdef __KERNEL_SSE__ + return float4(_mm_xor_ps(a.m128, b.m128)); # else - return (a.x * b.x + a.y * b.y) + (a.z * b.z + a.w * b.w); + return make_float4(__uint_as_float(__float_as_uint(a.x) ^ __float_as_uint(b.x)), + __uint_as_float(__float_as_uint(a.y) ^ __float_as_uint(b.y)), + __uint_as_float(__float_as_uint(a.z) ^ __float_as_uint(b.z)), + __uint_as_float(__float_as_uint(a.w) ^ __float_as_uint(b.w))); # endif } -ccl_device_inline float len_squared(const float4 &a) -{ - return dot(a, a); -} - -ccl_device_inline float4 rcp(const float4 &a) +ccl_device_inline float4 min(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ - /* Don't use _mm_rcp_ps due to poor precision. */ - return float4(_mm_div_ps(_mm_set_ps1(1.0f), a.m128)); + return float4(_mm_min_ps(a.m128, b.m128)); # else - return make_float4(1.0f / a.x, 1.0f / a.y, 1.0f / a.z, 1.0f / a.w); + return make_float4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); # endif } -ccl_device_inline float4 sqrt(const float4 &a) +ccl_device_inline float4 max(const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ - return float4(_mm_sqrt_ps(a.m128)); + return float4(_mm_max_ps(a.m128, b.m128)); # else - return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w)); + return make_float4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); # endif } -ccl_device_inline float4 sqr(const float4 &a) +ccl_device_inline float4 clamp(const float4 a, const float4 mn, const float4 mx) { - return a * a; + return min(max(a, mn), mx); } +#endif /* !__KERNEL_METAL__*/ -ccl_device_inline float4 cross(const float4 &a, const float4 &b) +ccl_device_inline const float4 madd(const float4 a, const float4 b, const float4 c) { -# ifdef __KERNEL_SSE__ - return (shuffle<1, 2, 0, 0>(a) * shuffle<2, 0, 1, 0>(b)) - - (shuffle<2, 0, 1, 0>(a) * shuffle<1, 2, 0, 0>(b)); +#ifdef __KERNEL_SSE__ +# ifdef __KERNEL_NEON__ + return float4(vfmaq_f32(c, a, b)); +# elif defined(__KERNEL_AVX2__) + return float4(_mm_fmadd_ps(a, b, c)); # else - return make_float4(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x, 0.0f); + return a * b + c; # endif +#else + return a * b + c; +#endif } -ccl_device_inline bool is_zero(const float4 &a) +ccl_device_inline float4 msub(const float4 a, const float4 b, const float4 c) { -# ifdef __KERNEL_SSE__ - return a == zero_float4(); +#ifdef __KERNEL_SSE__ +# ifdef __KERNEL_NEON__ + return float4(vfmaq_f32(vnegq_f32(c), a, b)); +# elif defined(__KERNEL_AVX2__) + return float4(_mm_fmsub_ps(a, b, c)); # else - return (a.x == 0.0f && a.y == 0.0f && a.z == 0.0f && a.w == 0.0f); + return a * b - c; # endif +#else + return a * b - c; +#endif } -ccl_device_inline float average(const float4 &a) +#ifdef __KERNEL_SSE__ +template<size_t i0, size_t i1, size_t i2, size_t i3> +__forceinline const float4 shuffle(const float4 b) { - return reduce_add(a) * 0.25f; +# ifdef __KERNEL_NEON__ + return float4(shuffle_neon<float32x4_t, i0, i1, i2, i3>(b.m128)); +# else + return float4( + _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(i3, i2, i1, i0)))); +# endif } -ccl_device_inline float len(const float4 &a) +template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 a) { - return sqrtf(dot(a, a)); + return float4(_mm_movelh_ps(a, a)); } -ccl_device_inline float4 normalize(const float4 &a) +template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4 a) { - return a / len(a); + return float4(_mm_movehl_ps(a, a)); } -ccl_device_inline float4 safe_normalize(const float4 &a) +# ifdef __KERNEL_SSE3__ +template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4 b) { - float t = len(a); - return (t != 0.0f) ? a / t : a; + return float4(_mm_moveldup_ps(b)); } -ccl_device_inline float4 min(const float4 &a, const float4 &b) +template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4 b) { -# ifdef __KERNEL_SSE__ - return float4(_mm_min_ps(a.m128, b.m128)); -# else - return make_float4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w)); -# endif + return float4(_mm_movehdup_ps(b)); } +# endif /* __KERNEL_SSE3__ */ -ccl_device_inline float4 max(const float4 &a, const float4 &b) +template<size_t i0, size_t i1, size_t i2, size_t i3> +__forceinline const float4 shuffle(const float4 a, const float4 b) { -# ifdef __KERNEL_SSE__ - return float4(_mm_max_ps(a.m128, b.m128)); +# ifdef __KERNEL_NEON__ + return float4(shuffle_neon<float32x4_t, i0, i1, i2, i3>(a, b)); # else - return make_float4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w)); + return float4(_mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0))); # endif } -ccl_device_inline float4 clamp(const float4 &a, const float4 &mn, const float4 &mx) +template<size_t i0> __forceinline const float4 shuffle(const float4 b) { - return min(max(a, mn), mx); + return shuffle<i0, i0, i0, i0>(b); } - -ccl_device_inline float4 fabs(const float4 &a) +template<size_t i0> __forceinline const float4 shuffle(const float4 a, const float4 b) { -# if defined(__KERNEL_SSE__) -# if defined(__KERNEL_NEON__) - return float4(vabsq_f32(a)); -# else - return float4(_mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)))); -# endif -# else - return make_float4(fabsf(a.x), fabsf(a.y), fabsf(a.z), fabsf(a.w)); -# endif -} - -ccl_device_inline float4 floor(const float4 &a) -{ -# ifdef __KERNEL_SSE__ - return float4(_mm_floor_ps(a)); +# ifdef __KERNEL_NEON__ + return float4(shuffle_neon<float32x4_t, i0, i0, i0, i0>(a, b)); # else - return make_float4(floorf(a.x), floorf(a.y), floorf(a.z), floorf(a.w)); + return float4(_mm_shuffle_ps(a, b, _MM_SHUFFLE(i0, i0, i0, i0))); # endif } -ccl_device_inline float4 mix(const float4 &a, const float4 &b, float t) +template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 a, const float4 b) { - return a + t * (b - a); + return float4(_mm_movelh_ps(a, b)); } -ccl_device_inline float4 saturate(const float4 &a) +template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4 a, const float4 b) { - return make_float4(saturatef(a.x), saturatef(a.y), saturatef(a.z), saturatef(a.w)); + return float4(_mm_movehl_ps(b, a)); } -ccl_device_inline float4 exp(float4 v) +template<size_t i> __forceinline float extract(const float4 a) { - return make_float4(expf(v.x), expf(v.y), expf(v.z), expf(v.z)); + return _mm_cvtss_f32(shuffle<i, i, i, i>(a)); } - -ccl_device_inline float4 log(float4 v) +template<> __forceinline float extract<0>(const float4 a) { - return make_float4(logf(v.x), logf(v.y), logf(v.z), logf(v.z)); + return _mm_cvtss_f32(a); } - -#endif /* !__KERNEL_METAL__*/ +#endif ccl_device_inline float reduce_add(const float4 a) { @@ -440,77 +360,192 @@ ccl_device_inline float reduce_max(const float4 a) #endif } -ccl_device_inline bool isequal(const float4 a, const float4 b) +#if !defined(__KERNEL_METAL__) +ccl_device_inline float dot(const float4 a, const float4 b) { -#if defined(__KERNEL_METAL__) - return all(a == b); -#else - return a == b; -#endif +# if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) +# if defined(__KERNEL_NEON__) + __m128 t = vmulq_f32(a, b); + return vaddvq_f32(t); +# else + return _mm_cvtss_f32(_mm_dp_ps(a, b, 0xFF)); +# endif +# else + return (a.x * b.x + a.y * b.y) + (a.z * b.z + a.w * b.w); +# endif } +#endif /* !defined(__KERNEL_METAL__) */ -#ifdef __KERNEL_SSE__ -template<size_t index_0, size_t index_1, size_t index_2, size_t index_3> -__forceinline const float4 shuffle(const float4 &b) +ccl_device_inline float len(const float4 a) { -# if defined(__KERNEL_NEON__) - return float4(shuffle_neon<__m128, index_0, index_1, index_2, index_3>(b.m128)); + return sqrtf(dot(a, a)); +} + +ccl_device_inline float len_squared(const float4 a) +{ + return dot(a, a); +} + +#if !defined(__KERNEL_METAL__) +ccl_device_inline float distance(const float4 a, const float4 b) +{ + return len(a - b); +} + +ccl_device_inline float4 rcp(const float4 a) +{ +# ifdef __KERNEL_SSE__ + /* Don't use _mm_rcp_ps due to poor precision. */ + return float4(_mm_div_ps(_mm_set_ps1(1.0f), a.m128)); # else - return float4(_mm_castsi128_ps( - _mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(index_3, index_2, index_1, index_0)))); + return make_float4(1.0f / a.x, 1.0f / a.y, 1.0f / a.z, 1.0f / a.w); # endif } -template<size_t index_0, size_t index_1, size_t index_2, size_t index_3> -__forceinline const float4 shuffle(const float4 &a, const float4 &b) +ccl_device_inline float4 sqrt(const float4 a) { -# if defined(__KERNEL_NEON__) - return float4(shuffle_neon<__m128, index_0, index_1, index_2, index_3>(a.m128, b.m128)); +# ifdef __KERNEL_SSE__ + return float4(_mm_sqrt_ps(a.m128)); # else - return float4(_mm_shuffle_ps(a.m128, b.m128, _MM_SHUFFLE(index_3, index_2, index_1, index_0))); + return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w)); # endif } -template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &b) +ccl_device_inline float4 sqr(const float4 a) { - return float4(_mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b)))); + return a * a; } -template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &a, const float4 &b) +ccl_device_inline float4 cross(const float4 a, const float4 b) { - return float4(_mm_movelh_ps(a.m128, b.m128)); +# ifdef __KERNEL_SSE__ + return (shuffle<1, 2, 0, 0>(a) * shuffle<2, 0, 1, 0>(b)) - + (shuffle<2, 0, 1, 0>(a) * shuffle<1, 2, 0, 0>(b)); +# else + return make_float4(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x, 0.0f); +# endif } -template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4 &a, const float4 &b) +ccl_device_inline bool is_zero(const float4 a) { - return float4(_mm_movehl_ps(b.m128, a.m128)); +# ifdef __KERNEL_SSE__ + return a == zero_float4(); +# else + return (a.x == 0.0f && a.y == 0.0f && a.z == 0.0f && a.w == 0.0f); +# endif } -# ifdef __KERNEL_SSE3__ -template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4 &b) +ccl_device_inline float average(const float4 a) { - return float4(_mm_moveldup_ps(b)); + return reduce_add(a) * 0.25f; } -template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4 &b) +ccl_device_inline float4 normalize(const float4 a) { - return float4(_mm_movehdup_ps(b)); + return a / len(a); +} + +ccl_device_inline float4 safe_normalize(const float4 a) +{ + float t = len(a); + return (t != 0.0f) ? a / t : a; +} + +ccl_device_inline float4 fabs(const float4 a) +{ +# if defined(__KERNEL_SSE__) +# if defined(__KERNEL_NEON__) + return float4(vabsq_f32(a)); +# else + return float4(_mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff)))); +# endif +# else + return make_float4(fabsf(a.x), fabsf(a.y), fabsf(a.z), fabsf(a.w)); +# endif +} + +ccl_device_inline float4 floor(const float4 a) +{ +# ifdef __KERNEL_SSE__ +# if defined(__KERNEL_NEON__) + return float4(vrndmq_f32(a)); +# else + return float4(_mm_floor_ps(a)); +# endif +# else + return make_float4(floorf(a.x), floorf(a.y), floorf(a.z), floorf(a.w)); +# endif +} + +ccl_device_inline float4 floorfrac(const float4 x, ccl_private int4 *i) +{ +# ifdef __KERNEL_SSE__ + const float4 f = floor(x); + *i = int4(_mm_cvttps_epi32(f.m128)); + return x - f; +# else + float4 r; + r.x = floorfrac(x.x, &i->x); + r.y = floorfrac(x.y, &i->y); + r.z = floorfrac(x.z, &i->z); + r.w = floorfrac(x.w, &i->w); + return r; +# endif +} + +ccl_device_inline float4 mix(const float4 a, const float4 b, float t) +{ + return a + t * (b - a); +} + +ccl_device_inline float4 mix(const float4 a, const float4 b, const float4 t) +{ + return a + t * (b - a); +} + +ccl_device_inline float4 saturate(const float4 a) +{ + return make_float4(saturatef(a.x), saturatef(a.y), saturatef(a.z), saturatef(a.w)); +} + +ccl_device_inline float4 exp(float4 v) +{ + return make_float4(expf(v.x), expf(v.y), expf(v.z), expf(v.z)); +} + +ccl_device_inline float4 log(float4 v) +{ + return make_float4(logf(v.x), logf(v.y), logf(v.z), logf(v.z)); +} + +#endif /* !__KERNEL_METAL__*/ + +ccl_device_inline bool isequal(const float4 a, const float4 b) +{ +#if defined(__KERNEL_METAL__) + return all(a == b); +#else + return a == b; +#endif } -# endif /* __KERNEL_SSE3__ */ -#endif /* __KERNEL_SSE__ */ #ifndef __KERNEL_GPU__ -ccl_device_inline float4 select(const int4 &mask, const float4 &a, const float4 &b) +ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b) { # ifdef __KERNEL_SSE__ +# ifdef __KERNEL_SSE41__ return float4(_mm_blendv_ps(b.m128, a.m128, _mm_castsi128_ps(mask.m128))); +# else + return float4( + _mm_or_ps(_mm_and_ps(_mm_castsi128_ps(mask), a), _mm_andnot_ps(_mm_castsi128_ps(mask), b))); +# endif # else return make_float4( (mask.x) ? a.x : b.x, (mask.y) ? a.y : b.y, (mask.z) ? a.z : b.z, (mask.w) ? a.w : b.w); # endif } -ccl_device_inline float4 mask(const int4 &mask, const float4 &a) +ccl_device_inline float4 mask(const int4 mask, const float4 a) { /* Replace elements of x with zero where mask isn't set. */ return select(mask, a, zero_float4()); diff --git a/intern/cycles/util/math_float8.h b/intern/cycles/util/math_float8.h index b538cfbe70b..755a720a10b 100644 --- a/intern/cycles/util/math_float8.h +++ b/intern/cycles/util/math_float8.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2013 Intel Corporation * Copyright 2022 Blender Foundation */ #ifndef __UTIL_MATH_FLOAT8_H__ @@ -10,193 +11,138 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - -ccl_device_inline float8_t operator+(const float8_t a, const float8_t b); -ccl_device_inline float8_t operator+(const float8_t a, const float f); -ccl_device_inline float8_t operator+(const float f, const float8_t a); - -ccl_device_inline float8_t operator-(const float8_t a); -ccl_device_inline float8_t operator-(const float8_t a, const float8_t b); -ccl_device_inline float8_t operator-(const float8_t a, const float f); -ccl_device_inline float8_t operator-(const float f, const float8_t a); - -ccl_device_inline float8_t operator*(const float8_t a, const float8_t b); -ccl_device_inline float8_t operator*(const float8_t a, const float f); -ccl_device_inline float8_t operator*(const float f, const float8_t a); - -ccl_device_inline float8_t operator/(const float8_t a, const float8_t b); -ccl_device_inline float8_t operator/(const float8_t a, float f); -ccl_device_inline float8_t operator/(const float f, const float8_t a); - -ccl_device_inline float8_t operator+=(float8_t a, const float8_t b); - -ccl_device_inline float8_t operator*=(float8_t a, const float8_t b); -ccl_device_inline float8_t operator*=(float8_t a, float f); - -ccl_device_inline float8_t operator/=(float8_t a, float f); - -ccl_device_inline bool operator==(const float8_t a, const float8_t b); - -ccl_device_inline float8_t rcp(const float8_t a); -ccl_device_inline float8_t sqrt(const float8_t a); -ccl_device_inline float8_t sqr(const float8_t a); -ccl_device_inline bool is_zero(const float8_t a); -ccl_device_inline float average(const float8_t a); -ccl_device_inline float8_t min(const float8_t a, const float8_t b); -ccl_device_inline float8_t max(const float8_t a, const float8_t b); -ccl_device_inline float8_t clamp(const float8_t a, const float8_t mn, const float8_t mx); -ccl_device_inline float8_t fabs(const float8_t a); -ccl_device_inline float8_t mix(const float8_t a, const float8_t b, float t); -ccl_device_inline float8_t saturate(const float8_t a); - -ccl_device_inline float8_t safe_divide(const float8_t a, const float b); -ccl_device_inline float8_t safe_divide(const float8_t a, const float8_t b); - -ccl_device_inline float reduce_min(const float8_t a); -ccl_device_inline float reduce_max(const float8_t a); -ccl_device_inline float reduce_add(const float8_t a); - -ccl_device_inline bool isequal(const float8_t a, const float8_t b); - -/******************************************************************************* - * Definition. - */ - -ccl_device_inline float8_t zero_float8_t() +ccl_device_inline vfloat8 zero_vfloat8() { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_setzero_ps()); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_setzero_ps()); #else - return make_float8_t(0.0f); + return make_vfloat8(0.0f); #endif } -ccl_device_inline float8_t one_float8_t() +ccl_device_inline vfloat8 one_vfloat8() { - return make_float8_t(1.0f); + return make_vfloat8(1.0f); } -ccl_device_inline float8_t operator+(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator+(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_add_ps(a.m256, b.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_add_ps(a.m256, b.m256)); #else - return make_float8_t( + return make_vfloat8( a.a + b.a, a.b + b.b, a.c + b.c, a.d + b.d, a.e + b.e, a.f + b.f, a.g + b.g, a.h + b.h); #endif } -ccl_device_inline float8_t operator+(const float8_t a, const float f) +ccl_device_inline vfloat8 operator+(const vfloat8 a, const float f) { - return a + make_float8_t(f); + return a + make_vfloat8(f); } -ccl_device_inline float8_t operator+(const float f, const float8_t a) +ccl_device_inline vfloat8 operator+(const float f, const vfloat8 a) { - return make_float8_t(f) + a; + return make_vfloat8(f) + a; } -ccl_device_inline float8_t operator-(const float8_t a) +ccl_device_inline vfloat8 operator-(const vfloat8 a) { -#ifdef __KERNEL_AVX2__ +#ifdef __KERNEL_AVX__ __m256 mask = _mm256_castsi256_ps(_mm256_set1_epi32(0x80000000)); - return float8_t(_mm256_xor_ps(a.m256, mask)); + return vfloat8(_mm256_xor_ps(a.m256, mask)); #else - return make_float8_t(-a.a, -a.b, -a.c, -a.d, -a.e, -a.f, -a.g, -a.h); + return make_vfloat8(-a.a, -a.b, -a.c, -a.d, -a.e, -a.f, -a.g, -a.h); #endif } -ccl_device_inline float8_t operator-(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator-(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_sub_ps(a.m256, b.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_sub_ps(a.m256, b.m256)); #else - return make_float8_t( + return make_vfloat8( a.a - b.a, a.b - b.b, a.c - b.c, a.d - b.d, a.e - b.e, a.f - b.f, a.g - b.g, a.h - b.h); #endif } -ccl_device_inline float8_t operator-(const float8_t a, const float f) +ccl_device_inline vfloat8 operator-(const vfloat8 a, const float f) { - return a - make_float8_t(f); + return a - make_vfloat8(f); } -ccl_device_inline float8_t operator-(const float f, const float8_t a) +ccl_device_inline vfloat8 operator-(const float f, const vfloat8 a) { - return make_float8_t(f) - a; + return make_vfloat8(f) - a; } -ccl_device_inline float8_t operator*(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator*(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_mul_ps(a.m256, b.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_mul_ps(a.m256, b.m256)); #else - return make_float8_t( + return make_vfloat8( a.a * b.a, a.b * b.b, a.c * b.c, a.d * b.d, a.e * b.e, a.f * b.f, a.g * b.g, a.h * b.h); #endif } -ccl_device_inline float8_t operator*(const float8_t a, const float f) +ccl_device_inline vfloat8 operator*(const vfloat8 a, const float f) { - return a * make_float8_t(f); + return a * make_vfloat8(f); } -ccl_device_inline float8_t operator*(const float f, const float8_t a) +ccl_device_inline vfloat8 operator*(const float f, const vfloat8 a) { - return make_float8_t(f) * a; + return make_vfloat8(f) * a; } -ccl_device_inline float8_t operator/(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator/(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_div_ps(a.m256, b.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_div_ps(a.m256, b.m256)); #else - return make_float8_t( + return make_vfloat8( a.a / b.a, a.b / b.b, a.c / b.c, a.d / b.d, a.e / b.e, a.f / b.f, a.g / b.g, a.h / b.h); #endif } -ccl_device_inline float8_t operator/(const float8_t a, const float f) +ccl_device_inline vfloat8 operator/(const vfloat8 a, const float f) { - return a / make_float8_t(f); + return a / make_vfloat8(f); } -ccl_device_inline float8_t operator/(const float f, const float8_t a) +ccl_device_inline vfloat8 operator/(const float f, const vfloat8 a) { - return make_float8_t(f) / a; + return make_vfloat8(f) / a; } -ccl_device_inline float8_t operator+=(float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator+=(vfloat8 a, const vfloat8 b) { return a = a + b; } -ccl_device_inline float8_t operator-=(float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator-=(vfloat8 a, const vfloat8 b) { return a = a - b; } -ccl_device_inline float8_t operator*=(float8_t a, const float8_t b) +ccl_device_inline vfloat8 operator*=(vfloat8 a, const vfloat8 b) { return a = a * b; } -ccl_device_inline float8_t operator*=(float8_t a, float f) +ccl_device_inline vfloat8 operator*=(vfloat8 a, float f) { return a = a * f; } -ccl_device_inline float8_t operator/=(float8_t a, float f) +ccl_device_inline vfloat8 operator/=(vfloat8 a, float f) { return a = a / f; } -ccl_device_inline bool operator==(const float8_t a, const float8_t b) +ccl_device_inline bool operator==(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ +#ifdef __KERNEL_AVX__ return (_mm256_movemask_ps(_mm256_castsi256_ps( _mm256_cmpeq_epi32(_mm256_castps_si256(a.m256), _mm256_castps_si256(b.m256)))) & 0b11111111) == 0b11111111; @@ -206,132 +152,180 @@ ccl_device_inline bool operator==(const float8_t a, const float8_t b) #endif } -ccl_device_inline float8_t rcp(const float8_t a) +ccl_device_inline const vfloat8 operator^(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_rcp_ps(a.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_xor_ps(a.m256, b.m256)); #else - return make_float8_t(1.0f / a.a, - 1.0f / a.b, - 1.0f / a.c, - 1.0f / a.d, - 1.0f / a.e, - 1.0f / a.f, - 1.0f / a.g, - 1.0f / a.h); + return make_vfloat8(__uint_as_float(__float_as_uint(a.a) ^ __float_as_uint(b.a)), + __uint_as_float(__float_as_uint(a.b) ^ __float_as_uint(b.b)), + __uint_as_float(__float_as_uint(a.c) ^ __float_as_uint(b.c)), + __uint_as_float(__float_as_uint(a.d) ^ __float_as_uint(b.d)), + __uint_as_float(__float_as_uint(a.e) ^ __float_as_uint(b.e)), + __uint_as_float(__float_as_uint(a.f) ^ __float_as_uint(b.f)), + __uint_as_float(__float_as_uint(a.g) ^ __float_as_uint(b.g)), + __uint_as_float(__float_as_uint(a.h) ^ __float_as_uint(b.h))); #endif } -ccl_device_inline float8_t sqrt(const float8_t a) +ccl_device_inline vfloat8 rcp(const vfloat8 a) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_sqrt_ps(a.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_rcp_ps(a.m256)); #else - return make_float8_t(sqrtf(a.a), - sqrtf(a.b), - sqrtf(a.c), - sqrtf(a.d), - sqrtf(a.e), - sqrtf(a.f), - sqrtf(a.g), - sqrtf(a.h)); + return make_vfloat8(1.0f / a.a, + 1.0f / a.b, + 1.0f / a.c, + 1.0f / a.d, + 1.0f / a.e, + 1.0f / a.f, + 1.0f / a.g, + 1.0f / a.h); #endif } -ccl_device_inline float8_t sqr(const float8_t a) +ccl_device_inline vfloat8 sqrt(const vfloat8 a) +{ +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_sqrt_ps(a.m256)); +#else + return make_vfloat8(sqrtf(a.a), + sqrtf(a.b), + sqrtf(a.c), + sqrtf(a.d), + sqrtf(a.e), + sqrtf(a.f), + sqrtf(a.g), + sqrtf(a.h)); +#endif +} + +ccl_device_inline vfloat8 sqr(const vfloat8 a) { return a * a; } -ccl_device_inline bool is_zero(const float8_t a) +ccl_device_inline bool is_zero(const vfloat8 a) { - return a == make_float8_t(0.0f); + return a == make_vfloat8(0.0f); } -ccl_device_inline float average(const float8_t a) +ccl_device_inline float reduce_add(const vfloat8 a) +{ +#ifdef __KERNEL_AVX__ + vfloat8 b(_mm256_hadd_ps(a.m256, a.m256)); + vfloat8 h(_mm256_hadd_ps(b.m256, b.m256)); + return h[0] + h[4]; +#else + return a.a + a.b + a.c + a.d + a.e + a.f + a.g + a.h; +#endif +} + +ccl_device_inline float average(const vfloat8 a) { return reduce_add(a) / 8.0f; } -ccl_device_inline float8_t min(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 min(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_min_ps(a.m256, b.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_min_ps(a.m256, b.m256)); #else - return make_float8_t(min(a.a, b.a), - min(a.b, b.b), - min(a.c, b.c), - min(a.d, b.d), - min(a.e, b.e), - min(a.f, b.f), - min(a.g, b.g), - min(a.h, b.h)); + return make_vfloat8(min(a.a, b.a), + min(a.b, b.b), + min(a.c, b.c), + min(a.d, b.d), + min(a.e, b.e), + min(a.f, b.f), + min(a.g, b.g), + min(a.h, b.h)); #endif } -ccl_device_inline float8_t max(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 max(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_max_ps(a.m256, b.m256)); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_max_ps(a.m256, b.m256)); #else - return make_float8_t(max(a.a, b.a), - max(a.b, b.b), - max(a.c, b.c), - max(a.d, b.d), - max(a.e, b.e), - max(a.f, b.f), - max(a.g, b.g), - max(a.h, b.h)); + return make_vfloat8(max(a.a, b.a), + max(a.b, b.b), + max(a.c, b.c), + max(a.d, b.d), + max(a.e, b.e), + max(a.f, b.f), + max(a.g, b.g), + max(a.h, b.h)); #endif } -ccl_device_inline float8_t clamp(const float8_t a, const float8_t mn, const float8_t mx) +ccl_device_inline vfloat8 clamp(const vfloat8 a, const vfloat8 mn, const vfloat8 mx) { return min(max(a, mn), mx); } -ccl_device_inline float8_t fabs(const float8_t a) +ccl_device_inline vfloat8 select(const vint8 mask, const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - return float8_t(_mm256_and_ps(a.m256, _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff)))); +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_blendv_ps(b, a, _mm256_castsi256_ps(mask))); #else - return make_float8_t(fabsf(a.a), - fabsf(a.b), - fabsf(a.c), - fabsf(a.d), - fabsf(a.e), - fabsf(a.f), - fabsf(a.g), - fabsf(a.h)); + return make_vfloat8((mask.a) ? a.a : b.a, + (mask.b) ? a.b : b.b, + (mask.c) ? a.c : b.c, + (mask.d) ? a.d : b.d, + (mask.e) ? a.e : b.e, + (mask.f) ? a.f : b.f, + (mask.g) ? a.g : b.g, + (mask.h) ? a.h : b.h); #endif } -ccl_device_inline float8_t mix(const float8_t a, const float8_t b, float t) +ccl_device_inline vfloat8 fabs(const vfloat8 a) +{ +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_and_ps(a.m256, _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff)))); +#else + return make_vfloat8(fabsf(a.a), + fabsf(a.b), + fabsf(a.c), + fabsf(a.d), + fabsf(a.e), + fabsf(a.f), + fabsf(a.g), + fabsf(a.h)); +#endif +} + +ccl_device_inline vfloat8 mix(const vfloat8 a, const vfloat8 b, float t) +{ + return a + t * (b - a); +} + +ccl_device_inline vfloat8 mix(const vfloat8 a, const vfloat8 b, vfloat8 t) { return a + t * (b - a); } -ccl_device_inline float8_t saturate(const float8_t a) +ccl_device_inline vfloat8 saturate(const vfloat8 a) { - return clamp(a, make_float8_t(0.0f), make_float8_t(1.0f)); + return clamp(a, make_vfloat8(0.0f), make_vfloat8(1.0f)); } -ccl_device_inline float8_t exp(float8_t v) +ccl_device_inline vfloat8 exp(vfloat8 v) { - return make_float8_t( + return make_vfloat8( expf(v.a), expf(v.b), expf(v.c), expf(v.d), expf(v.e), expf(v.f), expf(v.g), expf(v.h)); } -ccl_device_inline float8_t log(float8_t v) +ccl_device_inline vfloat8 log(vfloat8 v) { - return make_float8_t( + return make_vfloat8( logf(v.a), logf(v.b), logf(v.c), logf(v.d), logf(v.e), logf(v.f), logf(v.g), logf(v.h)); } -ccl_device_inline float dot(const float8_t a, const float8_t b) +ccl_device_inline float dot(const vfloat8 a, const vfloat8 b) { -#ifdef __KERNEL_AVX2__ - float8_t t(_mm256_dp_ps(a.m256, b.m256, 0xFF)); +#ifdef __KERNEL_AVX__ + vfloat8 t(_mm256_dp_ps(a.m256, b.m256, 0xFF)); return t[0] + t[4]; #else return (a.a * b.a) + (a.b * b.b) + (a.c * b.c) + (a.d * b.d) + (a.e * b.e) + (a.f * b.f) + @@ -339,62 +333,51 @@ ccl_device_inline float dot(const float8_t a, const float8_t b) #endif } -ccl_device_inline float8_t pow(float8_t v, float e) +ccl_device_inline vfloat8 pow(vfloat8 v, float e) { - return make_float8_t(powf(v.a, e), - powf(v.b, e), - powf(v.c, e), - powf(v.d, e), - powf(v.e, e), - powf(v.f, e), - powf(v.g, e), - powf(v.h, e)); + return make_vfloat8(powf(v.a, e), + powf(v.b, e), + powf(v.c, e), + powf(v.d, e), + powf(v.e, e), + powf(v.f, e), + powf(v.g, e), + powf(v.h, e)); } -ccl_device_inline float reduce_min(const float8_t a) +ccl_device_inline float reduce_min(const vfloat8 a) { return min(min(min(a.a, a.b), min(a.c, a.d)), min(min(a.e, a.f), min(a.g, a.h))); } -ccl_device_inline float reduce_max(const float8_t a) +ccl_device_inline float reduce_max(const vfloat8 a) { return max(max(max(a.a, a.b), max(a.c, a.d)), max(max(a.e, a.f), max(a.g, a.h))); } -ccl_device_inline float reduce_add(const float8_t a) -{ -#ifdef __KERNEL_AVX2__ - float8_t b(_mm256_hadd_ps(a.m256, a.m256)); - float8_t h(_mm256_hadd_ps(b.m256, b.m256)); - return h[0] + h[4]; -#else - return a.a + a.b + a.c + a.d + a.e + a.f + a.g + a.h; -#endif -} - -ccl_device_inline bool isequal(const float8_t a, const float8_t b) +ccl_device_inline bool isequal(const vfloat8 a, const vfloat8 b) { return a == b; } -ccl_device_inline float8_t safe_divide(const float8_t a, const float b) +ccl_device_inline vfloat8 safe_divide(const vfloat8 a, const float b) { - return (b != 0.0f) ? a / b : make_float8_t(0.0f); + return (b != 0.0f) ? a / b : make_vfloat8(0.0f); } -ccl_device_inline float8_t safe_divide(const float8_t a, const float8_t b) +ccl_device_inline vfloat8 safe_divide(const vfloat8 a, const vfloat8 b) { - return make_float8_t((b.a != 0.0f) ? a.a / b.a : 0.0f, - (b.b != 0.0f) ? a.b / b.b : 0.0f, - (b.c != 0.0f) ? a.c / b.c : 0.0f, - (b.d != 0.0f) ? a.d / b.d : 0.0f, - (b.e != 0.0f) ? a.e / b.e : 0.0f, - (b.f != 0.0f) ? a.f / b.f : 0.0f, - (b.g != 0.0f) ? a.g / b.g : 0.0f, - (b.h != 0.0f) ? a.h / b.h : 0.0f); + return make_vfloat8((b.a != 0.0f) ? a.a / b.a : 0.0f, + (b.b != 0.0f) ? a.b / b.b : 0.0f, + (b.c != 0.0f) ? a.c / b.c : 0.0f, + (b.d != 0.0f) ? a.d / b.d : 0.0f, + (b.e != 0.0f) ? a.e / b.e : 0.0f, + (b.f != 0.0f) ? a.f / b.f : 0.0f, + (b.g != 0.0f) ? a.g / b.g : 0.0f, + (b.h != 0.0f) ? a.h / b.h : 0.0f); } -ccl_device_inline float8_t ensure_finite(float8_t v) +ccl_device_inline vfloat8 ensure_finite(vfloat8 v) { v.a = ensure_finite(v.a); v.b = ensure_finite(v.b); @@ -408,12 +391,92 @@ ccl_device_inline float8_t ensure_finite(float8_t v) return v; } -ccl_device_inline bool isfinite_safe(float8_t v) +ccl_device_inline bool isfinite_safe(vfloat8 v) { return isfinite_safe(v.a) && isfinite_safe(v.b) && isfinite_safe(v.c) && isfinite_safe(v.d) && isfinite_safe(v.e) && isfinite_safe(v.f) && isfinite_safe(v.g) && isfinite_safe(v.h); } +ccl_device_inline vint8 cast(const vfloat8 a) +{ +#ifdef __KERNEL_AVX__ + return vint8(_mm256_castps_si256(a)); +#else + return make_vint8(__float_as_int(a.a), + __float_as_int(a.b), + __float_as_int(a.c), + __float_as_int(a.d), + __float_as_int(a.e), + __float_as_int(a.f), + __float_as_int(a.g), + __float_as_int(a.h)); +#endif +} + +#ifdef __KERNEL_SSE__ +ccl_device_forceinline float4 low(const vfloat8 a) +{ +# ifdef __KERNEL_AVX__ + return float4(_mm256_extractf128_ps(a.m256, 0)); +# else + return make_float4(a.e, a.f, a.g, a.h); +# endif +} +ccl_device_forceinline float4 high(const vfloat8 a) +{ +# ifdef __KERNEL_AVX__ + return float4(_mm256_extractf128_ps(a.m256, 1)); +# else + return make_float4(a.a, a.b, a.c, a.d); +# endif +} + +template<int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7> +ccl_device_forceinline const vfloat8 shuffle(const vfloat8 a) +{ +# ifdef __KERNEL_AVX__ + return vfloat8(_mm256_permutevar_ps(a, _mm256_set_epi32(i7, i6, i5, i4, i3, i2, i1, i0))); +# else + return make_vfloat8(a[i0], a[i1], a[i2], a[i3], a[i4 + 4], a[i5 + 4], a[i6 + 4], a[i7 + 4]); +# endif +} + +template<size_t i0, size_t i1, size_t i2, size_t i3> +ccl_device_forceinline const vfloat8 shuffle(const vfloat8 a, const vfloat8 b) +{ +# ifdef __KERNEL_AVX__ + return vfloat8(_mm256_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0))); +# else + return make_vfloat8(shuffle<i0, i1, i2, i3>(high(a), high(b)), + shuffle<i0, i1, i2, i3>(low(a), low(b))); +# endif +} + +template<size_t i0, size_t i1, size_t i2, size_t i3> +ccl_device_forceinline const vfloat8 shuffle(const vfloat8 a) +{ + return shuffle<i0, i1, i2, i3>(a, a); +} +template<size_t i0> ccl_device_forceinline const vfloat8 shuffle(const vfloat8 a, const vfloat8 b) +{ + return shuffle<i0, i0, i0, i0>(a, b); +} +template<size_t i0> ccl_device_forceinline const vfloat8 shuffle(const vfloat8 a) +{ + return shuffle<i0>(a, a); +} + +template<size_t i> ccl_device_forceinline float extract(const vfloat8 a) +{ +# ifdef __KERNEL_AVX__ + __m256 b = shuffle<i, i, i, i>(a).m256; + return _mm256_cvtss_f32(b); +# else + return a[i]; +# endif +} +#endif + CCL_NAMESPACE_END #endif /* __UTIL_MATH_FLOAT8_H__ */ diff --git a/intern/cycles/util/math_int2.h b/intern/cycles/util/math_int2.h index f4d8a71221a..2df2ec5505b 100644 --- a/intern/cycles/util/math_int2.h +++ b/intern/cycles/util/math_int2.h @@ -10,23 +10,6 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - -#if !defined(__KERNEL_METAL__) -ccl_device_inline bool operator==(const int2 a, const int2 b); -ccl_device_inline int2 operator+(const int2 &a, const int2 &b); -ccl_device_inline int2 operator+=(int2 &a, const int2 &b); -ccl_device_inline int2 operator-(const int2 &a, const int2 &b); -ccl_device_inline int2 operator*(const int2 &a, const int2 &b); -ccl_device_inline int2 operator/(const int2 &a, const int2 &b); -#endif /* !__KERNEL_METAL__ */ - -/******************************************************************************* - * Definition. - */ - #if !defined(__KERNEL_METAL__) ccl_device_inline bool operator==(const int2 a, const int2 b) { diff --git a/intern/cycles/util/math_int3.h b/intern/cycles/util/math_int3.h index 48bffeaf553..b5b972ddfb5 100644 --- a/intern/cycles/util/math_int3.h +++ b/intern/cycles/util/math_int3.h @@ -10,21 +10,6 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - -#if !defined(__KERNEL_METAL__) -ccl_device_inline int3 min(int3 a, int3 b); -ccl_device_inline int3 max(int3 a, int3 b); -ccl_device_inline int3 clamp(const int3 &a, int mn, int mx); -ccl_device_inline int3 clamp(const int3 &a, int3 &mn, int mx); -#endif /* !defined(__KERNEL_METAL__) */ - -/******************************************************************************* - * Definition. - */ - #if !defined(__KERNEL_METAL__) ccl_device_inline int3 min(int3 a, int3 b) { @@ -44,7 +29,7 @@ ccl_device_inline int3 max(int3 a, int3 b) # endif } -ccl_device_inline int3 clamp(const int3 &a, int mn, int mx) +ccl_device_inline int3 clamp(const int3 a, int mn, int mx) { # ifdef __KERNEL_SSE__ return min(max(a, make_int3(mn)), make_int3(mx)); @@ -53,7 +38,7 @@ ccl_device_inline int3 clamp(const int3 &a, int mn, int mx) # endif } -ccl_device_inline int3 clamp(const int3 &a, int3 &mn, int mx) +ccl_device_inline int3 clamp(const int3 a, int3 &mn, int mx) { # ifdef __KERNEL_SSE__ return min(max(a, mn), make_int3(mx)); @@ -62,22 +47,22 @@ ccl_device_inline int3 clamp(const int3 &a, int3 &mn, int mx) # endif } -ccl_device_inline bool operator==(const int3 &a, const int3 &b) +ccl_device_inline bool operator==(const int3 a, const int3 b) { return a.x == b.x && a.y == b.y && a.z == b.z; } -ccl_device_inline bool operator!=(const int3 &a, const int3 &b) +ccl_device_inline bool operator!=(const int3 a, const int3 b) { return !(a == b); } -ccl_device_inline bool operator<(const int3 &a, const int3 &b) +ccl_device_inline bool operator<(const int3 a, const int3 b) { return a.x < b.x && a.y < b.y && a.z < b.z; } -ccl_device_inline int3 operator+(const int3 &a, const int3 &b) +ccl_device_inline int3 operator+(const int3 a, const int3 b) { # ifdef __KERNEL_SSE__ return int3(_mm_add_epi32(a.m128, b.m128)); @@ -86,7 +71,7 @@ ccl_device_inline int3 operator+(const int3 &a, const int3 &b) # endif } -ccl_device_inline int3 operator-(const int3 &a, const int3 &b) +ccl_device_inline int3 operator-(const int3 a, const int3 b) { # ifdef __KERNEL_SSE__ return int3(_mm_sub_epi32(a.m128, b.m128)); diff --git a/intern/cycles/util/math_int4.h b/intern/cycles/util/math_int4.h index fbdada223cb..c6d767d7587 100644 --- a/intern/cycles/util/math_int4.h +++ b/intern/cycles/util/math_int4.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2013 Intel Corporation * Copyright 2011-2022 Blender Foundation */ #ifndef __UTIL_MATH_INT4_H__ @@ -10,30 +11,8 @@ CCL_NAMESPACE_BEGIN -/******************************************************************************* - * Declaration. - */ - #ifndef __KERNEL_GPU__ -ccl_device_inline int4 operator+(const int4 &a, const int4 &b); -ccl_device_inline int4 operator+=(int4 &a, const int4 &b); -ccl_device_inline int4 operator>>(const int4 &a, int i); -ccl_device_inline int4 operator<<(const int4 &a, int i); -ccl_device_inline int4 operator<(const int4 &a, const int4 &b); -ccl_device_inline int4 operator>=(const int4 &a, const int4 &b); -ccl_device_inline int4 operator&(const int4 &a, const int4 &b); -ccl_device_inline int4 min(int4 a, int4 b); -ccl_device_inline int4 max(int4 a, int4 b); -ccl_device_inline int4 clamp(const int4 &a, const int4 &mn, const int4 &mx); -ccl_device_inline int4 select(const int4 &mask, const int4 &a, const int4 &b); -#endif /* __KERNEL_GPU__ */ - -/******************************************************************************* - * Definition. - */ - -#ifndef __KERNEL_GPU__ -ccl_device_inline int4 operator+(const int4 &a, const int4 &b) +ccl_device_inline int4 operator+(const int4 a, const int4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_add_epi32(a.m128, b.m128)); @@ -42,12 +21,26 @@ ccl_device_inline int4 operator+(const int4 &a, const int4 &b) # endif } -ccl_device_inline int4 operator+=(int4 &a, const int4 &b) +ccl_device_inline int4 operator+=(int4 &a, const int4 b) { return a = a + b; } -ccl_device_inline int4 operator>>(const int4 &a, int i) +ccl_device_inline int4 operator-(const int4 a, const int4 b) +{ +# ifdef __KERNEL_SSE__ + return int4(_mm_sub_epi32(a.m128, b.m128)); +# else + return make_int4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); +# endif +} + +ccl_device_inline int4 operator-=(int4 &a, const int4 b) +{ + return a = a - b; +} + +ccl_device_inline int4 operator>>(const int4 a, int i) { # ifdef __KERNEL_SSE__ return int4(_mm_srai_epi32(a.m128, i)); @@ -56,7 +49,7 @@ ccl_device_inline int4 operator>>(const int4 &a, int i) # endif } -ccl_device_inline int4 operator<<(const int4 &a, int i) +ccl_device_inline int4 operator<<(const int4 a, int i) { # ifdef __KERNEL_SSE__ return int4(_mm_slli_epi32(a.m128, i)); @@ -65,7 +58,7 @@ ccl_device_inline int4 operator<<(const int4 &a, int i) # endif } -ccl_device_inline int4 operator<(const int4 &a, const int4 &b) +ccl_device_inline int4 operator<(const int4 a, const int4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_cmplt_epi32(a.m128, b.m128)); @@ -74,7 +67,26 @@ ccl_device_inline int4 operator<(const int4 &a, const int4 &b) # endif } -ccl_device_inline int4 operator>=(const int4 &a, const int4 &b) +ccl_device_inline int4 operator<(const int4 a, const int b) +{ + return a < make_int4(b); +} + +ccl_device_inline int4 operator==(const int4 a, const int4 b) +{ +# ifdef __KERNEL_SSE__ + return int4(_mm_cmpeq_epi32(a.m128, b.m128)); +# else + return make_int4(a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w); +# endif +} + +ccl_device_inline int4 operator==(const int4 a, const int b) +{ + return a == make_int4(b); +} + +ccl_device_inline int4 operator>=(const int4 a, const int4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_xor_si128(_mm_set1_epi32(0xffffffff), _mm_cmplt_epi32(a.m128, b.m128))); @@ -83,7 +95,12 @@ ccl_device_inline int4 operator>=(const int4 &a, const int4 &b) # endif } -ccl_device_inline int4 operator&(const int4 &a, const int4 &b) +ccl_device_inline int4 operator>=(const int4 a, const int b) +{ + return a >= make_int4(b); +} + +ccl_device_inline int4 operator&(const int4 a, const int4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_and_si128(a.m128, b.m128)); @@ -92,6 +109,97 @@ ccl_device_inline int4 operator&(const int4 &a, const int4 &b) # endif } +ccl_device_inline int4 operator|(const int4 a, const int4 b) +{ +# ifdef __KERNEL_SSE__ + return int4(_mm_or_si128(a.m128, b.m128)); +# else + return make_int4(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); +# endif +} + +ccl_device_inline int4 operator^(const int4 a, const int4 b) +{ +# ifdef __KERNEL_SSE__ + return int4(_mm_xor_si128(a.m128, b.m128)); +# else + return make_int4(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); +# endif +} + +ccl_device_inline int4 operator&(const int32_t a, const int4 b) +{ + return make_int4(a) & b; +} + +ccl_device_inline int4 operator&(const int4 a, const int32_t b) +{ + return a & make_int4(b); +} + +ccl_device_inline int4 operator|(const int32_t a, const int4 b) +{ + return make_int4(a) | b; +} + +ccl_device_inline int4 operator|(const int4 a, const int32_t b) +{ + return a | make_int4(b); +} + +ccl_device_inline int4 operator^(const int32_t a, const int4 b) +{ + return make_int4(a) ^ b; +} + +ccl_device_inline int4 operator^(const int4 a, const int32_t b) +{ + return a ^ make_int4(b); +} + +ccl_device_inline int4 &operator&=(int4 &a, const int4 b) +{ + return a = a & b; +} +ccl_device_inline int4 &operator&=(int4 &a, const int32_t b) +{ + return a = a & b; +} + +ccl_device_inline int4 &operator|=(int4 &a, const int4 b) +{ + return a = a | b; +} +ccl_device_inline int4 &operator|=(int4 &a, const int32_t b) +{ + return a = a | b; +} + +ccl_device_inline int4 &operator^=(int4 &a, const int4 b) +{ + return a = a ^ b; +} +ccl_device_inline int4 &operator^=(int4 &a, const int32_t b) +{ + return a = a ^ b; +} + +ccl_device_inline int4 &operator<<=(int4 &a, const int32_t b) +{ + return a = a << b; +} +ccl_device_inline int4 &operator>>=(int4 &a, const int32_t b) +{ + return a = a >> b; +} + +# ifdef __KERNEL_SSE__ +ccl_device_forceinline const int4 srl(const int4 a, const int32_t b) +{ + return int4(_mm_srli_epi32(a.m128, b)); +} +# endif + ccl_device_inline int4 min(int4 a, int4 b) { # if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) @@ -110,12 +218,12 @@ ccl_device_inline int4 max(int4 a, int4 b) # endif } -ccl_device_inline int4 clamp(const int4 &a, const int4 &mn, const int4 &mx) +ccl_device_inline int4 clamp(const int4 a, const int4 mn, const int4 mx) { return min(max(a, mn), mx); } -ccl_device_inline int4 select(const int4 &mask, const int4 &a, const int4 &b) +ccl_device_inline int4 select(const int4 mask, const int4 a, const int4 b) { # ifdef __KERNEL_SSE__ return int4(_mm_or_si128(_mm_and_si128(mask, a), _mm_andnot_si128(mask, b))); @@ -135,6 +243,52 @@ ccl_device_inline int4 load_int4(const int *v) } #endif /* __KERNEL_GPU__ */ +ccl_device_inline float4 cast(const int4 a) +{ +#ifdef __KERNEL_SSE__ + return float4(_mm_castsi128_ps(a)); +#else + return make_float4( + __int_as_float(a.x), __int_as_float(a.y), __int_as_float(a.z), __int_as_float(a.w)); +#endif +} + +#ifdef __KERNEL_SSE__ +ccl_device_forceinline int4 andnot(const int4 a, const int4 b) +{ + return int4(_mm_andnot_si128(a.m128, b.m128)); +} + +template<size_t i0, size_t i1, size_t i2, size_t i3> +ccl_device_forceinline int4 shuffle(const int4 a) +{ +# ifdef __KERNEL_NEON__ + int32x4_t result = shuffle_neon<int32x4_t, i0, i1, i2, i3>(vreinterpretq_s32_m128i(a)); + return int4(vreinterpretq_m128i_s32(result)); +# else + return int4(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0))); +# endif +} + +template<size_t i0, size_t i1, size_t i2, size_t i3> +ccl_device_forceinline int4 shuffle(const int4 a, const int4 b) +{ +# ifdef __KERNEL_NEON__ + int32x4_t result = shuffle_neon<int32x4_t, i0, i1, i2, i3>(vreinterpretq_s32_m128i(a), + vreinterpretq_s32_m128i(b)); + return int4(vreinterpretq_m128i_s32(result)); +# else + return int4(_mm_castps_si128( + _mm_shuffle_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b), _MM_SHUFFLE(i3, i2, i1, i0)))); +# endif +} + +template<size_t i0> ccl_device_forceinline int4 shuffle(const int4 b) +{ + return shuffle<i0, i0, i0, i0>(b); +} +#endif + CCL_NAMESPACE_END #endif /* __UTIL_MATH_INT4_H__ */ diff --git a/intern/cycles/util/math_int8.h b/intern/cycles/util/math_int8.h new file mode 100644 index 00000000000..d150b0b74ec --- /dev/null +++ b/intern/cycles/util/math_int8.h @@ -0,0 +1,355 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2013 Intel Corporation + * Copyright 2011-2022 Blender Foundation */ + +#ifndef __UTIL_MATH_INT8_H__ +#define __UTIL_MATH_INT8_H__ + +#ifndef __UTIL_MATH_H__ +# error "Do not include this file directly, include util/types.h instead." +#endif + +CCL_NAMESPACE_BEGIN + +#ifndef __KERNEL_GPU__ +ccl_device_inline vint8 operator+(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_add_epi32(a.m256, b.m256)); +# else + return make_vint8( + a.a + b.a, a.b + b.b, a.c + b.c, a.d + b.d, a.e + b.e, a.f + b.f, a.g + b.g, a.h + b.h); +# endif +} + +ccl_device_inline vint8 operator+=(vint8 &a, const vint8 b) +{ + return a = a + b; +} + +ccl_device_inline vint8 operator-(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_sub_epi32(a.m256, b.m256)); +# else + return make_vint8( + a.a - b.a, a.b - b.b, a.c - b.c, a.d - b.d, a.e - b.e, a.f - b.f, a.g - b.g, a.h - b.h); +# endif +} + +ccl_device_inline vint8 operator-=(vint8 &a, const vint8 b) +{ + return a = a - b; +} + +ccl_device_inline vint8 operator>>(const vint8 a, int i) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_srai_epi32(a.m256, i)); +# else + return make_vint8( + a.a >> i, a.b >> i, a.c >> i, a.d >> i, a.e >> i, a.f >> i, a.g >> i, a.h >> i); +# endif +} + +ccl_device_inline vint8 operator<<(const vint8 a, int i) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_slli_epi32(a.m256, i)); +# else + return make_vint8( + a.a << i, a.b << i, a.c << i, a.d << i, a.e << i, a.f << i, a.g << i, a.h << i); +# endif +} + +ccl_device_inline vint8 operator<(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_cmpgt_epi32(b.m256, a.m256)); +# else + return make_vint8( + a.a < b.a, a.b < b.b, a.c < b.c, a.d < b.d, a.e < b.e, a.f < b.f, a.g < b.g, a.h < b.h); +# endif +} + +ccl_device_inline vint8 operator<(const vint8 a, const int b) +{ + return a < make_vint8(b); +} + +ccl_device_inline vint8 operator==(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_cmpeq_epi32(a.m256, b.m256)); +# else + return make_vint8(a.a == b.a, + a.b == b.b, + a.c == b.c, + a.d == b.d, + a.e == b.e, + a.f == b.f, + a.g == b.g, + a.h == b.h); +# endif +} + +ccl_device_inline vint8 operator==(const vint8 a, const int b) +{ + return a == make_vint8(b); +} + +ccl_device_inline vint8 operator>=(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8( + _mm256_xor_si256(_mm256_set1_epi32(0xffffffff), _mm256_cmpgt_epi32(b.m256, a.m256))); +# else + return make_vint8(a.a >= b.a, + a.b >= b.b, + a.c >= b.c, + a.d >= b.d, + a.e >= b.e, + a.f >= b.f, + a.g >= b.g, + a.h >= b.h); +# endif +} + +ccl_device_inline vint8 operator>=(const vint8 a, const int b) +{ + return a >= make_vint8(b); +} + +ccl_device_inline vint8 operator&(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_and_si256(a.m256, b.m256)); +# else + return make_vint8( + a.a & b.a, a.b & b.b, a.c & b.c, a.d & b.d, a.e & b.e, a.f & b.f, a.g & b.g, a.h & b.h); +# endif +} + +ccl_device_inline vint8 operator|(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_or_si256(a.m256, b.m256)); +# else + return make_vint8( + a.a | b.a, a.b | b.b, a.c | b.c, a.d | b.d, a.e | b.e, a.f | b.f, a.g | b.g, a.h | b.h); +# endif +} + +ccl_device_inline vint8 operator^(const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_xor_si256(a.m256, b.m256)); +# else + return make_vint8( + a.a ^ b.a, a.b ^ b.b, a.c ^ b.c, a.d ^ b.d, a.e ^ b.e, a.f ^ b.f, a.g ^ b.g, a.h ^ b.h); +# endif +} + +ccl_device_inline vint8 operator&(const int32_t a, const vint8 b) +{ + return make_vint8(a) & b; +} + +ccl_device_inline vint8 operator&(const vint8 a, const int32_t b) +{ + return a & make_vint8(b); +} + +ccl_device_inline vint8 operator|(const int32_t a, const vint8 b) +{ + return make_vint8(a) | b; +} + +ccl_device_inline vint8 operator|(const vint8 a, const int32_t b) +{ + return a | make_vint8(b); +} + +ccl_device_inline vint8 operator^(const int32_t a, const vint8 b) +{ + return make_vint8(a) ^ b; +} + +ccl_device_inline vint8 operator^(const vint8 a, const int32_t b) +{ + return a ^ make_vint8(b); +} + +ccl_device_inline vint8 &operator&=(vint8 &a, const vint8 b) +{ + return a = a & b; +} +ccl_device_inline vint8 &operator&=(vint8 &a, const int32_t b) +{ + return a = a & b; +} + +ccl_device_inline vint8 &operator|=(vint8 &a, const vint8 b) +{ + return a = a | b; +} +ccl_device_inline vint8 &operator|=(vint8 &a, const int32_t b) +{ + return a = a | b; +} + +ccl_device_inline vint8 &operator^=(vint8 &a, const vint8 b) +{ + return a = a ^ b; +} +ccl_device_inline vint8 &operator^=(vint8 &a, const int32_t b) +{ + return a = a ^ b; +} + +ccl_device_inline vint8 &operator<<=(vint8 &a, const int32_t b) +{ + return a = a << b; +} +ccl_device_inline vint8 &operator>>=(vint8 &a, const int32_t b) +{ + return a = a >> b; +} + +# ifdef __KERNEL_AVX__ +ccl_device_forceinline const vint8 srl(const vint8 a, const int32_t b) +{ + return vint8(_mm256_srli_epi32(a.m256, b)); +} +# endif + +ccl_device_inline vint8 min(vint8 a, vint8 b) +{ +# if defined(__KERNEL_AVX__) && defined(__KERNEL_AVX41__) + return vint8(_mm256_min_epi32(a.m256, b.m256)); +# else + return make_vint8(min(a.a, b.a), + min(a.b, b.b), + min(a.c, b.c), + min(a.d, b.d), + min(a.e, b.e), + min(a.f, b.f), + min(a.g, b.g), + min(a.h, b.h)); +# endif +} + +ccl_device_inline vint8 max(vint8 a, vint8 b) +{ +# if defined(__KERNEL_AVX__) && defined(__KERNEL_AVX41__) + return vint8(_mm256_max_epi32(a.m256, b.m256)); +# else + return make_vint8(max(a.a, b.a), + max(a.b, b.b), + max(a.c, b.c), + max(a.d, b.d), + max(a.e, b.e), + max(a.f, b.f), + max(a.g, b.g), + max(a.h, b.h)); +# endif +} + +ccl_device_inline vint8 clamp(const vint8 a, const vint8 mn, const vint8 mx) +{ + return min(max(a, mn), mx); +} + +ccl_device_inline vint8 select(const vint8 mask, const vint8 a, const vint8 b) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_castps_si256(_mm256_blendv_ps( + _mm256_castsi256_ps(b), _mm256_castsi256_ps(a), _mm256_castsi256_ps(mask)))); +# else + return make_vint8((mask.a) ? a.a : b.a, + (mask.b) ? a.b : b.b, + (mask.c) ? a.c : b.c, + (mask.d) ? a.d : b.d, + (mask.e) ? a.e : b.e, + (mask.f) ? a.f : b.f, + (mask.g) ? a.g : b.g, + (mask.h) ? a.h : b.h); +# endif +} + +ccl_device_inline vint8 load_vint8(const int *v) +{ +# ifdef __KERNEL_AVX__ + return vint8(_mm256_loadu_si256((__m256i *)v)); +# else + return make_vint8(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]); +# endif +} +#endif /* __KERNEL_GPU__ */ + +ccl_device_inline vfloat8 cast(const vint8 a) +{ +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_castsi256_ps(a)); +#else + return make_vfloat8(__int_as_float(a.a), + __int_as_float(a.b), + __int_as_float(a.c), + __int_as_float(a.d), + __int_as_float(a.e), + __int_as_float(a.f), + __int_as_float(a.g), + __int_as_float(a.h)); +#endif +} + +#ifdef __KERNEL_AVX__ +template<size_t i> ccl_device_forceinline const vint8 shuffle(const vint8 a) +{ + return vint8( + _mm256_castps_si256(_mm256_permute_ps(_mm256_castsi256_ps(a), _MM_SHUFFLE(i, i, i, i)))); +} + +template<size_t i0, size_t i1> ccl_device_forceinline const vint8 shuffle(const vint8 a) +{ + return vint8(_mm256_permute2f128_si256(a, a, (i1 << 4) | (i0 << 0))); +} + +template<size_t i0, size_t i1> +ccl_device_forceinline const vint8 shuffle(const vint8 a, const vint8 b) +{ + return vint8(_mm256_permute2f128_si256(a, b, (i1 << 4) | (i0 << 0))); +} + +template<size_t i0, size_t i1, size_t i2, size_t i3> +ccl_device_forceinline const vint8 shuffle(const vint8 a) +{ + return vint8( + _mm256_castps_si256(_mm256_permute_ps(_mm256_castsi256_ps(a), _MM_SHUFFLE(i3, i2, i1, i0)))); +} + +template<size_t i0, size_t i1, size_t i2, size_t i3> +ccl_device_forceinline const vint8 shuffle(const vint8 a, const vint8 b) +{ + return vint8(_mm256_castps_si256(_mm256_shuffle_ps( + _mm256_castsi256_ps(a), _mm256_castsi256_ps(b), _MM_SHUFFLE(i3, i2, i1, i0)))); +} + +template<> __forceinline const vint8 shuffle<0, 0, 2, 2>(const vint8 b) +{ + return vint8(_mm256_castps_si256(_mm256_moveldup_ps(_mm256_castsi256_ps(b)))); +} +template<> __forceinline const vint8 shuffle<1, 1, 3, 3>(const vint8 b) +{ + return vint8(_mm256_castps_si256(_mm256_movehdup_ps(_mm256_castsi256_ps(b)))); +} +template<> __forceinline const vint8 shuffle<0, 1, 0, 1>(const vint8 b) +{ + return vint8(_mm256_castps_si256( + _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(_mm256_castsi256_ps(b)))))); +} +#endif + +CCL_NAMESPACE_END + +#endif /* __UTIL_MATH_INT8_H__ */ diff --git a/intern/cycles/util/math_intersect.h b/intern/cycles/util/math_intersect.h index aa28682f8c1..0727debf775 100644 --- a/intern/cycles/util/math_intersect.h +++ b/intern/cycles/util/math_intersect.h @@ -133,7 +133,9 @@ ccl_device_forceinline float ray_triangle_rcp(const float x) ccl_device_inline float ray_triangle_dot(const float3 a, const float3 b) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) - return madd(ssef(a.x), ssef(b.x), madd(ssef(a.y), ssef(b.y), ssef(a.z) * ssef(b.z)))[0]; + return madd(make_float4(a.x), + make_float4(b.x), + madd(make_float4(a.y), make_float4(b.y), make_float4(a.z) * make_float4(b.z)))[0]; #else return a.x * b.x + a.y * b.y + a.z * b.z; #endif @@ -142,9 +144,10 @@ ccl_device_inline float ray_triangle_dot(const float3 a, const float3 b) ccl_device_inline float3 ray_triangle_cross(const float3 a, const float3 b) { #if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) - return make_float3(msub(ssef(a.y), ssef(b.z), ssef(a.z) * ssef(b.y))[0], - msub(ssef(a.z), ssef(b.x), ssef(a.x) * ssef(b.z))[0], - msub(ssef(a.x), ssef(b.y), ssef(a.y) * ssef(b.x))[0]); + return make_float3( + msub(make_float4(a.y), make_float4(b.z), make_float4(a.z) * make_float4(b.y))[0], + msub(make_float4(a.z), make_float4(b.x), make_float4(a.x) * make_float4(b.z))[0], + msub(make_float4(a.x), make_float4(b.y), make_float4(a.y) * make_float4(b.x))[0]); #else return make_float3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); #endif diff --git a/intern/cycles/util/md5.cpp b/intern/cycles/util/md5.cpp index 1c7e6b9bf3e..3342d7a509a 100644 --- a/intern/cycles/util/md5.cpp +++ b/intern/cycles/util/md5.cpp @@ -347,13 +347,18 @@ void MD5Hash::finish(uint8_t digest[16]) string MD5Hash::get_hex() { + constexpr char kHexDigits[] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + uint8_t digest[16]; char buf[16 * 2 + 1]; finish(digest); - for (int i = 0; i < 16; i++) - sprintf(buf + i * 2, "%02X", (unsigned int)digest[i]); + for (int i = 0; i < 16; i++) { + buf[i * 2 + 0] = kHexDigits[digest[i] / 0x10]; + buf[i * 2 + 1] = kHexDigits[digest[i] % 0x10]; + } buf[sizeof(buf) - 1] = '\0'; return string(buf); diff --git a/intern/cycles/util/sseb.h b/intern/cycles/util/sseb.h deleted file mode 100644 index 6f78299711e..00000000000 --- a/intern/cycles/util/sseb.h +++ /dev/null @@ -1,345 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2011-2013 Intel Corporation - * Modifications Copyright 2014-2022 Blender Foundation. */ - -#ifndef __UTIL_SSEB_H__ -#define __UTIL_SSEB_H__ - -CCL_NAMESPACE_BEGIN - -#ifdef __KERNEL_SSE2__ - -struct ssei; -struct ssef; - -/*! 4-wide SSE bool type. */ -struct sseb { - typedef sseb Mask; // mask type - typedef ssei Int; // int type - typedef ssef Float; // float type - - enum { size = 4 }; // number of SIMD elements - union { - __m128 m128; - int32_t v[4]; - }; // data - - //////////////////////////////////////////////////////////////////////////////// - /// Constructors, Assignment & Cast Operators - //////////////////////////////////////////////////////////////////////////////// - - __forceinline sseb() - { - } - __forceinline sseb(const sseb &other) - { - m128 = other.m128; - } - __forceinline sseb &operator=(const sseb &other) - { - m128 = other.m128; - return *this; - } - - __forceinline sseb(const __m128 input) : m128(input) - { - } - __forceinline operator const __m128 &(void) const - { - return m128; - } - __forceinline operator const __m128i(void) const - { - return _mm_castps_si128(m128); - } - __forceinline operator const __m128d(void) const - { - return _mm_castps_pd(m128); - } - - __forceinline sseb(bool a) - : m128(_mm_lookupmask_ps[(size_t(a) << 3) | (size_t(a) << 2) | (size_t(a) << 1) | size_t(a)]) - { - } - __forceinline sseb(bool a, bool b) - : m128(_mm_lookupmask_ps[(size_t(b) << 3) | (size_t(a) << 2) | (size_t(b) << 1) | size_t(a)]) - { - } - __forceinline sseb(bool a, bool b, bool c, bool d) - : m128(_mm_lookupmask_ps[(size_t(d) << 3) | (size_t(c) << 2) | (size_t(b) << 1) | size_t(a)]) - { - } - __forceinline sseb(int mask) - { - assert(mask >= 0 && mask < 16); - m128 = _mm_lookupmask_ps[mask]; - } - - //////////////////////////////////////////////////////////////////////////////// - /// Constants - //////////////////////////////////////////////////////////////////////////////// - - __forceinline sseb(FalseTy) : m128(_mm_setzero_ps()) - { - } - __forceinline sseb(TrueTy) - : m128(_mm_castsi128_ps(_mm_cmpeq_epi32(_mm_setzero_si128(), _mm_setzero_si128()))) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Array Access - //////////////////////////////////////////////////////////////////////////////// - - __forceinline bool operator[](const size_t i) const - { - assert(i < 4); - return (_mm_movemask_ps(m128) >> i) & 1; - } - __forceinline int32_t &operator[](const size_t i) - { - assert(i < 4); - return v[i]; - } -}; - -//////////////////////////////////////////////////////////////////////////////// -/// Unary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb operator!(const sseb &a) -{ - return _mm_xor_ps(a, sseb(True)); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Binary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb operator&(const sseb &a, const sseb &b) -{ - return _mm_and_ps(a, b); -} -__forceinline const sseb operator|(const sseb &a, const sseb &b) -{ - return _mm_or_ps(a, b); -} -__forceinline const sseb operator^(const sseb &a, const sseb &b) -{ - return _mm_xor_ps(a, b); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Assignment Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb operator&=(sseb &a, const sseb &b) -{ - return a = a & b; -} -__forceinline const sseb operator|=(sseb &a, const sseb &b) -{ - return a = a | b; -} -__forceinline const sseb operator^=(sseb &a, const sseb &b) -{ - return a = a ^ b; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Comparison Operators + Select -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb operator!=(const sseb &a, const sseb &b) -{ - return _mm_xor_ps(a, b); -} -__forceinline const sseb operator==(const sseb &a, const sseb &b) -{ - return _mm_castsi128_ps(_mm_cmpeq_epi32(a, b)); -} - -__forceinline const sseb select(const sseb &m, const sseb &t, const sseb &f) -{ -# if defined(__KERNEL_SSE41__) - return _mm_blendv_ps(f, t, m); -# else - return _mm_or_ps(_mm_and_ps(m, t), _mm_andnot_ps(m, f)); -# endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Movement/Shifting/Shuffling Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb unpacklo(const sseb &a, const sseb &b) -{ - return _mm_unpacklo_ps(a, b); -} -__forceinline const sseb unpackhi(const sseb &a, const sseb &b) -{ - return _mm_unpackhi_ps(a, b); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const sseb shuffle(const sseb &a) -{ -# ifdef __KERNEL_NEON__ - return shuffle_neon<int32x4_t, i0, i1, i2, i3>(a); -# else - return _mm_castsi128_ps(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0))); -# endif -} - -# ifndef __KERNEL_NEON__ -template<> __forceinline const sseb shuffle<0, 1, 0, 1>(const sseb &a) -{ - return _mm_movelh_ps(a, a); -} - -template<> __forceinline const sseb shuffle<2, 3, 2, 3>(const sseb &a) -{ - return _mm_movehl_ps(a, a); -} -# endif - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const sseb shuffle(const sseb &a, const sseb &b) -{ -# ifdef __KERNEL_NEON__ - return shuffle_neon<int32x4_t, i0, i1, i2, i3>(a, b); -# else - return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); -# endif -} - -# ifndef __KERNEL_NEON__ -template<> __forceinline const sseb shuffle<0, 1, 0, 1>(const sseb &a, const sseb &b) -{ - return _mm_movelh_ps(a, b); -} - -template<> __forceinline const sseb shuffle<2, 3, 2, 3>(const sseb &a, const sseb &b) -{ - return _mm_movehl_ps(b, a); -} -# endif - -# if defined(__KERNEL_SSE3__) && !defined(__KERNEL_NEON__) -template<> __forceinline const sseb shuffle<0, 0, 2, 2>(const sseb &a) -{ - return _mm_moveldup_ps(a); -} -template<> __forceinline const sseb shuffle<1, 1, 3, 3>(const sseb &a) -{ - return _mm_movehdup_ps(a); -} -# endif - -# if defined(__KERNEL_SSE41__) -template<size_t dst, size_t src, size_t clr> -__forceinline const sseb insert(const sseb &a, const sseb &b) -{ -# ifdef __KERNEL_NEON__ - sseb res = a; - if (clr) - res[dst] = 0; - else - res[dst] = b[src]; - return res; -# else - return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); -# endif -} -template<size_t dst, size_t src> __forceinline const sseb insert(const sseb &a, const sseb &b) -{ - return insert<dst, src, 0>(a, b); -} -template<size_t dst> __forceinline const sseb insert(const sseb &a, const bool b) -{ - return insert<dst, 0>(a, sseb(b)); -} -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Reduction Operations -//////////////////////////////////////////////////////////////////////////////// - -# if defined(__KERNEL_SSE41__) -__forceinline uint32_t popcnt(const sseb &a) -{ -# if defined(__KERNEL_NEON__) - const int32x4_t mask = {1, 1, 1, 1}; - int32x4_t t = vandq_s32(vreinterpretq_s32_m128(a.m128), mask); - return vaddvq_s32(t); -# else - return _mm_popcnt_u32(_mm_movemask_ps(a)); -# endif -} -# else -__forceinline uint32_t popcnt(const sseb &a) -{ - return bool(a[0]) + bool(a[1]) + bool(a[2]) + bool(a[3]); -} -# endif - -__forceinline bool reduce_and(const sseb &a) -{ -# if defined(__KERNEL_NEON__) - return vaddvq_s32(vreinterpretq_s32_m128(a.m128)) == -4; -# else - return _mm_movemask_ps(a) == 0xf; -# endif -} -__forceinline bool reduce_or(const sseb &a) -{ -# if defined(__KERNEL_NEON__) - return vaddvq_s32(vreinterpretq_s32_m128(a.m128)) != 0x0; -# else - return _mm_movemask_ps(a) != 0x0; -# endif -} -__forceinline bool all(const sseb &b) -{ -# if defined(__KERNEL_NEON__) - return vaddvq_s32(vreinterpretq_s32_m128(b.m128)) == -4; -# else - return _mm_movemask_ps(b) == 0xf; -# endif -} -__forceinline bool any(const sseb &b) -{ -# if defined(__KERNEL_NEON__) - return vaddvq_s32(vreinterpretq_s32_m128(b.m128)) != 0x0; -# else - return _mm_movemask_ps(b) != 0x0; -# endif -} -__forceinline bool none(const sseb &b) -{ -# if defined(__KERNEL_NEON__) - return vaddvq_s32(vreinterpretq_s32_m128(b.m128)) == 0x0; -# else - return _mm_movemask_ps(b) == 0x0; -# endif -} - -__forceinline uint32_t movemask(const sseb &a) -{ - return _mm_movemask_ps(a); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Debug Functions -//////////////////////////////////////////////////////////////////////////////// - -ccl_device_inline void print_sseb(const char *label, const sseb &a) -{ - printf("%s: %d %d %d %d\n", label, a[0], a[1], a[2], a[3]); -} - -#endif - -CCL_NAMESPACE_END - -#endif diff --git a/intern/cycles/util/ssef.h b/intern/cycles/util/ssef.h deleted file mode 100644 index 1e2bfa90354..00000000000 --- a/intern/cycles/util/ssef.h +++ /dev/null @@ -1,1090 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2011-2013 Intel Corporation - * Modifications Copyright 2014-2022 Blender Foundation. */ - -#ifndef __UTIL_SSEF_H__ -#define __UTIL_SSEF_H__ - -#include <math.h> - -#include "util/ssei.h" - -CCL_NAMESPACE_BEGIN - -#ifdef __KERNEL_SSE2__ - -struct sseb; -struct ssef; - -/*! 4-wide SSE float type. */ -struct ssef { - typedef sseb Mask; // mask type - typedef ssei Int; // int type - typedef ssef Float; // float type - - enum { size = 4 }; // number of SIMD elements - union { - __m128 m128; - float f[4]; - int i[4]; - }; // data - - //////////////////////////////////////////////////////////////////////////////// - /// Constructors, Assignment & Cast Operators - //////////////////////////////////////////////////////////////////////////////// - - __forceinline ssef() - { - } - __forceinline ssef(const ssef &other) - { - m128 = other.m128; - } - __forceinline ssef &operator=(const ssef &other) - { - m128 = other.m128; - return *this; - } - - __forceinline ssef(const __m128 a) : m128(a) - { - } - __forceinline operator const __m128 &() const - { - return m128; - } - __forceinline operator __m128 &() - { - return m128; - } - - __forceinline ssef(float a) : m128(_mm_set1_ps(a)) - { - } - __forceinline ssef(float a, float b, float c, float d) : m128(_mm_setr_ps(a, b, c, d)) - { - } - - __forceinline explicit ssef(const __m128i a) : m128(_mm_cvtepi32_ps(a)) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Loads and Stores - //////////////////////////////////////////////////////////////////////////////// - -# if defined(__KERNEL_AVX__) - static __forceinline ssef broadcast(const void *const a) - { - return _mm_broadcast_ss((float *)a); - } -# else - static __forceinline ssef broadcast(const void *const a) - { - return _mm_set1_ps(*(float *)a); - } -# endif - - //////////////////////////////////////////////////////////////////////////////// - /// Array Access - //////////////////////////////////////////////////////////////////////////////// - - __forceinline const float &operator[](const size_t i) const - { - assert(i < 4); - return f[i]; - } - __forceinline float &operator[](const size_t i) - { - assert(i < 4); - return f[i]; - } -}; - -//////////////////////////////////////////////////////////////////////////////// -/// Unary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const ssef cast(const __m128i &a) -{ - return _mm_castsi128_ps(a); -} -__forceinline const ssef operator+(const ssef &a) -{ - return a; -} -__forceinline const ssef operator-(const ssef &a) -{ - return _mm_xor_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); -} -__forceinline const ssef abs(const ssef &a) -{ - return _mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))); -} -# if defined(__KERNEL_SSE41__) -__forceinline const ssef sign(const ssef &a) -{ - return _mm_blendv_ps(ssef(1.0f), -ssef(1.0f), _mm_cmplt_ps(a, ssef(0.0f))); -} -# endif -__forceinline const ssef signmsk(const ssef &a) -{ - return _mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x80000000))); -} - -__forceinline const ssef rcp(const ssef &a) -{ - const ssef r = _mm_rcp_ps(a.m128); - return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a)); -} -__forceinline const ssef sqr(const ssef &a) -{ - return _mm_mul_ps(a, a); -} -__forceinline const ssef mm_sqrt(const ssef &a) -{ - return _mm_sqrt_ps(a.m128); -} -__forceinline const ssef rsqrt(const ssef &a) -{ - const ssef r = _mm_rsqrt_ps(a.m128); - return _mm_add_ps( - _mm_mul_ps(_mm_set_ps(1.5f, 1.5f, 1.5f, 1.5f), r), - _mm_mul_ps(_mm_mul_ps(_mm_mul_ps(a, _mm_set_ps(-0.5f, -0.5f, -0.5f, -0.5f)), r), - _mm_mul_ps(r, r))); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Binary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const ssef operator+(const ssef &a, const ssef &b) -{ - return _mm_add_ps(a.m128, b.m128); -} -__forceinline const ssef operator+(const ssef &a, const float &b) -{ - return a + ssef(b); -} -__forceinline const ssef operator+(const float &a, const ssef &b) -{ - return ssef(a) + b; -} - -__forceinline const ssef operator-(const ssef &a, const ssef &b) -{ - return _mm_sub_ps(a.m128, b.m128); -} -__forceinline const ssef operator-(const ssef &a, const float &b) -{ - return a - ssef(b); -} -__forceinline const ssef operator-(const float &a, const ssef &b) -{ - return ssef(a) - b; -} - -__forceinline const ssef operator*(const ssef &a, const ssef &b) -{ - return _mm_mul_ps(a.m128, b.m128); -} -__forceinline const ssef operator*(const ssef &a, const float &b) -{ - return a * ssef(b); -} -__forceinline const ssef operator*(const float &a, const ssef &b) -{ - return ssef(a) * b; -} - -__forceinline const ssef operator/(const ssef &a, const ssef &b) -{ - return _mm_div_ps(a.m128, b.m128); -} -__forceinline const ssef operator/(const ssef &a, const float &b) -{ - return a / ssef(b); -} -__forceinline const ssef operator/(const float &a, const ssef &b) -{ - return ssef(a) / b; -} - -__forceinline const ssef operator^(const ssef &a, const ssef &b) -{ - return _mm_xor_ps(a.m128, b.m128); -} -__forceinline const ssef operator^(const ssef &a, const ssei &b) -{ - return _mm_xor_ps(a.m128, _mm_castsi128_ps(b.m128)); -} - -__forceinline const ssef operator&(const ssef &a, const ssef &b) -{ - return _mm_and_ps(a.m128, b.m128); -} -__forceinline const ssef operator&(const ssef &a, const ssei &b) -{ - return _mm_and_ps(a.m128, _mm_castsi128_ps(b.m128)); -} - -__forceinline const ssef operator|(const ssef &a, const ssef &b) -{ - return _mm_or_ps(a.m128, b.m128); -} -__forceinline const ssef operator|(const ssef &a, const ssei &b) -{ - return _mm_or_ps(a.m128, _mm_castsi128_ps(b.m128)); -} - -__forceinline const ssef andnot(const ssef &a, const ssef &b) -{ - return _mm_andnot_ps(a.m128, b.m128); -} - -__forceinline const ssef min(const ssef &a, const ssef &b) -{ - return _mm_min_ps(a.m128, b.m128); -} -__forceinline const ssef min(const ssef &a, const float &b) -{ - return _mm_min_ps(a.m128, ssef(b)); -} -__forceinline const ssef min(const float &a, const ssef &b) -{ - return _mm_min_ps(ssef(a), b.m128); -} - -__forceinline const ssef max(const ssef &a, const ssef &b) -{ - return _mm_max_ps(a.m128, b.m128); -} -__forceinline const ssef max(const ssef &a, const float &b) -{ - return _mm_max_ps(a.m128, ssef(b)); -} -__forceinline const ssef max(const float &a, const ssef &b) -{ - return _mm_max_ps(ssef(a), b.m128); -} - -# if defined(__KERNEL_SSE41__) -__forceinline ssef mini(const ssef &a, const ssef &b) -{ - const ssei ai = _mm_castps_si128(a); - const ssei bi = _mm_castps_si128(b); - const ssei ci = _mm_min_epi32(ai, bi); - return _mm_castsi128_ps(ci); -} -# endif - -# if defined(__KERNEL_SSE41__) -__forceinline ssef maxi(const ssef &a, const ssef &b) -{ - const ssei ai = _mm_castps_si128(a); - const ssei bi = _mm_castps_si128(b); - const ssei ci = _mm_max_epi32(ai, bi); - return _mm_castsi128_ps(ci); -} -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Ternary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const ssef madd(const ssef &a, const ssef &b, const ssef &c) -{ -# if defined(__KERNEL_NEON__) - return vfmaq_f32(c, a, b); -# elif defined(__KERNEL_AVX2__) - return _mm_fmadd_ps(a, b, c); -# else - return a * b + c; -# endif -} -__forceinline const ssef msub(const ssef &a, const ssef &b, const ssef &c) -{ -# if defined(__KERNEL_NEON__) - return vfmaq_f32(vnegq_f32(c), a, b); -# elif defined(__KERNEL_AVX2__) - return _mm_fmsub_ps(a, b, c); -# else - return a * b - c; -# endif -} -__forceinline const ssef nmadd(const ssef &a, const ssef &b, const ssef &c) -{ -# if defined(__KERNEL_NEON__) - return vfmsq_f32(c, a, b); -# elif defined(__KERNEL_AVX2__) - return _mm_fnmadd_ps(a, b, c); -# else - return c - a * b; -# endif -} -__forceinline const ssef nmsub(const ssef &a, const ssef &b, const ssef &c) -{ -# if defined(__KERNEL_NEON__) - return vfmsq_f32(vnegq_f32(c), a, b); -# elif defined(__KERNEL_AVX2__) - return _mm_fnmsub_ps(a, b, c); -# else - return -a * b - c; -# endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Assignment Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssef &operator+=(ssef &a, const ssef &b) -{ - return a = a + b; -} -__forceinline ssef &operator+=(ssef &a, const float &b) -{ - return a = a + b; -} - -__forceinline ssef &operator-=(ssef &a, const ssef &b) -{ - return a = a - b; -} -__forceinline ssef &operator-=(ssef &a, const float &b) -{ - return a = a - b; -} - -__forceinline ssef &operator*=(ssef &a, const ssef &b) -{ - return a = a * b; -} -__forceinline ssef &operator*=(ssef &a, const float &b) -{ - return a = a * b; -} - -__forceinline ssef &operator/=(ssef &a, const ssef &b) -{ - return a = a / b; -} -__forceinline ssef &operator/=(ssef &a, const float &b) -{ - return a = a / b; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Comparison Operators + Select -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb operator==(const ssef &a, const ssef &b) -{ - return _mm_cmpeq_ps(a.m128, b.m128); -} -__forceinline const sseb operator==(const ssef &a, const float &b) -{ - return a == ssef(b); -} -__forceinline const sseb operator==(const float &a, const ssef &b) -{ - return ssef(a) == b; -} - -__forceinline const sseb operator!=(const ssef &a, const ssef &b) -{ - return _mm_cmpneq_ps(a.m128, b.m128); -} -__forceinline const sseb operator!=(const ssef &a, const float &b) -{ - return a != ssef(b); -} -__forceinline const sseb operator!=(const float &a, const ssef &b) -{ - return ssef(a) != b; -} - -__forceinline const sseb operator<(const ssef &a, const ssef &b) -{ - return _mm_cmplt_ps(a.m128, b.m128); -} -__forceinline const sseb operator<(const ssef &a, const float &b) -{ - return a < ssef(b); -} -__forceinline const sseb operator<(const float &a, const ssef &b) -{ - return ssef(a) < b; -} - -__forceinline const sseb operator>=(const ssef &a, const ssef &b) -{ - return _mm_cmpnlt_ps(a.m128, b.m128); -} -__forceinline const sseb operator>=(const ssef &a, const float &b) -{ - return a >= ssef(b); -} -__forceinline const sseb operator>=(const float &a, const ssef &b) -{ - return ssef(a) >= b; -} - -__forceinline const sseb operator>(const ssef &a, const ssef &b) -{ - return _mm_cmpnle_ps(a.m128, b.m128); -} -__forceinline const sseb operator>(const ssef &a, const float &b) -{ - return a > ssef(b); -} -__forceinline const sseb operator>(const float &a, const ssef &b) -{ - return ssef(a) > b; -} - -__forceinline const sseb operator<=(const ssef &a, const ssef &b) -{ - return _mm_cmple_ps(a.m128, b.m128); -} -__forceinline const sseb operator<=(const ssef &a, const float &b) -{ - return a <= ssef(b); -} -__forceinline const sseb operator<=(const float &a, const ssef &b) -{ - return ssef(a) <= b; -} - -__forceinline const ssef select(const sseb &m, const ssef &t, const ssef &f) -{ -# ifdef __KERNEL_SSE41__ - return _mm_blendv_ps(f, t, m); -# else - return _mm_or_ps(_mm_and_ps(m, t), _mm_andnot_ps(m, f)); -# endif -} - -__forceinline const ssef select(const ssef &m, const ssef &t, const ssef &f) -{ -# ifdef __KERNEL_SSE41__ - return _mm_blendv_ps(f, t, m); -# else - return _mm_or_ps(_mm_and_ps(m, t), _mm_andnot_ps(m, f)); -# endif -} - -__forceinline const ssef select(const int mask, const ssef &t, const ssef &f) -{ -# if defined(__KERNEL_SSE41__) && \ - ((!defined(__clang__) && !defined(_MSC_VER)) || defined(__INTEL_COMPILER)) - return _mm_blend_ps(f, t, mask); -# else - return select(sseb(mask), t, f); -# endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Rounding Functions -//////////////////////////////////////////////////////////////////////////////// - -# if defined(__KERNEL_SSE41__) -__forceinline const ssef round_even(const ssef &a) -{ -# ifdef __KERNEL_NEON__ - return vrndnq_f32(a); -# else - return _mm_round_ps(a, _MM_FROUND_TO_NEAREST_INT); -# endif -} -__forceinline const ssef round_down(const ssef &a) -{ -# ifdef __KERNEL_NEON__ - return vrndmq_f32(a); -# else - return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF); -# endif -} -__forceinline const ssef round_up(const ssef &a) -{ -# ifdef __KERNEL_NEON__ - return vrndpq_f32(a); -# else - return _mm_round_ps(a, _MM_FROUND_TO_POS_INF); -# endif -} -__forceinline const ssef round_zero(const ssef &a) -{ -# ifdef __KERNEL_NEON__ - return vrndq_f32(a); -# else - return _mm_round_ps(a, _MM_FROUND_TO_ZERO); -# endif -} -__forceinline const ssef floor(const ssef &a) -{ -# ifdef __KERNEL_NEON__ - return vrndmq_f32(a); -# else - return _mm_round_ps(a, _MM_FROUND_TO_NEG_INF); -# endif -} -__forceinline const ssef ceil(const ssef &a) -{ -# ifdef __KERNEL_NEON__ - return vrndpq_f32(a); -# else - return _mm_round_ps(a, _MM_FROUND_TO_POS_INF); -# endif -} -# else -/* Non-SSE4.1 fallback, needed for floorfrac. */ -__forceinline const ssef floor(const ssef &a) -{ - return _mm_set_ps(floorf(a.f[3]), floorf(a.f[2]), floorf(a.f[1]), floorf(a.f[0])); -} -# endif - -__forceinline ssei truncatei(const ssef &a) -{ - return _mm_cvttps_epi32(a.m128); -} - -__forceinline ssef floorfrac(const ssef &x, ssei *i) -{ - ssef f = floor(x); - *i = truncatei(f); - return x - f; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Common Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssef mix(const ssef &a, const ssef &b, const ssef &t) -{ - return madd(t, b, (ssef(1.0f) - t) * a); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Movement/Shifting/Shuffling Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssef unpacklo(const ssef &a, const ssef &b) -{ - return _mm_unpacklo_ps(a.m128, b.m128); -} -__forceinline ssef unpackhi(const ssef &a, const ssef &b) -{ - return _mm_unpackhi_ps(a.m128, b.m128); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const ssef shuffle(const ssef &b) -{ -# ifdef __KERNEL_NEON__ - return shuffle_neon<float32x4_t, i0, i1, i2, i3>(b.m128); -# else - return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(i3, i2, i1, i0))); -# endif -} - -template<> __forceinline const ssef shuffle<0, 1, 0, 1>(const ssef &a) -{ - return _mm_movelh_ps(a, a); -} - -template<> __forceinline const ssef shuffle<2, 3, 2, 3>(const ssef &a) -{ - return _mm_movehl_ps(a, a); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const ssef shuffle(const ssef &a, const ssef &b) -{ -# ifdef __KERNEL_NEON__ - return shuffle_neon<float32x4_t, i0, i1, i2, i3>(a, b); -# else - return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i3, i2, i1, i0)); -# endif -} - -template<size_t i0> __forceinline const ssef shuffle(const ssef &a, const ssef &b) -{ -# ifdef __KERNEL_NEON__ - return shuffle_neon<float32x4_t, i0, i0, i0, i0>(a, b); -# else - return _mm_shuffle_ps(a, b, _MM_SHUFFLE(i0, i0, i0, i0)); -# endif -} - -# ifndef __KERNEL_NEON__ -template<> __forceinline const ssef shuffle<0, 1, 0, 1>(const ssef &a, const ssef &b) -{ - return _mm_movelh_ps(a, b); -} - -template<> __forceinline const ssef shuffle<2, 3, 2, 3>(const ssef &a, const ssef &b) -{ - return _mm_movehl_ps(b, a); -} -# endif - -# if defined(__KERNEL_SSSE3__) -__forceinline const ssef shuffle8(const ssef &a, const ssei &shuf) -{ - return _mm_castsi128_ps(_mm_shuffle_epi8(_mm_castps_si128(a), shuf)); -} -# endif - -# if defined(__KERNEL_SSE3__) -template<> __forceinline const ssef shuffle<0, 0, 2, 2>(const ssef &b) -{ - return _mm_moveldup_ps(b); -} -template<> __forceinline const ssef shuffle<1, 1, 3, 3>(const ssef &b) -{ - return _mm_movehdup_ps(b); -} -# endif - -template<size_t i0> __forceinline const ssef shuffle(const ssef &b) -{ - return shuffle<i0, i0, i0, i0>(b); -} - -# if defined(__KERNEL_AVX__) -__forceinline const ssef shuffle(const ssef &a, const ssei &shuf) -{ - return _mm_permutevar_ps(a, shuf); -} -# endif - -template<size_t i> __forceinline float extract(const ssef &a) -{ - return _mm_cvtss_f32(shuffle<i, i, i, i>(a)); -} -template<> __forceinline float extract<0>(const ssef &a) -{ - return _mm_cvtss_f32(a); -} - -# if defined(__KERNEL_SSE41__) -template<size_t dst, size_t src, size_t clr> -__forceinline const ssef insert(const ssef &a, const ssef &b) -{ -# ifdef __KERNEL_NEON__ - ssef res = a; - if (clr) - res[dst] = 0; - else - res[dst] = b[src]; - return res; -# else - return _mm_insert_ps(a, b, (dst << 4) | (src << 6) | clr); -# endif -} -template<size_t dst, size_t src> __forceinline const ssef insert(const ssef &a, const ssef &b) -{ - return insert<dst, src, 0>(a, b); -} -template<size_t dst> __forceinline const ssef insert(const ssef &a, const float b) -{ - return insert<dst, 0>(a, _mm_set_ss(b)); -} -# else -template<size_t dst> __forceinline const ssef insert(const ssef &a, const float b) -{ - ssef c = a; - c[dst] = b; - return c; -} -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Transpose -//////////////////////////////////////////////////////////////////////////////// - -__forceinline void transpose(const ssef &r0, - const ssef &r1, - const ssef &r2, - const ssef &r3, - ssef &c0, - ssef &c1, - ssef &c2, - ssef &c3) -{ - ssef l02 = unpacklo(r0, r2); - ssef h02 = unpackhi(r0, r2); - ssef l13 = unpacklo(r1, r3); - ssef h13 = unpackhi(r1, r3); - c0 = unpacklo(l02, l13); - c1 = unpackhi(l02, l13); - c2 = unpacklo(h02, h13); - c3 = unpackhi(h02, h13); -} - -__forceinline void transpose( - const ssef &r0, const ssef &r1, const ssef &r2, const ssef &r3, ssef &c0, ssef &c1, ssef &c2) -{ - ssef l02 = unpacklo(r0, r2); - ssef h02 = unpackhi(r0, r2); - ssef l13 = unpacklo(r1, r3); - ssef h13 = unpackhi(r1, r3); - c0 = unpacklo(l02, l13); - c1 = unpackhi(l02, l13); - c2 = unpacklo(h02, h13); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Reductions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const ssef vreduce_min(const ssef &v) -{ -# ifdef __KERNEL_NEON__ - return vdupq_n_f32(vminvq_f32(v)); -# else - ssef h = min(shuffle<1, 0, 3, 2>(v), v); - return min(shuffle<2, 3, 0, 1>(h), h); -# endif -} -__forceinline const ssef vreduce_max(const ssef &v) -{ -# ifdef __KERNEL_NEON__ - return vdupq_n_f32(vmaxvq_f32(v)); -# else - ssef h = max(shuffle<1, 0, 3, 2>(v), v); - return max(shuffle<2, 3, 0, 1>(h), h); -# endif -} -__forceinline const ssef vreduce_add(const ssef &v) -{ -# ifdef __KERNEL_NEON__ - return vdupq_n_f32(vaddvq_f32(v)); -# else - ssef h = shuffle<1, 0, 3, 2>(v) + v; - return shuffle<2, 3, 0, 1>(h) + h; -# endif -} - -__forceinline float reduce_min(const ssef &v) -{ -# ifdef __KERNEL_NEON__ - return vminvq_f32(v); -# else - return _mm_cvtss_f32(vreduce_min(v)); -# endif -} -__forceinline float reduce_max(const ssef &v) -{ -# ifdef __KERNEL_NEON__ - return vmaxvq_f32(v); -# else - return _mm_cvtss_f32(vreduce_max(v)); -# endif -} -__forceinline float reduce_add(const ssef &v) -{ -# ifdef __KERNEL_NEON__ - return vaddvq_f32(v); -# else - return _mm_cvtss_f32(vreduce_add(v)); -# endif -} - -__forceinline uint32_t select_min(const ssef &v) -{ - return __bsf(movemask(v == vreduce_min(v))); -} -__forceinline uint32_t select_max(const ssef &v) -{ - return __bsf(movemask(v == vreduce_max(v))); -} - -__forceinline uint32_t select_min(const sseb &valid, const ssef &v) -{ - const ssef a = select(valid, v, ssef(pos_inf)); - return __bsf(movemask(valid & (a == vreduce_min(a)))); -} -__forceinline uint32_t select_max(const sseb &valid, const ssef &v) -{ - const ssef a = select(valid, v, ssef(neg_inf)); - return __bsf(movemask(valid & (a == vreduce_max(a)))); -} - -__forceinline uint32_t movemask(const ssef &a) -{ - return _mm_movemask_ps(a); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Memory load and store operations -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssef load4f(const float4 &a) -{ -# ifdef __KERNEL_WITH_SSE_ALIGN__ - return _mm_load_ps(&a.x); -# else - return _mm_loadu_ps(&a.x); -# endif -} - -__forceinline ssef load4f(const float3 &a) -{ -# ifdef __KERNEL_WITH_SSE_ALIGN__ - return _mm_load_ps(&a.x); -# else - return _mm_loadu_ps(&a.x); -# endif -} - -__forceinline ssef load4f(const void *const a) -{ - return _mm_load_ps((float *)a); -} - -__forceinline ssef load1f_first(const float a) -{ - return _mm_set_ss(a); -} - -__forceinline void store4f(void *ptr, const ssef &v) -{ - _mm_store_ps((float *)ptr, v); -} - -__forceinline ssef loadu4f(const void *const a) -{ - return _mm_loadu_ps((float *)a); -} - -__forceinline void storeu4f(void *ptr, const ssef &v) -{ - _mm_storeu_ps((float *)ptr, v); -} - -__forceinline void store4f(const sseb &mask, void *ptr, const ssef &f) -{ -# if defined(__KERNEL_AVX__) - _mm_maskstore_ps((float *)ptr, (__m128i)mask, f); -# else - *(ssef *)ptr = select(mask, f, *(ssef *)ptr); -# endif -} - -__forceinline ssef load4f_nt(void *ptr) -{ -# if defined(__KERNEL_SSE41__) - return _mm_castsi128_ps(_mm_stream_load_si128((__m128i *)ptr)); -# else - return _mm_load_ps((float *)ptr); -# endif -} - -__forceinline void store4f_nt(void *ptr, const ssef &v) -{ -# if defined(__KERNEL_SSE41__) - _mm_stream_ps((float *)ptr, v); -# else - _mm_store_ps((float *)ptr, v); -# endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Euclidean Space Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline float dot(const ssef &a, const ssef &b) -{ - return reduce_add(a * b); -} - -/* calculate shuffled cross product, useful when order of components does not matter */ -__forceinline ssef cross_zxy(const ssef &a, const ssef &b) -{ - const ssef a0 = a; - const ssef b0 = shuffle<1, 2, 0, 3>(b); - const ssef a1 = shuffle<1, 2, 0, 3>(a); - const ssef b1 = b; - return msub(a0, b0, a1 * b1); -} - -__forceinline ssef cross(const ssef &a, const ssef &b) -{ - return shuffle<1, 2, 0, 3>(cross_zxy(a, b)); -} - -ccl_device_inline const ssef dot3_splat(const ssef &a, const ssef &b) -{ -# ifdef __KERNEL_SSE41__ - return _mm_dp_ps(a.m128, b.m128, 0x7f); -# else - ssef t = a * b; - return ssef(((float *)&t)[0] + ((float *)&t)[1] + ((float *)&t)[2]); -# endif -} - -/* squared length taking only specified axes into account */ -template<size_t X, size_t Y, size_t Z, size_t W> ccl_device_inline float len_squared(const ssef &a) -{ -# ifndef __KERNEL_SSE41__ - float4 &t = (float4 &)a; - return (X ? t.x * t.x : 0.0f) + (Y ? t.y * t.y : 0.0f) + (Z ? t.z * t.z : 0.0f) + - (W ? t.w * t.w : 0.0f); -# else - return extract<0>( - ssef(_mm_dp_ps(a.m128, a.m128, (X << 4) | (Y << 5) | (Z << 6) | (W << 7) | 0xf))); -# endif -} - -ccl_device_inline float dot3(const ssef &a, const ssef &b) -{ -# ifdef __KERNEL_SSE41__ - return extract<0>(ssef(_mm_dp_ps(a.m128, b.m128, 0x7f))); -# else - ssef t = a * b; - return ((float *)&t)[0] + ((float *)&t)[1] + ((float *)&t)[2]; -# endif -} - -ccl_device_inline const ssef len3_squared_splat(const ssef &a) -{ - return dot3_splat(a, a); -} - -ccl_device_inline float len3_squared(const ssef &a) -{ - return dot3(a, a); -} - -ccl_device_inline float len3(const ssef &a) -{ - return extract<0>(mm_sqrt(dot3_splat(a, a))); -} - -/* SSE shuffle utility functions */ - -# ifdef __KERNEL_SSSE3__ - -/* faster version for SSSE3 */ -typedef ssei shuffle_swap_t; - -ccl_device_inline shuffle_swap_t shuffle_swap_identity() -{ - return _mm_set_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); -} - -ccl_device_inline shuffle_swap_t shuffle_swap_swap() -{ - return _mm_set_epi8(7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8); -} - -ccl_device_inline const ssef shuffle_swap(const ssef &a, const shuffle_swap_t &shuf) -{ - return cast(_mm_shuffle_epi8(cast(a), shuf)); -} - -# else - -/* somewhat slower version for SSE2 */ -typedef int shuffle_swap_t; - -ccl_device_inline shuffle_swap_t shuffle_swap_identity() -{ - return 0; -} - -ccl_device_inline shuffle_swap_t shuffle_swap_swap() -{ - return 1; -} - -ccl_device_inline const ssef shuffle_swap(const ssef &a, shuffle_swap_t shuf) -{ - /* shuffle value must be a constant, so we need to branch */ - if (shuf) - return shuffle<1, 0, 3, 2>(a); - else - return shuffle<3, 2, 1, 0>(a); -} - -# endif - -# if defined(__KERNEL_SSE41__) && !defined(__KERNEL_NEON__) - -ccl_device_inline void gen_idirsplat_swap(const ssef &pn, - const shuffle_swap_t &shuf_identity, - const shuffle_swap_t &shuf_swap, - const float3 &idir, - ssef idirsplat[3], - shuffle_swap_t shufflexyz[3]) -{ - const __m128 idirsplat_raw[] = {_mm_set_ps1(idir.x), _mm_set_ps1(idir.y), _mm_set_ps1(idir.z)}; - idirsplat[0] = _mm_xor_ps(idirsplat_raw[0], pn); - idirsplat[1] = _mm_xor_ps(idirsplat_raw[1], pn); - idirsplat[2] = _mm_xor_ps(idirsplat_raw[2], pn); - - const ssef signmask = cast(ssei(0x80000000)); - const ssef shuf_identity_f = cast(shuf_identity); - const ssef shuf_swap_f = cast(shuf_swap); - - shufflexyz[0] = _mm_castps_si128( - _mm_blendv_ps(shuf_identity_f, shuf_swap_f, _mm_and_ps(idirsplat_raw[0], signmask))); - shufflexyz[1] = _mm_castps_si128( - _mm_blendv_ps(shuf_identity_f, shuf_swap_f, _mm_and_ps(idirsplat_raw[1], signmask))); - shufflexyz[2] = _mm_castps_si128( - _mm_blendv_ps(shuf_identity_f, shuf_swap_f, _mm_and_ps(idirsplat_raw[2], signmask))); -} - -# else - -ccl_device_inline void gen_idirsplat_swap(const ssef &pn, - const shuffle_swap_t &shuf_identity, - const shuffle_swap_t &shuf_swap, - const float3 &idir, - ssef idirsplat[3], - shuffle_swap_t shufflexyz[3]) -{ - idirsplat[0] = ssef(idir.x) ^ pn; - idirsplat[1] = ssef(idir.y) ^ pn; - idirsplat[2] = ssef(idir.z) ^ pn; - - shufflexyz[0] = (idir.x >= 0) ? shuf_identity : shuf_swap; - shufflexyz[1] = (idir.y >= 0) ? shuf_identity : shuf_swap; - shufflexyz[2] = (idir.z >= 0) ? shuf_identity : shuf_swap; -} - -# endif - -ccl_device_inline const ssef uint32_to_float(const ssei &in) -{ - ssei a = _mm_srli_epi32(in, 16); - ssei b = _mm_and_si128(in, _mm_set1_epi32(0x0000ffff)); - ssei c = _mm_or_si128(a, _mm_set1_epi32(0x53000000)); - ssef d = _mm_cvtepi32_ps(b); - ssef e = _mm_sub_ps(_mm_castsi128_ps(c), _mm_castsi128_ps(_mm_set1_epi32(0x53000000))); - return _mm_add_ps(e, d); -} - -template<size_t S1, size_t S2, size_t S3, size_t S4> -ccl_device_inline const ssef set_sign_bit(const ssef &a) -{ - return cast(cast(a) ^ ssei(S1 << 31, S2 << 31, S3 << 31, S4 << 31)); -} - -//////////////////////////////////////////////////////////////////////////////// -/// Debug Functions -//////////////////////////////////////////////////////////////////////////////// - -ccl_device_inline void print_ssef(const char *label, const ssef &a) -{ - printf( - "%s: %.8f %.8f %.8f %.8f\n", label, (double)a[0], (double)a[1], (double)a[2], (double)a[3]); -} - -#endif - -CCL_NAMESPACE_END - -#endif diff --git a/intern/cycles/util/ssei.h b/intern/cycles/util/ssei.h deleted file mode 100644 index 5caf44c967f..00000000000 --- a/intern/cycles/util/ssei.h +++ /dev/null @@ -1,633 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 - * Copyright 2011-2013 Intel Corporation - * Modifications Copyright 2014-2022 Blender Foundation. */ - -#ifndef __UTIL_SSEI_H__ -#define __UTIL_SSEI_H__ - -CCL_NAMESPACE_BEGIN - -#ifdef __KERNEL_SSE2__ - -struct sseb; -struct ssef; - -/*! 4-wide SSE integer type. */ -struct ssei { - typedef sseb Mask; // mask type - typedef ssei Int; // int type - typedef ssef Float; // float type - - enum { size = 4 }; // number of SIMD elements - union { - __m128i m128; - int32_t i[4]; - }; // data - - //////////////////////////////////////////////////////////////////////////////// - /// Constructors, Assignment & Cast Operators - //////////////////////////////////////////////////////////////////////////////// - - __forceinline ssei() - { - } - __forceinline ssei(const ssei &a) - { - m128 = a.m128; - } - __forceinline ssei &operator=(const ssei &a) - { - m128 = a.m128; - return *this; - } - - __forceinline ssei(const __m128i a) : m128(a) - { - } - __forceinline operator const __m128i &(void) const - { - return m128; - } - __forceinline operator __m128i &(void) - { - return m128; - } - - __forceinline ssei(const int a) : m128(_mm_set1_epi32(a)) - { - } - __forceinline ssei(int a, int b, int c, int d) : m128(_mm_setr_epi32(a, b, c, d)) - { - } - - __forceinline explicit ssei(const __m128 a) : m128(_mm_cvtps_epi32(a)) - { - } - - //////////////////////////////////////////////////////////////////////////////// - /// Array Access - //////////////////////////////////////////////////////////////////////////////// - - __forceinline const int32_t &operator[](const size_t index) const - { - assert(index < 4); - return i[index]; - } - __forceinline int32_t &operator[](const size_t index) - { - assert(index < 4); - return i[index]; - } -}; - -//////////////////////////////////////////////////////////////////////////////// -/// Unary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const ssei cast(const __m128 &a) -{ - return _mm_castps_si128(a); -} -__forceinline const ssei operator+(const ssei &a) -{ - return a; -} -__forceinline const ssei operator-(const ssei &a) -{ - return _mm_sub_epi32(_mm_setzero_si128(), a.m128); -} -# if defined(__KERNEL_SSSE3__) -__forceinline const ssei abs(const ssei &a) -{ - return _mm_abs_epi32(a.m128); -} -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Binary Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const ssei operator+(const ssei &a, const ssei &b) -{ - return _mm_add_epi32(a.m128, b.m128); -} -__forceinline const ssei operator+(const ssei &a, const int32_t &b) -{ - return a + ssei(b); -} -__forceinline const ssei operator+(const int32_t &a, const ssei &b) -{ - return ssei(a) + b; -} - -__forceinline const ssei operator-(const ssei &a, const ssei &b) -{ - return _mm_sub_epi32(a.m128, b.m128); -} -__forceinline const ssei operator-(const ssei &a, const int32_t &b) -{ - return a - ssei(b); -} -__forceinline const ssei operator-(const int32_t &a, const ssei &b) -{ - return ssei(a) - b; -} - -# if defined(__KERNEL_SSE41__) -__forceinline const ssei operator*(const ssei &a, const ssei &b) -{ - return _mm_mullo_epi32(a.m128, b.m128); -} -__forceinline const ssei operator*(const ssei &a, const int32_t &b) -{ - return a * ssei(b); -} -__forceinline const ssei operator*(const int32_t &a, const ssei &b) -{ - return ssei(a) * b; -} -# endif - -__forceinline const ssei operator&(const ssei &a, const ssei &b) -{ - return _mm_and_si128(a.m128, b.m128); -} -__forceinline const ssei operator&(const ssei &a, const int32_t &b) -{ - return a & ssei(b); -} -__forceinline const ssei operator&(const int32_t &a, const ssei &b) -{ - return ssei(a) & b; -} - -__forceinline const ssei operator|(const ssei &a, const ssei &b) -{ - return _mm_or_si128(a.m128, b.m128); -} -__forceinline const ssei operator|(const ssei &a, const int32_t &b) -{ - return a | ssei(b); -} -__forceinline const ssei operator|(const int32_t &a, const ssei &b) -{ - return ssei(a) | b; -} - -__forceinline const ssei operator^(const ssei &a, const ssei &b) -{ - return _mm_xor_si128(a.m128, b.m128); -} -__forceinline const ssei operator^(const ssei &a, const int32_t &b) -{ - return a ^ ssei(b); -} -__forceinline const ssei operator^(const int32_t &a, const ssei &b) -{ - return ssei(a) ^ b; -} - -__forceinline const ssei operator<<(const ssei &a, const int32_t &n) -{ - return _mm_slli_epi32(a.m128, n); -} -__forceinline const ssei operator>>(const ssei &a, const int32_t &n) -{ - return _mm_srai_epi32(a.m128, n); -} - -__forceinline const ssei andnot(const ssei &a, const ssei &b) -{ - return _mm_andnot_si128(a.m128, b.m128); -} -__forceinline const ssei andnot(const sseb &a, const ssei &b) -{ - return _mm_andnot_si128(cast(a.m128), b.m128); -} -__forceinline const ssei andnot(const ssei &a, const sseb &b) -{ - return _mm_andnot_si128(a.m128, cast(b.m128)); -} - -__forceinline const ssei sra(const ssei &a, const int32_t &b) -{ - return _mm_srai_epi32(a.m128, b); -} -__forceinline const ssei srl(const ssei &a, const int32_t &b) -{ - return _mm_srli_epi32(a.m128, b); -} - -# if defined(__KERNEL_SSE41__) -__forceinline const ssei min(const ssei &a, const ssei &b) -{ - return _mm_min_epi32(a.m128, b.m128); -} -__forceinline const ssei min(const ssei &a, const int32_t &b) -{ - return min(a, ssei(b)); -} -__forceinline const ssei min(const int32_t &a, const ssei &b) -{ - return min(ssei(a), b); -} - -__forceinline const ssei max(const ssei &a, const ssei &b) -{ - return _mm_max_epi32(a.m128, b.m128); -} -__forceinline const ssei max(const ssei &a, const int32_t &b) -{ - return max(a, ssei(b)); -} -__forceinline const ssei max(const int32_t &a, const ssei &b) -{ - return max(ssei(a), b); -} -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Assignment Operators -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssei &operator+=(ssei &a, const ssei &b) -{ - return a = a + b; -} -__forceinline ssei &operator+=(ssei &a, const int32_t &b) -{ - return a = a + b; -} - -__forceinline ssei &operator-=(ssei &a, const ssei &b) -{ - return a = a - b; -} -__forceinline ssei &operator-=(ssei &a, const int32_t &b) -{ - return a = a - b; -} - -# if defined(__KERNEL_SSE41__) -__forceinline ssei &operator*=(ssei &a, const ssei &b) -{ - return a = a * b; -} -__forceinline ssei &operator*=(ssei &a, const int32_t &b) -{ - return a = a * b; -} -# endif - -__forceinline ssei &operator&=(ssei &a, const ssei &b) -{ - return a = a & b; -} -__forceinline ssei &operator&=(ssei &a, const int32_t &b) -{ - return a = a & b; -} - -__forceinline ssei &operator|=(ssei &a, const ssei &b) -{ - return a = a | b; -} -__forceinline ssei &operator|=(ssei &a, const int32_t &b) -{ - return a = a | b; -} - -__forceinline ssei &operator^=(ssei &a, const ssei &b) -{ - return a = a ^ b; -} -__forceinline ssei &operator^=(ssei &a, const int32_t &b) -{ - return a = a ^ b; -} - -__forceinline ssei &operator<<=(ssei &a, const int32_t &b) -{ - return a = a << b; -} -__forceinline ssei &operator>>=(ssei &a, const int32_t &b) -{ - return a = a >> b; -} - -//////////////////////////////////////////////////////////////////////////////// -/// Comparison Operators + Select -//////////////////////////////////////////////////////////////////////////////// - -__forceinline const sseb operator==(const ssei &a, const ssei &b) -{ - return _mm_castsi128_ps(_mm_cmpeq_epi32(a.m128, b.m128)); -} -__forceinline const sseb operator==(const ssei &a, const int32_t &b) -{ - return a == ssei(b); -} -__forceinline const sseb operator==(const int32_t &a, const ssei &b) -{ - return ssei(a) == b; -} - -__forceinline const sseb operator!=(const ssei &a, const ssei &b) -{ - return !(a == b); -} -__forceinline const sseb operator!=(const ssei &a, const int32_t &b) -{ - return a != ssei(b); -} -__forceinline const sseb operator!=(const int32_t &a, const ssei &b) -{ - return ssei(a) != b; -} - -__forceinline const sseb operator<(const ssei &a, const ssei &b) -{ - return _mm_castsi128_ps(_mm_cmplt_epi32(a.m128, b.m128)); -} -__forceinline const sseb operator<(const ssei &a, const int32_t &b) -{ - return a < ssei(b); -} -__forceinline const sseb operator<(const int32_t &a, const ssei &b) -{ - return ssei(a) < b; -} - -__forceinline const sseb operator>=(const ssei &a, const ssei &b) -{ - return !(a < b); -} -__forceinline const sseb operator>=(const ssei &a, const int32_t &b) -{ - return a >= ssei(b); -} -__forceinline const sseb operator>=(const int32_t &a, const ssei &b) -{ - return ssei(a) >= b; -} - -__forceinline const sseb operator>(const ssei &a, const ssei &b) -{ - return _mm_castsi128_ps(_mm_cmpgt_epi32(a.m128, b.m128)); -} -__forceinline const sseb operator>(const ssei &a, const int32_t &b) -{ - return a > ssei(b); -} -__forceinline const sseb operator>(const int32_t &a, const ssei &b) -{ - return ssei(a) > b; -} - -__forceinline const sseb operator<=(const ssei &a, const ssei &b) -{ - return !(a > b); -} -__forceinline const sseb operator<=(const ssei &a, const int32_t &b) -{ - return a <= ssei(b); -} -__forceinline const sseb operator<=(const int32_t &a, const ssei &b) -{ - return ssei(a) <= b; -} - -__forceinline const ssei select(const sseb &m, const ssei &t, const ssei &f) -{ -# ifdef __KERNEL_SSE41__ - return _mm_castps_si128(_mm_blendv_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), m)); -# else - return _mm_or_si128(_mm_and_si128(m, t), _mm_andnot_si128(m, f)); -# endif -} - -__forceinline const ssei select(const int mask, const ssei &t, const ssei &f) -{ -# if defined(__KERNEL_SSE41__) && \ - ((!defined(__clang__) && !defined(_MSC_VER)) || defined(__INTEL_COMPILER)) - return _mm_castps_si128(_mm_blend_ps(_mm_castsi128_ps(f), _mm_castsi128_ps(t), mask)); -# else - return select(sseb(mask), t, f); -# endif -} - -//////////////////////////////////////////////////////////////////////////////// -// Movement/Shifting/Shuffling Functions -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssei unpacklo(const ssei &a, const ssei &b) -{ - return _mm_unpacklo_epi32(a, b); -} -__forceinline ssei unpackhi(const ssei &a, const ssei &b) -{ - return _mm_unpackhi_epi32(a, b); -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const ssei shuffle(const ssei &a) -{ -# ifdef __KERNEL_NEON__ - int32x4_t result = shuffle_neon<int32x4_t, i0, i1, i2, i3>(vreinterpretq_s32_m128i(a)); - return vreinterpretq_m128i_s32(result); -# else - return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)); -# endif -} - -template<size_t i0, size_t i1, size_t i2, size_t i3> -__forceinline const ssei shuffle(const ssei &a, const ssei &b) -{ -# ifdef __KERNEL_NEON__ - int32x4_t result = shuffle_neon<int32x4_t, i0, i1, i2, i3>(vreinterpretq_s32_m128i(a), - vreinterpretq_s32_m128i(b)); - return vreinterpretq_m128i_s32(result); -# else - return _mm_castps_si128( - _mm_shuffle_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(b), _MM_SHUFFLE(i3, i2, i1, i0))); -# endif -} - -template<size_t i0> __forceinline const ssei shuffle(const ssei &b) -{ - return shuffle<i0, i0, i0, i0>(b); -} - -# if defined(__KERNEL_SSE41__) -template<size_t src> __forceinline int extract(const ssei &b) -{ - return _mm_extract_epi32(b, src); -} -template<size_t dst> __forceinline const ssei insert(const ssei &a, const int32_t b) -{ - return _mm_insert_epi32(a, b, dst); -} -# else -template<size_t src> __forceinline int extract(const ssei &b) -{ - return b[src]; -} -template<size_t dst> __forceinline const ssei insert(const ssei &a, const int32_t b) -{ - ssei c = a; - c[dst] = b; - return c; -} -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Reductions -//////////////////////////////////////////////////////////////////////////////// - -# if defined(__KERNEL_SSE41__) -__forceinline const ssei vreduce_min(const ssei &v) -{ - ssei h = min(shuffle<1, 0, 3, 2>(v), v); - return min(shuffle<2, 3, 0, 1>(h), h); -} -__forceinline const ssei vreduce_max(const ssei &v) -{ - ssei h = max(shuffle<1, 0, 3, 2>(v), v); - return max(shuffle<2, 3, 0, 1>(h), h); -} -__forceinline const ssei vreduce_add(const ssei &v) -{ - ssei h = shuffle<1, 0, 3, 2>(v) + v; - return shuffle<2, 3, 0, 1>(h) + h; -} - -__forceinline int reduce_min(const ssei &v) -{ -# ifdef __KERNEL_NEON__ - return vminvq_s32(vreinterpretq_s32_m128i(v)); -# else - return extract<0>(vreduce_min(v)); -# endif -} -__forceinline int reduce_max(const ssei &v) -{ -# ifdef __KERNEL_NEON__ - return vmaxvq_s32(vreinterpretq_s32_m128i(v)); -# else - return extract<0>(vreduce_max(v)); -# endif -} -__forceinline int reduce_add(const ssei &v) -{ -# ifdef __KERNEL_NEON__ - return vaddvq_s32(vreinterpretq_s32_m128i(v)); -# else - return extract<0>(vreduce_add(v)); -# endif -} - -__forceinline uint32_t select_min(const ssei &v) -{ - return __bsf(movemask(v == vreduce_min(v))); -} -__forceinline uint32_t select_max(const ssei &v) -{ - return __bsf(movemask(v == vreduce_max(v))); -} - -__forceinline uint32_t select_min(const sseb &valid, const ssei &v) -{ - const ssei a = select(valid, v, ssei((int)pos_inf)); - return __bsf(movemask(valid & (a == vreduce_min(a)))); -} -__forceinline uint32_t select_max(const sseb &valid, const ssei &v) -{ - const ssei a = select(valid, v, ssei((int)neg_inf)); - return __bsf(movemask(valid & (a == vreduce_max(a)))); -} - -# else - -__forceinline int ssei_min(int a, int b) -{ - return (a < b) ? a : b; -} -__forceinline int ssei_max(int a, int b) -{ - return (a > b) ? a : b; -} -__forceinline int reduce_min(const ssei &v) -{ - return ssei_min(ssei_min(v[0], v[1]), ssei_min(v[2], v[3])); -} -__forceinline int reduce_max(const ssei &v) -{ - return ssei_max(ssei_max(v[0], v[1]), ssei_max(v[2], v[3])); -} -__forceinline int reduce_add(const ssei &v) -{ - return v[0] + v[1] + v[2] + v[3]; -} - -# endif - -//////////////////////////////////////////////////////////////////////////////// -/// Memory load and store operations -//////////////////////////////////////////////////////////////////////////////// - -__forceinline ssei load4i(const void *const a) -{ - return _mm_load_si128((__m128i *)a); -} - -__forceinline void store4i(void *ptr, const ssei &v) -{ - _mm_store_si128((__m128i *)ptr, v); -} - -__forceinline void storeu4i(void *ptr, const ssei &v) -{ - _mm_storeu_si128((__m128i *)ptr, v); -} - -__forceinline void store4i(const sseb &mask, void *ptr, const ssei &i) -{ -# if defined(__KERNEL_AVX__) - _mm_maskstore_ps((float *)ptr, (__m128i)mask, _mm_castsi128_ps(i)); -# else - *(ssei *)ptr = select(mask, i, *(ssei *)ptr); -# endif -} - -__forceinline ssei load4i_nt(void *ptr) -{ -# if defined(__KERNEL_SSE41__) - return _mm_stream_load_si128((__m128i *)ptr); -# else - return _mm_load_si128((__m128i *)ptr); -# endif -} - -__forceinline void store4i_nt(void *ptr, const ssei &v) -{ -# if defined(__KERNEL_SSE41__) - _mm_stream_ps((float *)ptr, _mm_castsi128_ps(v)); -# else - _mm_store_si128((__m128i *)ptr, v); -# endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Debug Functions -//////////////////////////////////////////////////////////////////////////////// - -ccl_device_inline void print_ssei(const char *label, const ssei &a) -{ - printf("%s: %df %df %df %d\n", label, a[0], a[1], a[2], a[3]); -} - -#endif - -CCL_NAMESPACE_END - -#endif diff --git a/intern/cycles/util/transform.cpp b/intern/cycles/util/transform.cpp index cb985c65dd8..84116262437 100644 --- a/intern/cycles/util/transform.cpp +++ b/intern/cycles/util/transform.cpp @@ -102,7 +102,7 @@ ProjectionTransform projection_inverse(const ProjectionTransform &tfm) return projection_identity(); } - memcpy(&tfmR, R, sizeof(R)); + memcpy(&tfmR.x[0], R, sizeof(R)); return tfmR; } diff --git a/intern/cycles/util/transform.h b/intern/cycles/util/transform.h index 24184dc7074..d7f95b7f296 100644 --- a/intern/cycles/util/transform.h +++ b/intern/cycles/util/transform.h @@ -63,17 +63,16 @@ ccl_device_inline float3 transform_point(ccl_private const Transform *t, const f { /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) - ssef x, y, z, w, aa; - aa = a.m128; + const float4 aa(a.m128); - x = _mm_loadu_ps(&t->x.x); - y = _mm_loadu_ps(&t->y.x); - z = _mm_loadu_ps(&t->z.x); - w = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f); + float4 x(_mm_loadu_ps(&t->x.x)); + float4 y(_mm_loadu_ps(&t->y.x)); + float4 z(_mm_loadu_ps(&t->z.x)); + float4 w(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f)); - _MM_TRANSPOSE4_PS(x, y, z, w); + _MM_TRANSPOSE4_PS(x.m128, y.m128, z.m128, w.m128); - ssef tmp = w; + float4 tmp = w; tmp = madd(shuffle<2>(aa), z, tmp); tmp = madd(shuffle<1>(aa), y, tmp); tmp = madd(shuffle<0>(aa), x, tmp); @@ -94,16 +93,16 @@ ccl_device_inline float3 transform_point(ccl_private const Transform *t, const f ccl_device_inline float3 transform_direction(ccl_private const Transform *t, const float3 a) { #if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) - ssef x, y, z, w, aa; - aa = a.m128; - x = _mm_loadu_ps(&t->x.x); - y = _mm_loadu_ps(&t->y.x); - z = _mm_loadu_ps(&t->z.x); - w = _mm_setzero_ps(); + const float4 aa(a.m128); - _MM_TRANSPOSE4_PS(x, y, z, w); + float4 x(_mm_loadu_ps(&t->x.x)); + float4 y(_mm_loadu_ps(&t->y.x)); + float4 z(_mm_loadu_ps(&t->z.x)); + float4 w(_mm_setzero_ps()); - ssef tmp = shuffle<2>(aa) * z; + _MM_TRANSPOSE4_PS(x.m128, y.m128, z.m128, w.m128); + + float4 tmp = shuffle<2>(aa) * z; tmp = madd(shuffle<1>(aa), y, tmp); tmp = madd(shuffle<0>(aa), x, tmp); diff --git a/intern/cycles/util/transform_inverse.h b/intern/cycles/util/transform_inverse.h index bb410a6daef..2faac576d82 100644 --- a/intern/cycles/util/transform_inverse.h +++ b/intern/cycles/util/transform_inverse.h @@ -9,26 +9,33 @@ CCL_NAMESPACE_BEGIN * Normally we don't use SSE41/AVX outside the kernel, but for this it's * important to match exactly for ray tracing precision. */ -ccl_device_forceinline float3 transform_inverse_cross(const float3 a, const float3 b) +ccl_device_forceinline float3 transform_inverse_cross(const float3 a_, const float3 b_) { #if defined(__AVX2__) && defined(__KERNEL_SSE2__) - const ssef sse_a = (const __m128 &)a; - const ssef sse_b = (const __m128 &)b; - const ssef r = shuffle<1, 2, 0, 3>( - ssef(_mm_fmsub_ps(sse_a, shuffle<1, 2, 0, 3>(sse_b), shuffle<1, 2, 0, 3>(sse_a) * sse_b))); + const __m128 a = (const __m128 &)a_; + const __m128 b = (const __m128 &)b_; + const __m128 a_shuffle = _mm_castsi128_ps( + _mm_shuffle_epi32(_mm_castps_si128(a), _MM_SHUFFLE(3, 0, 2, 1))); + const __m128 b_shuffle = _mm_castsi128_ps( + _mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(3, 0, 2, 1))); + const __m128 r = _mm_castsi128_ps( + _mm_shuffle_epi32(_mm_castps_si128(_mm_fmsub_ps(a, b_shuffle, _mm_mul_ps(a_shuffle, b))), + _MM_SHUFFLE(3, 0, 2, 1))); return (const float3 &)r; #endif - return cross(a, b); + return cross(a_, b_); } -ccl_device_forceinline float transform_inverse_dot(const float3 a, const float3 b) +ccl_device_forceinline float transform_inverse_dot(const float3 a_, const float3 b_) { -#ifdef __SSE4_1__ - return _mm_cvtss_f32(_mm_dp_ps((const __m128 &)a, (const __m128 &)b, 0x7F)); +#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__) + const __m128 a = (const __m128 &)a_; + const __m128 b = (const __m128 &)b_; + return _mm_cvtss_f32(_mm_dp_ps(a, b, 0x7F)); #endif - return dot(a, b); + return dot(a_, b_); } ccl_device_forceinline Transform transform_inverse_impl(const Transform tfm) diff --git a/intern/cycles/util/types.h b/intern/cycles/util/types.h index 1ab6f76f9bc..cf7f35c4116 100644 --- a/intern/cycles/util/types.h +++ b/intern/cycles/util/types.h @@ -97,6 +97,7 @@ ccl_device_inline void print_float(ccl_private const char *label, const float a) #include "util/types_int2.h" #include "util/types_int3.h" #include "util/types_int4.h" +#include "util/types_int8.h" #include "util/types_uint2.h" #include "util/types_uint3.h" @@ -119,6 +120,7 @@ ccl_device_inline void print_float(ccl_private const char *label, const float a) #include "util/types_int2_impl.h" #include "util/types_int3_impl.h" #include "util/types_int4_impl.h" +#include "util/types_int8_impl.h" #include "util/types_uint2_impl.h" #include "util/types_uint3_impl.h" @@ -129,16 +131,4 @@ ccl_device_inline void print_float(ccl_private const char *label, const float a) #include "util/types_float4_impl.h" #include "util/types_float8_impl.h" -/* SSE types. */ -#ifndef __KERNEL_GPU__ -# include "util/sseb.h" -# include "util/ssef.h" -# include "util/ssei.h" -# if defined(__KERNEL_AVX__) || defined(__KERNEL_AVX2__) -# include "util/avxb.h" -# include "util/avxf.h" -# include "util/avxi.h" -# endif -#endif - #endif /* __UTIL_TYPES_H__ */ diff --git a/intern/cycles/util/types_float8.h b/intern/cycles/util/types_float8.h index 29fd632f08e..121141ddfd9 100644 --- a/intern/cycles/util/types_float8.h +++ b/intern/cycles/util/types_float8.h @@ -11,15 +11,15 @@ CCL_NAMESPACE_BEGIN /* float8 is a reserved type in Metal that has not been implemented. For - * that reason this is named float8_t and not using native vector types. */ + * that reason this is named vfloat8 and not using native vector types. */ #ifdef __KERNEL_GPU__ -struct float8_t +struct vfloat8 #else -struct ccl_try_align(32) float8_t +struct ccl_try_align(32) vfloat8 #endif { -#ifdef __KERNEL_AVX2__ +#ifdef __KERNEL_AVX__ union { __m256 m256; struct { @@ -27,18 +27,18 @@ struct ccl_try_align(32) float8_t }; }; - __forceinline float8_t(); - __forceinline float8_t(const float8_t &a); - __forceinline explicit float8_t(const __m256 &a); + __forceinline vfloat8(); + __forceinline vfloat8(const vfloat8 &a); + __forceinline explicit vfloat8(const __m256 &a); __forceinline operator const __m256 &() const; __forceinline operator __m256 &(); - __forceinline float8_t &operator=(const float8_t &a); + __forceinline vfloat8 &operator=(const vfloat8 &a); -#else /* __KERNEL_AVX2__ */ +#else /* __KERNEL_AVX__ */ float a, b, c, d, e, f, g, h; -#endif /* __KERNEL_AVX2__ */ +#endif /* __KERNEL_AVX__ */ #ifndef __KERNEL_GPU__ __forceinline float operator[](int i) const; @@ -46,8 +46,11 @@ struct ccl_try_align(32) float8_t #endif }; -ccl_device_inline float8_t make_float8_t(float f); -ccl_device_inline float8_t -make_float8_t(float a, float b, float c, float d, float e, float f, float g, float h); +ccl_device_inline vfloat8 make_vfloat8(float f); +ccl_device_inline vfloat8 +make_vfloat8(float a, float b, float c, float d, float e, float f, float g, float h); +ccl_device_inline vfloat8 make_vfloat8(const float4 a, const float4 b); + +ccl_device_inline void print_vfloat8(ccl_private const char *label, const vfloat8 a); CCL_NAMESPACE_END diff --git a/intern/cycles/util/types_float8_impl.h b/intern/cycles/util/types_float8_impl.h index e8576cdaf70..9f42e0f663c 100644 --- a/intern/cycles/util/types_float8_impl.h +++ b/intern/cycles/util/types_float8_impl.h @@ -10,45 +10,45 @@ CCL_NAMESPACE_BEGIN -#ifdef __KERNEL_AVX2__ -__forceinline float8_t::float8_t() +#ifdef __KERNEL_AVX__ +__forceinline vfloat8::vfloat8() { } -__forceinline float8_t::float8_t(const float8_t &f) : m256(f.m256) +__forceinline vfloat8::vfloat8(const vfloat8 &f) : m256(f.m256) { } -__forceinline float8_t::float8_t(const __m256 &f) : m256(f) +__forceinline vfloat8::vfloat8(const __m256 &f) : m256(f) { } -__forceinline float8_t::operator const __m256 &() const +__forceinline vfloat8::operator const __m256 &() const { return m256; } -__forceinline float8_t::operator __m256 &() +__forceinline vfloat8::operator __m256 &() { return m256; } -__forceinline float8_t &float8_t::operator=(const float8_t &f) +__forceinline vfloat8 &vfloat8::operator=(const vfloat8 &f) { m256 = f.m256; return *this; } -#endif /* __KERNEL_AVX2__ */ +#endif /* __KERNEL_AVX__ */ #ifndef __KERNEL_GPU__ -__forceinline float float8_t::operator[](int i) const +__forceinline float vfloat8::operator[](int i) const { util_assert(i >= 0); util_assert(i < 8); return *(&a + i); } -__forceinline float &float8_t::operator[](int i) +__forceinline float &vfloat8::operator[](int i) { util_assert(i >= 0); util_assert(i < 8); @@ -56,25 +56,50 @@ __forceinline float &float8_t::operator[](int i) } #endif -ccl_device_inline float8_t make_float8_t(float f) +ccl_device_inline vfloat8 make_vfloat8(float f) { -#ifdef __KERNEL_AVX2__ - float8_t r(_mm256_set1_ps(f)); +#ifdef __KERNEL_AVX__ + vfloat8 r(_mm256_set1_ps(f)); #else - float8_t r = {f, f, f, f, f, f, f, f}; + vfloat8 r = {f, f, f, f, f, f, f, f}; #endif return r; } -ccl_device_inline float8_t -make_float8_t(float a, float b, float c, float d, float e, float f, float g, float h) +ccl_device_inline vfloat8 +make_vfloat8(float a, float b, float c, float d, float e, float f, float g, float h) { -#ifdef __KERNEL_AVX2__ - float8_t r(_mm256_setr_ps(a, b, c, d, e, f, g, h)); +#ifdef __KERNEL_AVX__ + vfloat8 r(_mm256_setr_ps(a, b, c, d, e, f, g, h)); #else - float8_t r = {a, b, c, d, e, f, g, h}; + vfloat8 r = {a, b, c, d, e, f, g, h}; #endif return r; } +ccl_device_inline vfloat8 make_vfloat8(const float4 a, const float4 b) +{ +#ifdef __KERNEL_AVX__ + return vfloat8(_mm256_insertf128_ps(_mm256_castps128_ps256(a), b, 1)); +#else + return make_vfloat8(a.x, a.y, a.z, a.w, b.x, b.y, b.z, b.w); +#endif +} + +ccl_device_inline void print_vfloat8(ccl_private const char *label, const vfloat8 a) +{ +#ifdef __KERNEL_PRINTF__ + printf("%s: %.8f %.8f %.8f %.8f %.8f %.8f %.8f %.8f\n", + label, + (double)a.a, + (double)a.b, + (double)a.c, + (double)a.d, + (double)a.e, + (double)a.f, + (double)a.g, + (double)a.h); +#endif +} + CCL_NAMESPACE_END diff --git a/intern/cycles/util/types_int8.h b/intern/cycles/util/types_int8.h new file mode 100644 index 00000000000..8643ebe96ad --- /dev/null +++ b/intern/cycles/util/types_int8.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2022 Blender Foundation */ + +#pragma once + +#ifndef __UTIL_TYPES_H__ +# error "Do not include this file directly, include util/types.h instead." +#endif + +CCL_NAMESPACE_BEGIN + +struct vfloat8; + +#ifdef __KERNEL_GPU__ +struct vint8 +#else +struct ccl_try_align(32) vint8 +#endif +{ +#ifdef __KERNEL_AVX__ + union { + __m256i m256; + struct { + int a, b, c, d, e, f, g, h; + }; + }; + + __forceinline vint8(); + __forceinline vint8(const vint8 &a); + __forceinline explicit vint8(const __m256i &a); + + __forceinline operator const __m256i &() const; + __forceinline operator __m256i &(); + + __forceinline vint8 &operator=(const vint8 &a); +#else /* __KERNEL_AVX__ */ + int a, b, c, d, e, f, g, h; +#endif /* __KERNEL_AVX__ */ + +#ifndef __KERNEL_GPU__ + __forceinline int operator[](int i) const; + __forceinline int &operator[](int i); +#endif +}; + +ccl_device_inline vint8 make_vint8(int a, int b, int c, int d, int e, int f, int g, int h); +ccl_device_inline vint8 make_vint8(int i); +ccl_device_inline vint8 make_vint8(const vfloat8 f); +ccl_device_inline vint8 make_vint8(const int4 a, const int4 b); + +CCL_NAMESPACE_END diff --git a/intern/cycles/util/types_int8_impl.h b/intern/cycles/util/types_int8_impl.h new file mode 100644 index 00000000000..080bcaa6a2b --- /dev/null +++ b/intern/cycles/util/types_int8_impl.h @@ -0,0 +1,95 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2022 Blender Foundation */ + +#pragma once + +#ifndef __UTIL_TYPES_H__ +# error "Do not include this file directly, include util/types.h instead." +#endif + +CCL_NAMESPACE_BEGIN + +#ifdef __KERNEL_AVX__ +__forceinline vint8::vint8() +{ +} + +__forceinline vint8::vint8(const vint8 &a) : m256(a.m256) +{ +} + +__forceinline vint8::vint8(const __m256i &a) : m256(a) +{ +} + +__forceinline vint8::operator const __m256i &() const +{ + return m256; +} + +__forceinline vint8::operator __m256i &() +{ + return m256; +} + +__forceinline vint8 &vint8::operator=(const vint8 &a) +{ + m256 = a.m256; + return *this; +} +#endif /* __KERNEL_AVX__ */ + +#ifndef __KERNEL_GPU__ +__forceinline int vint8::operator[](int i) const +{ + util_assert(i >= 0); + util_assert(i < 8); + return *(&a + i); +} + +__forceinline int &vint8::operator[](int i) +{ + util_assert(i >= 0); + util_assert(i < 8); + return *(&a + i); +} +#endif + +ccl_device_inline vint8 make_vint8(int a, int b, int c, int d, int e, int f, int g, int h) +{ +#ifdef __KERNEL_AVX__ + return vint8(_mm256_set_epi32(h, g, f, e, d, c, b, a)); +#else + return {a, b, c, d, e, f, g, h}; +#endif +} + +ccl_device_inline vint8 make_vint8(int i) +{ +#ifdef __KERNEL_AVX__ + return vint8(_mm256_set1_epi32(i)); +#else + return make_vint8(i, i, i, i, i, i, i, i); +#endif +} + +ccl_device_inline vint8 make_vint8(const vfloat8 f) +{ +#ifdef __KERNEL_AVX__ + return vint8(_mm256_cvtps_epi32(f.m256)); +#else + return make_vint8( + (int)f.a, (int)f.b, (int)f.c, (int)f.d, (int)f.e, (int)f.f, (int)f.g, (int)f.h); +#endif +} + +ccl_device_inline vint8 make_vint8(const int4 a, const int4 b) +{ +#ifdef __KERNEL_AVX__ + return vint8(_mm256_insertf128_si256(_mm256_castsi128_si256(a.m128), b.m128, 1)); +#else + return make_vint8(a.x, a.y, a.z, a.w, b.x, b.y, b.z, b.w); +#endif +} + +CCL_NAMESPACE_END diff --git a/intern/ffmpeg/CMakeLists.txt b/intern/ffmpeg/CMakeLists.txt index 0de8496f3f3..4fb5df9d4cd 100644 --- a/intern/ffmpeg/CMakeLists.txt +++ b/intern/ffmpeg/CMakeLists.txt @@ -6,6 +6,7 @@ if(WITH_GTESTS) tests/ffmpeg_codecs.cc ) set(TEST_INC + . ) set(TEST_INC_SYS ${FFMPEG_INCLUDE_DIRS} diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index f311e04d8e0..f7d87af8bca 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -36,6 +36,14 @@ # define FFMPEG_INLINE static inline #endif +#if (LIBAVFORMAT_VERSION_MAJOR < 59) +/* For versions older than ffmpeg 5.0, use the old channel layout variables. + * We intend to only keep this workaround for around two releases (3.5, 3.6). + * If it sticks around any longer, then we should consider refactoring this. + */ +# define FFMPEG_USE_OLD_CHANNEL_VARS +#endif + #if (LIBAVFORMAT_VERSION_MAJOR < 58) || \ ((LIBAVFORMAT_VERSION_MAJOR == 58) && (LIBAVFORMAT_VERSION_MINOR < 76)) # define FFMPEG_USE_DURATION_WORKAROUND 1 diff --git a/intern/ffmpeg/tests/ffmpeg_codecs.cc b/intern/ffmpeg/tests/ffmpeg_codecs.cc index e5c33202417..cd06917f59b 100644 --- a/intern/ffmpeg/tests/ffmpeg_codecs.cc +++ b/intern/ffmpeg/tests/ffmpeg_codecs.cc @@ -3,6 +3,8 @@ #include "testing/testing.h" extern "C" { +#include "ffmpeg_compat.h" + #include <libavcodec/avcodec.h> #include <libavutil/channel_layout.h> #include <libavutil/log.h> @@ -40,7 +42,11 @@ bool test_acodec(const AVCodec *codec, AVSampleFormat fmt) if (ctx) { ctx->sample_fmt = fmt; ctx->sample_rate = 48000; +#ifdef FFMPEG_USE_OLD_CHANNEL_VARS ctx->channel_layout = AV_CH_LAYOUT_MONO; +#else + av_channel_layout_from_mask(&ctx->ch_layout, AV_CH_LAYOUT_MONO); +#endif ctx->bit_rate = 128000; int open = avcodec_open2(ctx, codec, NULL); if (open >= 0) { diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index b83c4916330..60834df285a 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -3969,6 +3969,8 @@ def km_grease_pencil_stroke_sculpt_mode(params): op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}), # Context menu *_template_items_context_panel("VIEW3D_PT_gpencil_sculpt_context_menu", params.context_menu_event), + # Automasking Pie menu + op_menu_pie("VIEW3D_MT_sculpt_gpencil_automasking_pie", {"type": 'A', "shift": True, "alt": True, "value": 'PRESS'}), ]) return keymap diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 38522a1bf84..83bb0f7dd8c 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -51,11 +51,6 @@ class GreasePencilSculptAdvancedPanel: tool = brush.gpencil_sculpt_tool gp_settings = brush.gpencil_settings - col = layout.column(heading="Auto-Masking", align=True) - col.prop(gp_settings, "use_automasking_stroke", text="Stroke") - col.prop(gp_settings, "use_automasking_layer", text="Layer") - col.prop(gp_settings, "use_automasking_material", text="Material") - if tool in {'SMOOTH', 'RANDOMIZE'}: col = layout.column(heading="Affect", align=True) col.prop(gp_settings, "use_edit_position", text="Position") diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 39684aaf161..5aad2d9b363 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -108,7 +108,7 @@ class VIEW3D_HT_tool_header(Header): brush = context.tool_settings.gpencil_sculpt_paint.brush if brush: tool = brush.gpencil_sculpt_tool - if tool != 'CLONE': + if tool in {'SMOOTH', 'RANDOMIZE'}: layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover") layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance") elif tool_mode == 'WEIGHT_GPENCIL': @@ -837,14 +837,18 @@ class VIEW3D_HT_header(Header): panel="VIEW3D_PT_gpencil_guide", text="Guides", ) - + if object_mode == 'SCULPT_GPENCIL': + layout.popover( + panel="VIEW3D_PT_gpencil_sculpt_automasking", + text="", + icon="MOD_MASK" + ) elif object_mode == 'SCULPT': layout.popover( panel="VIEW3D_PT_sculpt_automasking", text="", icon="MOD_MASK" ) - else: # Transform settings depending on tool header visibility VIEW3D_HT_header.draw_xform_template(layout, context) @@ -3121,21 +3125,33 @@ class VIEW3D_MT_paint_weight_lock(Menu): op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All") op.action, op.mask = 'LOCK', 'ALL' - op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock All") - op.action, op.mask = 'UNLOCK', 'ALL' - op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Selected") + + op = layout.operator("object.vertex_group_lock", text="Lock Selected") op.action, op.mask = 'LOCK', 'SELECTED' - op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock Selected") - op.action, op.mask = 'UNLOCK', 'SELECTED' - op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Unselected") + + op = layout.operator("object.vertex_group_lock", text="Lock Unselected") op.action, op.mask = 'LOCK', 'UNSELECTED' - op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock Unselected") - op.action, op.mask = 'UNLOCK', 'UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Lock Only Selected") op.action, op.mask = 'LOCK', 'INVERT_UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Lock Only Unselected") op.action, op.mask = 'UNLOCK', 'INVERT_UNSELECTED' - op = layout.operator("object.vertex_group_lock", text="Invert Locks") + + layout.separator() + + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock All") + op.action, op.mask = 'UNLOCK', 'ALL' + + op = layout.operator("object.vertex_group_lock", text="Unlock Selected") + op.action, op.mask = 'UNLOCK', 'SELECTED' + + op = layout.operator("object.vertex_group_lock", text="Unlock Unselected") + op.action, op.mask = 'UNLOCK', 'UNSELECTED' + + layout.separator() + + op = layout.operator("object.vertex_group_lock", icon='ARROW_LEFTRIGHT', text="Invert Locks") op.action, op.mask = 'INVERT', 'ALL' @@ -5507,6 +5523,22 @@ class VIEW3D_MT_sculpt_automasking_pie(Menu): pie.prop(sculpt, "use_automasking_view_normal", text="View Normal") +class VIEW3D_MT_sculpt_gpencil_automasking_pie(Menu): + bl_label = "Automasking" + + def draw(self, context): + layout = self.layout + pie = layout.menu_pie() + + tool_settings = context.tool_settings + + pie.prop(tool_settings.gpencil_sculpt, "use_automasking_stroke", text="Stroke") + pie.prop(tool_settings.gpencil_sculpt, "use_automasking_layer_stroke", text="Layer") + pie.prop(tool_settings.gpencil_sculpt, "use_automasking_material_stroke", text="Material") + pie.prop(tool_settings.gpencil_sculpt, "use_automasking_layer_active", text="Active Layer") + pie.prop(tool_settings.gpencil_sculpt, "use_automasking_material_active", text="Active Material") + + class VIEW3D_MT_sculpt_face_sets_edit_pie(Menu): bl_label = "Face Sets Edit" @@ -7455,6 +7487,27 @@ def draw_gpencil_material_active(context, layout): row.prop(ma, "name", text="") +class VIEW3D_PT_gpencil_sculpt_automasking(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Auto-masking" + bl_ui_units_x = 10 + + def draw(self, context): + layout = self.layout + + tool_settings = context.scene.tool_settings + layout.label(text="Auto-masking") + + col = layout.column(align=True) + col.prop(tool_settings.gpencil_sculpt, "use_automasking_stroke", text="Stroke") + col.prop(tool_settings.gpencil_sculpt, "use_automasking_layer_stroke", text="Layer") + col.prop(tool_settings.gpencil_sculpt, "use_automasking_material_stroke", text="Material") + col.separator() + col.prop(tool_settings.gpencil_sculpt, "use_automasking_layer_active", text="Active Layer") + col.prop(tool_settings.gpencil_sculpt, "use_automasking_material_active", text="Active Material") + + class VIEW3D_PT_gpencil_sculpt_context_menu(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'WINDOW' @@ -8091,6 +8144,7 @@ classes = ( VIEW3D_MT_proportional_editing_falloff_pie, VIEW3D_MT_sculpt_mask_edit_pie, VIEW3D_MT_sculpt_automasking_pie, + VIEW3D_MT_sculpt_gpencil_automasking_pie, VIEW3D_MT_wpaint_vgroup_lock_pie, VIEW3D_MT_sculpt_face_sets_edit_pie, VIEW3D_MT_sculpt_curves, @@ -8105,6 +8159,7 @@ classes = ( VIEW3D_PT_annotation_onion, VIEW3D_PT_gpencil_multi_frame, VIEW3D_PT_gpencil_curve_edit, + VIEW3D_PT_gpencil_sculpt_automasking, VIEW3D_PT_quad_view, VIEW3D_PT_view3d_stereo, VIEW3D_PT_shading, diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index fec156580cf..111fb0d8bae 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1964,7 +1964,7 @@ class VIEW3D_PT_tools_grease_pencil_sculpt_brush_advanced(GreasePencilSculptAdva return False tool = brush.gpencil_sculpt_tool - return tool != 'CLONE' + return tool in {'SMOOTH', 'RANDOMIZE'} class VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover(GreasePencilSculptAdvancedPanel, View3DPanel, Panel): @@ -1982,7 +1982,7 @@ class VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover(GreasePencilSculptAdvan return False tool = brush.gpencil_sculpt_tool - return tool != 'CLONE' + return tool in {'SMOOTH', 'RANDOMIZE'} # Grease Pencil weight painting tools diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index a7150913290..4bffa5492b5 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -17,15 +17,15 @@ extern "C" { */ /* Blender major and minor version. */ -#define BLENDER_VERSION 304 +#define BLENDER_VERSION 305 /* Blender patch version for bugfix releases. */ #define BLENDER_VERSION_PATCH 0 /** Blender release cycle stage: alpha/beta/rc/release. */ -#define BLENDER_VERSION_CYCLE beta +#define BLENDER_VERSION_CYCLE alpha /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 6 +#define BLENDER_FILE_SUBVERSION 0 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index 4c7ff8c1813..a479dcb574d 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -11,6 +11,7 @@ #include <mutex> +#include "BLI_cache_mutex.hh" #include "BLI_float3x3.hh" #include "BLI_float4x4.hh" #include "BLI_generic_virtual_array.hh" @@ -80,17 +81,14 @@ class CurvesGeometryRuntime { */ mutable Vector<int> evaluated_offsets_cache; mutable Vector<int> bezier_evaluated_offsets; - mutable std::mutex offsets_cache_mutex; - mutable bool offsets_cache_dirty = true; + mutable CacheMutex offsets_cache_mutex; mutable Vector<curves::nurbs::BasisCache> nurbs_basis_cache; - mutable std::mutex nurbs_basis_cache_mutex; - mutable bool nurbs_basis_cache_dirty = true; + mutable CacheMutex nurbs_basis_cache_mutex; /** Cache of evaluated positions. */ mutable Vector<float3> evaluated_position_cache; - mutable std::mutex position_cache_mutex; - mutable bool position_cache_dirty = true; + mutable CacheMutex position_cache_mutex; /** * The evaluated positions result, using a separate span in case all curves are poly curves, * in which case a separate array of evaluated positions is unnecessary. @@ -103,18 +101,15 @@ class CurvesGeometryRuntime { * make slicing this array for a curve fast, an extra float is stored for every curve. */ mutable Vector<float> evaluated_length_cache; - mutable std::mutex length_cache_mutex; - mutable bool length_cache_dirty = true; + mutable CacheMutex length_cache_mutex; /** Direction of the curve at each evaluated point. */ mutable Vector<float3> evaluated_tangent_cache; - mutable std::mutex tangent_cache_mutex; - mutable bool tangent_cache_dirty = true; + mutable CacheMutex tangent_cache_mutex; /** Normal direction vectors for each evaluated point. */ mutable Vector<float3> evaluated_normal_cache; - mutable std::mutex normal_cache_mutex; - mutable bool normal_cache_dirty = true; + mutable CacheMutex normal_cache_mutex; }; /** @@ -909,13 +904,13 @@ inline int CurvesGeometry::evaluated_points_num() const inline IndexRange CurvesGeometry::evaluated_points_for_curve(int index) const { - BLI_assert(!this->runtime->offsets_cache_dirty); + BLI_assert(this->runtime->offsets_cache_mutex.is_cached()); return offsets_to_range(this->runtime->evaluated_offsets_cache.as_span(), index); } inline IndexRange CurvesGeometry::evaluated_points_for_curves(const IndexRange curves) const { - BLI_assert(!this->runtime->offsets_cache_dirty); + BLI_assert(this->runtime->offsets_cache_mutex.is_cached()); BLI_assert(this->curve_num > 0); const int offset = this->runtime->evaluated_offsets_cache[curves.start()]; const int offset_next = this->runtime->evaluated_offsets_cache[curves.one_after_last()]; @@ -940,7 +935,7 @@ inline IndexRange CurvesGeometry::lengths_range_for_curve(const int curve_index, inline Span<float> CurvesGeometry::evaluated_lengths_for_curve(const int curve_index, const bool cyclic) const { - BLI_assert(!this->runtime->length_cache_dirty); + BLI_assert(this->runtime->length_cache_mutex.is_cached()); const IndexRange range = this->lengths_range_for_curve(curve_index, cyclic); return this->runtime->evaluated_length_cache.as_span().slice(range); } diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index f761e28cbb4..1cdd3c02d8d 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -552,7 +552,6 @@ bool CustomData_verify_versions(struct CustomData *data, int index); /* BMesh specific custom-data stuff. */ -void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct CustomData *ldata); void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, char htype); /** diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h index 109d3e6d977..431bc11b07f 100644 --- a/source/blender/blenkernel/BKE_dynamicpaint.h +++ b/source/blender/blenkernel/BKE_dynamicpaint.h @@ -119,7 +119,7 @@ struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings int dynamicPaint_createUVSurface(struct Scene *scene, struct DynamicPaintSurface *surface, float *progress, - short *do_update); + bool *do_update); /** * Calculate a single frame and included sub-frames for surface. */ diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 0ff7f50f71c..8f6786d4113 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -307,8 +307,6 @@ void BKE_mesh_translate(struct Mesh *me, const float offset[3], bool do_keys); void BKE_mesh_tessface_clear(struct Mesh *mesh); -void BKE_mesh_do_versions_cd_flag_init(struct Mesh *mesh); - void BKE_mesh_mselect_clear(struct Mesh *me); void BKE_mesh_mselect_validate(struct Mesh *me); /** @@ -974,11 +972,6 @@ void BKE_mesh_strip_loose_faces(struct Mesh *me); void BKE_mesh_strip_loose_polysloops(struct Mesh *me); void BKE_mesh_strip_loose_edges(struct Mesh *me); -/** - * If the mesh is from a very old blender version, - * convert #MFace.edcode to edge #ME_EDGEDRAW. - */ -void BKE_mesh_calc_edges_legacy(struct Mesh *me, bool use_old); void BKE_mesh_calc_edges_loose(struct Mesh *mesh); /** * Calculate edges from polygons. diff --git a/source/blender/blenkernel/BKE_mesh_legacy_convert.h b/source/blender/blenkernel/BKE_mesh_legacy_convert.h index 92182f8045b..5eae7bf3b22 100644 --- a/source/blender/blenkernel/BKE_mesh_legacy_convert.h +++ b/source/blender/blenkernel/BKE_mesh_legacy_convert.h @@ -95,8 +95,6 @@ void BKE_mesh_tessface_calc(struct Mesh *mesh); void BKE_mesh_tessface_ensure(struct Mesh *mesh); -void BKE_mesh_add_mface_layers(struct CustomData *fdata, struct CustomData *ldata, int total); - /** * Rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0. * this is necessary to make the if #MFace.v4 check for quads work. @@ -123,6 +121,13 @@ void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh); */ void BKE_mesh_do_versions_convert_mfaces_to_mpolys(struct Mesh *mesh); +/** + * Convert legacy #MFace.edcode to edge #ME_EDGEDRAW. + */ +void BKE_mesh_calc_edges_legacy(struct Mesh *me, bool use_old); + +void BKE_mesh_do_versions_cd_flag_init(struct Mesh *mesh); + /* Inlines */ /* NOTE(@sybren): Instead of -1 that function uses ORIGINDEX_NONE as defined in BKE_customdata.h, diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 6eb9650348a..4d883f9e31e 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -988,8 +988,6 @@ void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *outputs); void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth); void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size); -void node_type_init(struct bNodeType *ntype, - void (*initfunc)(struct bNodeTree *ntree, struct bNode *node)); /** * \warning Nodes defining a storage type _must_ allocate this for new nodes. * Otherwise nodes will reload as undefined (T46619). @@ -1000,17 +998,6 @@ void node_type_storage(struct bNodeType *ntype, void (*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node)); -void node_type_update(struct bNodeType *ntype, - void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node)); -void node_type_group_update(struct bNodeType *ntype, - void (*group_update_func)(struct bNodeTree *ntree, - struct bNode *node)); - -void node_type_exec(struct bNodeType *ntype, - NodeInitExecFunction init_exec_fn, - NodeFreeExecFunction free_exec_fn, - NodeExecFunction exec_fn); -void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn); /** \} */ @@ -1018,7 +1005,7 @@ void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn); /** \name Node Generic Functions * \{ */ -bool BKE_node_is_connected_to_output(struct bNodeTree *ntree, struct bNode *node); +bool BKE_node_is_connected_to_output(const struct bNodeTree *ntree, const struct bNode *node); /* ************** COMMON NODES *************** */ @@ -1033,8 +1020,6 @@ bool BKE_node_is_connected_to_output(struct bNodeTree *ntree, struct bNode *node #define NODE_GROUP_OUTPUT 8 #define NODE_CUSTOM_GROUP 9 -void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree); - /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 11c37a74a54..f0bb530e32b 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -170,7 +170,7 @@ int BKE_sound_scene_playing(struct Scene *scene); void BKE_sound_free_waveform(struct bSound *sound); -void BKE_sound_read_waveform(struct Main *bmain, struct bSound *sound, short *stop); +void BKE_sound_read_waveform(struct Main *bmain, struct bSound *sound, bool *stop); void BKE_sound_update_scene(struct Depsgraph *depsgraph, struct Scene *scene); diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index 89f30ce8ef8..70c1049b5d7 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -657,8 +657,8 @@ void BKE_tracking_reconstruction_context_free(struct MovieReconstructContext *co * callback in libmv side and passing to an interface. */ void BKE_tracking_reconstruction_solve(struct MovieReconstructContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress, char *stats_message, int message_size); diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc index ecf3be9bd81..3a86068d8e8 100644 --- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc +++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc @@ -71,7 +71,7 @@ static void fill_mesh_topology(const int vert_offset, MEdge &edge = edges[profile_edge_offset + i_ring]; edge.v1 = ring_vert_offset + i_profile; edge.v2 = next_ring_vert_offset + i_profile; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } @@ -87,7 +87,7 @@ static void fill_mesh_topology(const int vert_offset, MEdge &edge = edges[ring_edge_offset + i_profile]; edge.v1 = ring_vert_offset + i_profile; edge.v2 = ring_vert_offset + i_next_profile; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index 7c338480c71..43bdb8e7b8c 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -511,17 +511,7 @@ static void calculate_evaluated_offsets(const CurvesGeometry &curves, void CurvesGeometry::ensure_evaluated_offsets() const { - if (!this->runtime->offsets_cache_dirty) { - return; - } - - /* A double checked lock. */ - std::scoped_lock lock{this->runtime->offsets_cache_mutex}; - if (!this->runtime->offsets_cache_dirty) { - return; - } - - threading::isolate_task([&]() { + this->runtime->offsets_cache_mutex.ensure([&]() { this->runtime->evaluated_offsets_cache.resize(this->curves_num() + 1); if (this->has_curve_with_type(CURVE_TYPE_BEZIER)) { @@ -534,8 +524,6 @@ void CurvesGeometry::ensure_evaluated_offsets() const calculate_evaluated_offsets( *this, this->runtime->evaluated_offsets_cache, this->runtime->bezier_evaluated_offsets); }); - - this->runtime->offsets_cache_dirty = false; } Span<int> CurvesGeometry::evaluated_offsets() const @@ -569,17 +557,7 @@ Array<int> CurvesGeometry::point_to_curve_map() const void CurvesGeometry::ensure_nurbs_basis_cache() const { - if (!this->runtime->nurbs_basis_cache_dirty) { - return; - } - - /* A double checked lock. */ - std::scoped_lock lock{this->runtime->nurbs_basis_cache_mutex}; - if (!this->runtime->nurbs_basis_cache_dirty) { - return; - } - - threading::isolate_task([&]() { + this->runtime->nurbs_basis_cache_mutex.ensure([&]() { Vector<int64_t> nurbs_indices; const IndexMask nurbs_mask = this->indices_for_curve_type(CURVE_TYPE_NURBS, nurbs_indices); if (nurbs_mask.is_empty()) { @@ -619,23 +597,11 @@ void CurvesGeometry::ensure_nurbs_basis_cache() const } }); }); - - this->runtime->nurbs_basis_cache_dirty = false; } Span<float3> CurvesGeometry::evaluated_positions() const { - if (!this->runtime->position_cache_dirty) { - return this->runtime->evaluated_positions_span; - } - - /* A double checked lock. */ - std::scoped_lock lock{this->runtime->position_cache_mutex}; - if (!this->runtime->position_cache_dirty) { - return this->runtime->evaluated_positions_span; - } - - threading::isolate_task([&]() { + this->runtime->position_cache_mutex.ensure([&]() { if (this->is_single_type(CURVE_TYPE_POLY)) { this->runtime->evaluated_positions_span = this->positions(); this->runtime->evaluated_position_cache.clear_and_make_inline(); @@ -699,24 +665,12 @@ Span<float3> CurvesGeometry::evaluated_positions() const } }); }); - - this->runtime->position_cache_dirty = false; return this->runtime->evaluated_positions_span; } Span<float3> CurvesGeometry::evaluated_tangents() const { - if (!this->runtime->tangent_cache_dirty) { - return this->runtime->evaluated_tangent_cache; - } - - /* A double checked lock. */ - std::scoped_lock lock{this->runtime->tangent_cache_mutex}; - if (!this->runtime->tangent_cache_dirty) { - return this->runtime->evaluated_tangent_cache; - } - - threading::isolate_task([&]() { + this->runtime->tangent_cache_mutex.ensure([&]() { const Span<float3> evaluated_positions = this->evaluated_positions(); const VArray<bool> cyclic = this->cyclic(); @@ -732,9 +686,9 @@ Span<float3> CurvesGeometry::evaluated_tangents() const } }); - /* Correct the first and last tangents of non-cyclic Bezier curves so that they align with the - * inner handles. This is a separate loop to avoid the cost when Bezier type curves are not - * used. */ + /* Correct the first and last tangents of non-cyclic Bezier curves so that they align with + * the inner handles. This is a separate loop to avoid the cost when Bezier type curves are + * not used. */ Vector<int64_t> bezier_indices; const IndexMask bezier_mask = this->indices_for_curve_type(CURVE_TYPE_BEZIER, bezier_indices); if (!bezier_mask.is_empty()) { @@ -765,8 +719,6 @@ Span<float3> CurvesGeometry::evaluated_tangents() const }); } }); - - this->runtime->tangent_cache_dirty = false; return this->runtime->evaluated_tangent_cache; } @@ -781,17 +733,7 @@ static void rotate_directions_around_axes(MutableSpan<float3> directions, Span<float3> CurvesGeometry::evaluated_normals() const { - if (!this->runtime->normal_cache_dirty) { - return this->runtime->evaluated_normal_cache; - } - - /* A double checked lock. */ - std::scoped_lock lock{this->runtime->normal_cache_mutex}; - if (!this->runtime->normal_cache_dirty) { - return this->runtime->evaluated_normal_cache; - } - - threading::isolate_task([&]() { + this->runtime->normal_cache_mutex.ensure([&]() { const Span<float3> evaluated_tangents = this->evaluated_tangents(); const VArray<bool> cyclic = this->cyclic(); const VArray<int8_t> normal_mode = this->normal_mode(); @@ -842,8 +784,6 @@ Span<float3> CurvesGeometry::evaluated_normals() const } }); }); - - this->runtime->normal_cache_dirty = false; return this->runtime->evaluated_normal_cache; } @@ -851,8 +791,8 @@ void CurvesGeometry::interpolate_to_evaluated(const int curve_index, const GSpan src, GMutableSpan dst) const { - BLI_assert(!this->runtime->offsets_cache_dirty); - BLI_assert(!this->runtime->nurbs_basis_cache_dirty); + BLI_assert(this->runtime->offsets_cache_mutex.is_cached()); + BLI_assert(this->runtime->nurbs_basis_cache_mutex.is_cached()); const IndexRange points = this->points_for_curve(curve_index); BLI_assert(src.size() == points.size()); BLI_assert(dst.size() == this->evaluated_points_for_curve(curve_index).size()); @@ -881,8 +821,8 @@ void CurvesGeometry::interpolate_to_evaluated(const int curve_index, void CurvesGeometry::interpolate_to_evaluated(const GSpan src, GMutableSpan dst) const { - BLI_assert(!this->runtime->offsets_cache_dirty); - BLI_assert(!this->runtime->nurbs_basis_cache_dirty); + BLI_assert(this->runtime->offsets_cache_mutex.is_cached()); + BLI_assert(this->runtime->nurbs_basis_cache_mutex.is_cached()); const VArray<int8_t> types = this->curve_types(); const VArray<int> resolution = this->resolution(); const VArray<bool> cyclic = this->cyclic(); @@ -923,17 +863,7 @@ void CurvesGeometry::interpolate_to_evaluated(const GSpan src, GMutableSpan dst) void CurvesGeometry::ensure_evaluated_lengths() const { - if (!this->runtime->length_cache_dirty) { - return; - } - - /* A double checked lock. */ - std::scoped_lock lock{this->runtime->length_cache_mutex}; - if (!this->runtime->length_cache_dirty) { - return; - } - - threading::isolate_task([&]() { + this->runtime->length_cache_mutex.ensure([&]() { /* Use an extra length value for the final cyclic segment for a consistent size * (see comment on #evaluated_length_cache). */ const int total_num = this->evaluated_points_num() + this->curves_num(); @@ -954,8 +884,6 @@ void CurvesGeometry::ensure_evaluated_lengths() const } }); }); - - this->runtime->length_cache_dirty = false; } void CurvesGeometry::ensure_can_interpolate_to_evaluated() const @@ -986,23 +914,23 @@ void CurvesGeometry::resize(const int points_num, const int curves_num) void CurvesGeometry::tag_positions_changed() { - this->runtime->position_cache_dirty = true; - this->runtime->tangent_cache_dirty = true; - this->runtime->normal_cache_dirty = true; - this->runtime->length_cache_dirty = true; + this->runtime->position_cache_mutex.tag_dirty(); + this->runtime->tangent_cache_mutex.tag_dirty(); + this->runtime->normal_cache_mutex.tag_dirty(); + this->runtime->length_cache_mutex.tag_dirty(); } void CurvesGeometry::tag_topology_changed() { - this->runtime->position_cache_dirty = true; - this->runtime->tangent_cache_dirty = true; - this->runtime->normal_cache_dirty = true; - this->runtime->offsets_cache_dirty = true; - this->runtime->nurbs_basis_cache_dirty = true; - this->runtime->length_cache_dirty = true; + this->runtime->position_cache_mutex.tag_dirty(); + this->runtime->tangent_cache_mutex.tag_dirty(); + this->runtime->normal_cache_mutex.tag_dirty(); + this->runtime->offsets_cache_mutex.tag_dirty(); + this->runtime->nurbs_basis_cache_mutex.tag_dirty(); + this->runtime->length_cache_mutex.tag_dirty(); } void CurvesGeometry::tag_normals_changed() { - this->runtime->normal_cache_dirty = true; + this->runtime->normal_cache_mutex.tag_dirty(); } static void translate_positions(MutableSpan<float3> positions, const float3 &translation) diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index 01017466764..84aa2207400 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -3607,39 +3607,6 @@ const char *CustomData_get_layer_name(const CustomData *data, const int type, co /* BMesh functions */ -void CustomData_bmesh_update_active_layers(CustomData *fdata, CustomData *ldata) -{ - int act; - - if (CustomData_has_layer(ldata, CD_MLOOPUV)) { - act = CustomData_get_active_layer(ldata, CD_MLOOPUV); - CustomData_set_layer_active(fdata, CD_MTFACE, act); - - act = CustomData_get_render_layer(ldata, CD_MLOOPUV); - CustomData_set_layer_render(fdata, CD_MTFACE, act); - - act = CustomData_get_clone_layer(ldata, CD_MLOOPUV); - CustomData_set_layer_clone(fdata, CD_MTFACE, act); - - act = CustomData_get_stencil_layer(ldata, CD_MLOOPUV); - CustomData_set_layer_stencil(fdata, CD_MTFACE, act); - } - - if (CustomData_has_layer(ldata, CD_PROP_BYTE_COLOR)) { - act = CustomData_get_active_layer(ldata, CD_PROP_BYTE_COLOR); - CustomData_set_layer_active(fdata, CD_MCOL, act); - - act = CustomData_get_render_layer(ldata, CD_PROP_BYTE_COLOR); - CustomData_set_layer_render(fdata, CD_MCOL, act); - - act = CustomData_get_clone_layer(ldata, CD_PROP_BYTE_COLOR); - CustomData_set_layer_clone(fdata, CD_MCOL, act); - - act = CustomData_get_stencil_layer(ldata, CD_PROP_BYTE_COLOR); - CustomData_set_layer_stencil(fdata, CD_MCOL, act); - } -} - void CustomData_bmesh_init_pool(CustomData *data, const int totelem, const char htype) { int chunksize; diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index b9cec17b6e0..e0ae3f42be6 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -2790,7 +2790,7 @@ static bool dynamicPaint_symmetrizeAdjData(PaintAdjData *ed, int active_points) int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, float *progress, - short *do_update) + bool *do_update) { /* Antialias jitter point relative coords */ const int aa_samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1; diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc index 0018c217964..2d613f24a0a 100644 --- a/source/blender/blenkernel/intern/mesh.cc +++ b/source/blender/blenkernel/intern/mesh.cc @@ -1608,38 +1608,6 @@ void BKE_mesh_tessface_clear(Mesh *mesh) mesh_tessface_clear_intern(mesh, true); } -void BKE_mesh_do_versions_cd_flag_init(Mesh *mesh) -{ - if (UNLIKELY(mesh->cd_flag)) { - return; - } - - const Span<MVert> verts = mesh->verts(); - const Span<MEdge> edges = mesh->edges(); - - for (const MVert &vert : verts) { - if (vert.bweight_legacy != 0) { - mesh->cd_flag |= ME_CDFLAG_VERT_BWEIGHT; - break; - } - } - - for (const MEdge &edge : edges) { - if (edge.bweight_legacy != 0) { - mesh->cd_flag |= ME_CDFLAG_EDGE_BWEIGHT; - if (mesh->cd_flag & ME_CDFLAG_EDGE_CREASE) { - break; - } - } - if (edge.crease_legacy != 0) { - mesh->cd_flag |= ME_CDFLAG_EDGE_CREASE; - if (mesh->cd_flag & ME_CDFLAG_EDGE_BWEIGHT) { - break; - } - } - } -} - /* -------------------------------------------------------------------- */ /* MSelect functions (currently used in weight paint mode) */ diff --git a/source/blender/blenkernel/intern/mesh_calc_edges.cc b/source/blender/blenkernel/intern/mesh_calc_edges.cc index 5e6babdf7b4..4a4c2ebcbb0 100644 --- a/source/blender/blenkernel/intern/mesh_calc_edges.cc +++ b/source/blender/blenkernel/intern/mesh_calc_edges.cc @@ -146,7 +146,7 @@ static void serialize_and_initialize_deduplicated_edges(MutableSpan<EdgeMap> edg /* Initialize new edge. */ new_edge.v1 = item.key.v_low; new_edge.v2 = item.key.v_high; - new_edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + new_edge.flag = ME_EDGEDRAW; } item.value.index = new_edge_index; new_edge_index++; diff --git a/source/blender/blenkernel/intern/mesh_convert.cc b/source/blender/blenkernel/intern/mesh_convert.cc index 784d35a8d65..2255038a991 100644 --- a/source/blender/blenkernel/intern/mesh_convert.cc +++ b/source/blender/blenkernel/intern/mesh_convert.cc @@ -119,7 +119,7 @@ static void make_edges_mdata_extend(Mesh &mesh) BLI_edgehashIterator_getKey(ehi, &medge->v1, &medge->v2); BLI_edgehashIterator_setValue(ehi, POINTER_FROM_UINT(e_index)); - medge->flag = ME_EDGEDRAW | ME_EDGERENDER; + medge->flag = ME_EDGEDRAW; } BLI_edgehashIterator_free(ehi); @@ -223,7 +223,7 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba for (b = 1; b < dl->nr; b++) { medge->v1 = startvert + ofs + b - 1; medge->v2 = startvert + ofs + b; - medge->flag = ME_LOOSEEDGE | ME_EDGERENDER | ME_EDGEDRAW; + medge->flag = ME_LOOSEEDGE | ME_EDGEDRAW; medge++; } @@ -251,7 +251,7 @@ static Mesh *mesh_nurbs_displist_to_mesh(const Curve *cu, const ListBase *dispba else { medge->v2 = startvert + ofs + b + 1; } - medge->flag = ME_LOOSEEDGE | ME_EDGERENDER | ME_EDGEDRAW; + medge->flag = ME_LOOSEEDGE | ME_EDGEDRAW; medge++; } } @@ -706,7 +706,7 @@ void BKE_mesh_edges_set_draw_render(Mesh *mesh) { MutableSpan<MEdge> edges = mesh->edges_for_write(); for (int i = 0; i < mesh->totedge; i++) { - edges[i].flag |= ME_EDGEDRAW | ME_EDGERENDER; + edges[i].flag |= ME_EDGEDRAW; } } diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc index df3057d9592..23426f8c087 100644 --- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc +++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc @@ -30,6 +30,258 @@ #include "BKE_multires.h" /* -------------------------------------------------------------------- */ +/** \name Legacy Edge Calculation + * \{ */ + +struct EdgeSort { + uint v1, v2; + char is_loose, is_draw; +}; + +/* edges have to be added with lowest index first for sorting */ +static void to_edgesort(struct EdgeSort *ed, uint v1, uint v2, char is_loose, short is_draw) +{ + if (v1 < v2) { + ed->v1 = v1; + ed->v2 = v2; + } + else { + ed->v1 = v2; + ed->v2 = v1; + } + ed->is_loose = is_loose; + ed->is_draw = is_draw; +} + +static int vergedgesort(const void *v1, const void *v2) +{ + const struct EdgeSort *x1 = static_cast<const struct EdgeSort *>(v1); + const struct EdgeSort *x2 = static_cast<const struct EdgeSort *>(v2); + + if (x1->v1 > x2->v1) { + return 1; + } + if (x1->v1 < x2->v1) { + return -1; + } + if (x1->v2 > x2->v2) { + return 1; + } + if (x1->v2 < x2->v2) { + return -1; + } + + return 0; +} + +/* Create edges based on known verts and faces, + * this function is only used when loading very old blend files */ +static void mesh_calc_edges_mdata(const MVert * /*allvert*/, + const MFace *allface, + MLoop *allloop, + const MPoly *allpoly, + int /*totvert*/, + int totface, + int /*totloop*/, + int totpoly, + const bool use_old, + MEdge **r_medge, + int *r_totedge) +{ + const MPoly *mpoly; + const MFace *mface; + MEdge *medge, *med; + EdgeHash *hash; + struct EdgeSort *edsort, *ed; + int a, totedge = 0; + uint totedge_final = 0; + uint edge_index; + + /* we put all edges in array, sort them, and detect doubles that way */ + + for (a = totface, mface = allface; a > 0; a--, mface++) { + if (mface->v4) { + totedge += 4; + } + else if (mface->v3) { + totedge += 3; + } + else { + totedge += 1; + } + } + + if (totedge == 0) { + /* flag that mesh has edges */ + (*r_medge) = (MEdge *)MEM_callocN(0, __func__); + (*r_totedge) = 0; + return; + } + + ed = edsort = (EdgeSort *)MEM_mallocN(totedge * sizeof(struct EdgeSort), "EdgeSort"); + + for (a = totface, mface = allface; a > 0; a--, mface++) { + to_edgesort(ed++, mface->v1, mface->v2, !mface->v3, mface->edcode & ME_V1V2); + if (mface->v4) { + to_edgesort(ed++, mface->v2, mface->v3, 0, mface->edcode & ME_V2V3); + to_edgesort(ed++, mface->v3, mface->v4, 0, mface->edcode & ME_V3V4); + to_edgesort(ed++, mface->v4, mface->v1, 0, mface->edcode & ME_V4V1); + } + else if (mface->v3) { + to_edgesort(ed++, mface->v2, mface->v3, 0, mface->edcode & ME_V2V3); + to_edgesort(ed++, mface->v3, mface->v1, 0, mface->edcode & ME_V3V1); + } + } + + qsort(edsort, totedge, sizeof(struct EdgeSort), vergedgesort); + + /* count final amount */ + for (a = totedge, ed = edsort; a > 1; a--, ed++) { + /* edge is unique when it differs from next edge, or is last */ + if (ed->v1 != (ed + 1)->v1 || ed->v2 != (ed + 1)->v2) { + totedge_final++; + } + } + totedge_final++; + + medge = (MEdge *)MEM_callocN(sizeof(MEdge) * totedge_final, __func__); + + for (a = totedge, med = medge, ed = edsort; a > 1; a--, ed++) { + /* edge is unique when it differs from next edge, or is last */ + if (ed->v1 != (ed + 1)->v1 || ed->v2 != (ed + 1)->v2) { + med->v1 = ed->v1; + med->v2 = ed->v2; + if (use_old == false || ed->is_draw) { + med->flag = ME_EDGEDRAW; + } + if (ed->is_loose) { + med->flag |= ME_LOOSEEDGE; + } + + /* order is swapped so extruding this edge as a surface won't flip face normals + * with cyclic curves */ + if (ed->v1 + 1 != ed->v2) { + SWAP(uint, med->v1, med->v2); + } + med++; + } + else { + /* Equal edge, merge the draw-flag. */ + (ed + 1)->is_draw |= ed->is_draw; + } + } + /* last edge */ + med->v1 = ed->v1; + med->v2 = ed->v2; + med->flag = ME_EDGEDRAW; + if (ed->is_loose) { + med->flag |= ME_LOOSEEDGE; + } + + MEM_freeN(edsort); + + /* set edge members of mloops */ + hash = BLI_edgehash_new_ex(__func__, totedge_final); + for (edge_index = 0, med = medge; edge_index < totedge_final; edge_index++, med++) { + BLI_edgehash_insert(hash, med->v1, med->v2, POINTER_FROM_UINT(edge_index)); + } + + mpoly = allpoly; + for (a = 0; a < totpoly; a++, mpoly++) { + MLoop *ml, *ml_next; + int i = mpoly->totloop; + + ml_next = allloop + mpoly->loopstart; /* first loop */ + ml = &ml_next[i - 1]; /* last loop */ + + while (i-- != 0) { + ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(hash, ml->v, ml_next->v)); + ml = ml_next; + ml_next++; + } + } + + BLI_edgehash_free(hash, nullptr); + + *r_medge = medge; + *r_totedge = totedge_final; +} + +void BKE_mesh_calc_edges_legacy(Mesh *me, const bool use_old) +{ + using namespace blender; + MEdge *medge; + int totedge = 0; + const Span<MVert> verts = me->verts(); + const Span<MPoly> polys = me->polys(); + MutableSpan<MLoop> loops = me->loops_for_write(); + + mesh_calc_edges_mdata(verts.data(), + (MFace *)CustomData_get_layer(&me->fdata, CD_MFACE), + loops.data(), + polys.data(), + verts.size(), + me->totface, + loops.size(), + polys.size(), + use_old, + &medge, + &totedge); + + if (totedge == 0) { + /* flag that mesh has edges */ + me->totedge = 0; + return; + } + + medge = (MEdge *)CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, medge, totedge); + me->totedge = totedge; + + BKE_mesh_strip_loose_faces(me); +} + +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name CD Flag Initialization + * \{ */ + +void BKE_mesh_do_versions_cd_flag_init(Mesh *mesh) +{ + using namespace blender; + if (UNLIKELY(mesh->cd_flag)) { + return; + } + + const Span<MVert> verts = mesh->verts(); + const Span<MEdge> edges = mesh->edges(); + + for (const MVert &vert : verts) { + if (vert.bweight_legacy != 0) { + mesh->cd_flag |= ME_CDFLAG_VERT_BWEIGHT; + break; + } + } + + for (const MEdge &edge : edges) { + if (edge.bweight_legacy != 0) { + mesh->cd_flag |= ME_CDFLAG_EDGE_BWEIGHT; + if (mesh->cd_flag & ME_CDFLAG_EDGE_CREASE) { + break; + } + } + if (edge.crease_legacy != 0) { + mesh->cd_flag |= ME_CDFLAG_EDGE_CREASE; + if (mesh->cd_flag & ME_CDFLAG_EDGE_BWEIGHT) { + break; + } + } + } +} + +/** \} */ + +/* -------------------------------------------------------------------- */ /** \name NGon Tessellation (NGon to MFace Conversion) * \{ */ @@ -278,6 +530,115 @@ static void convert_mfaces_to_mpolys(ID *id, #undef ME_FGON } +static void update_active_fdata_layers(CustomData *fdata, CustomData *ldata) +{ + int act; + + if (CustomData_has_layer(ldata, CD_MLOOPUV)) { + act = CustomData_get_active_layer(ldata, CD_MLOOPUV); + CustomData_set_layer_active(fdata, CD_MTFACE, act); + + act = CustomData_get_render_layer(ldata, CD_MLOOPUV); + CustomData_set_layer_render(fdata, CD_MTFACE, act); + + act = CustomData_get_clone_layer(ldata, CD_MLOOPUV); + CustomData_set_layer_clone(fdata, CD_MTFACE, act); + + act = CustomData_get_stencil_layer(ldata, CD_MLOOPUV); + CustomData_set_layer_stencil(fdata, CD_MTFACE, act); + } + + if (CustomData_has_layer(ldata, CD_PROP_BYTE_COLOR)) { + act = CustomData_get_active_layer(ldata, CD_PROP_BYTE_COLOR); + CustomData_set_layer_active(fdata, CD_MCOL, act); + + act = CustomData_get_render_layer(ldata, CD_PROP_BYTE_COLOR); + CustomData_set_layer_render(fdata, CD_MCOL, act); + + act = CustomData_get_clone_layer(ldata, CD_PROP_BYTE_COLOR); + CustomData_set_layer_clone(fdata, CD_MCOL, act); + + act = CustomData_get_stencil_layer(ldata, CD_PROP_BYTE_COLOR); + CustomData_set_layer_stencil(fdata, CD_MCOL, act); + } +} + +#ifndef NDEBUG +/** + * Debug check, used to assert when we expect layers to be in/out of sync. + * + * \param fallback: Use when there are no layers to handle, + * since callers may expect success or failure. + */ +static bool check_matching_legacy_layer_counts(CustomData *fdata, CustomData *ldata, bool fallback) +{ + int a_num = 0, b_num = 0; +# define LAYER_CMP(l_a, t_a, l_b, t_b) \ + ((a_num += CustomData_number_of_layers(l_a, t_a)) == \ + (b_num += CustomData_number_of_layers(l_b, t_b))) + + if (!LAYER_CMP(ldata, CD_MLOOPUV, fdata, CD_MTFACE)) { + return false; + } + if (!LAYER_CMP(ldata, CD_PROP_BYTE_COLOR, fdata, CD_MCOL)) { + return false; + } + if (!LAYER_CMP(ldata, CD_PREVIEW_MLOOPCOL, fdata, CD_PREVIEW_MCOL)) { + return false; + } + if (!LAYER_CMP(ldata, CD_ORIGSPACE_MLOOP, fdata, CD_ORIGSPACE)) { + return false; + } + if (!LAYER_CMP(ldata, CD_NORMAL, fdata, CD_TESSLOOPNORMAL)) { + return false; + } + if (!LAYER_CMP(ldata, CD_TANGENT, fdata, CD_TANGENT)) { + return false; + } + +# undef LAYER_CMP + + /* if no layers are on either CustomData's, + * then there was nothing to do... */ + return a_num ? true : fallback; +} +#endif + +static void add_mface_layers(CustomData *fdata, CustomData *ldata, int total) +{ + /* avoid accumulating extra layers */ + BLI_assert(!check_matching_legacy_layer_counts(fdata, ldata, false)); + + for (int i = 0; i < ldata->totlayer; i++) { + if (ldata->layers[i].type == CD_MLOOPUV) { + CustomData_add_layer_named( + fdata, CD_MTFACE, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); + } + if (ldata->layers[i].type == CD_PROP_BYTE_COLOR) { + CustomData_add_layer_named( + fdata, CD_MCOL, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); + } + else if (ldata->layers[i].type == CD_PREVIEW_MLOOPCOL) { + CustomData_add_layer_named( + fdata, CD_PREVIEW_MCOL, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); + } + else if (ldata->layers[i].type == CD_ORIGSPACE_MLOOP) { + CustomData_add_layer_named( + fdata, CD_ORIGSPACE, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); + } + else if (ldata->layers[i].type == CD_NORMAL) { + CustomData_add_layer_named( + fdata, CD_TESSLOOPNORMAL, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); + } + else if (ldata->layers[i].type == CD_TANGENT) { + CustomData_add_layer_named( + fdata, CD_TANGENT, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); + } + } + + update_active_fdata_layers(fdata, ldata); +} + static void mesh_ensure_tessellation_customdata(Mesh *me) { if (UNLIKELY((me->totface != 0) && (me->totpoly == 0))) { @@ -296,7 +657,7 @@ static void mesh_ensure_tessellation_customdata(Mesh *me) if (tottex_tessface != tottex_original || totcol_tessface != totcol_original) { BKE_mesh_tessface_clear(me); - BKE_mesh_add_mface_layers(&me->fdata, &me->ldata, me->totface); + add_mface_layers(&me->fdata, &me->ldata, me->totface); /* TODO: add some `--debug-mesh` option. */ if (G.debug & G_DEBUG) { @@ -784,7 +1145,7 @@ static int mesh_tessface_calc(CustomData *fdata, /* #CD_ORIGINDEX will contain an array of indices from tessellation-faces to the polygons * they are directly tessellated from. */ CustomData_add_layer(fdata, CD_ORIGINDEX, CD_ASSIGN, mface_to_poly_map, totface); - BKE_mesh_add_mface_layers(fdata, ldata, totface); + add_mface_layers(fdata, ldata, totface); /* NOTE: quad detection issue - fourth vertidx vs fourth loopidx: * Polygons take care of their loops ordering, hence not of their vertices ordering. @@ -840,82 +1201,6 @@ void BKE_mesh_tessface_ensure(struct Mesh *mesh) } } -#ifndef NDEBUG -/** - * Debug check, used to assert when we expect layers to be in/out of sync. - * - * \param fallback: Use when there are no layers to handle, - * since callers may expect success or failure. - */ -static bool check_matching_legacy_layer_counts(CustomData *fdata, CustomData *ldata, bool fallback) -{ - int a_num = 0, b_num = 0; -# define LAYER_CMP(l_a, t_a, l_b, t_b) \ - ((a_num += CustomData_number_of_layers(l_a, t_a)) == \ - (b_num += CustomData_number_of_layers(l_b, t_b))) - - if (!LAYER_CMP(ldata, CD_MLOOPUV, fdata, CD_MTFACE)) { - return false; - } - if (!LAYER_CMP(ldata, CD_PROP_BYTE_COLOR, fdata, CD_MCOL)) { - return false; - } - if (!LAYER_CMP(ldata, CD_PREVIEW_MLOOPCOL, fdata, CD_PREVIEW_MCOL)) { - return false; - } - if (!LAYER_CMP(ldata, CD_ORIGSPACE_MLOOP, fdata, CD_ORIGSPACE)) { - return false; - } - if (!LAYER_CMP(ldata, CD_NORMAL, fdata, CD_TESSLOOPNORMAL)) { - return false; - } - if (!LAYER_CMP(ldata, CD_TANGENT, fdata, CD_TANGENT)) { - return false; - } - -# undef LAYER_CMP - - /* if no layers are on either CustomData's, - * then there was nothing to do... */ - return a_num ? true : fallback; -} -#endif - -void BKE_mesh_add_mface_layers(CustomData *fdata, CustomData *ldata, int total) -{ - /* avoid accumulating extra layers */ - BLI_assert(!check_matching_legacy_layer_counts(fdata, ldata, false)); - - for (int i = 0; i < ldata->totlayer; i++) { - if (ldata->layers[i].type == CD_MLOOPUV) { - CustomData_add_layer_named( - fdata, CD_MTFACE, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); - } - if (ldata->layers[i].type == CD_PROP_BYTE_COLOR) { - CustomData_add_layer_named( - fdata, CD_MCOL, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); - } - else if (ldata->layers[i].type == CD_PREVIEW_MLOOPCOL) { - CustomData_add_layer_named( - fdata, CD_PREVIEW_MCOL, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); - } - else if (ldata->layers[i].type == CD_ORIGSPACE_MLOOP) { - CustomData_add_layer_named( - fdata, CD_ORIGSPACE, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); - } - else if (ldata->layers[i].type == CD_NORMAL) { - CustomData_add_layer_named( - fdata, CD_TESSLOOPNORMAL, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); - } - else if (ldata->layers[i].type == CD_TANGENT) { - CustomData_add_layer_named( - fdata, CD_TANGENT, CD_SET_DEFAULT, nullptr, total, ldata->layers[i].name); - } - } - - CustomData_bmesh_update_active_layers(fdata, ldata); -} - /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc index f38efd2cf65..0887e26148a 100644 --- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc +++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc @@ -426,23 +426,18 @@ void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source) else { /* Lazily init vertex -> loop maps. */ if (!source_lmap) { - const MPoly *source_polys = (MPoly *)CustomData_get_layer(&source->pdata, CD_MPOLY); - const MLoop *source_loops = (MLoop *)CustomData_get_layer(&source->ldata, CD_MLOOP); - const MPoly *target_polys = (MPoly *)CustomData_get_layer(&target->pdata, CD_MPOLY); - const MLoop *target_loops = (MLoop *)CustomData_get_layer(&target->ldata, CD_MLOOP); - BKE_mesh_vert_loop_map_create(&source_lmap, &source_lmap_mem, - source_polys, - source_loops, + source->polys().data(), + source->loops().data(), source->totvert, source->totpoly, source->totloop); BKE_mesh_vert_loop_map_create(&target_lmap, &target_lmap_mem, - target_polys, - target_loops, + target->polys().data(), + target->loops().data(), target->totvert, target->totpoly, target->totloop); diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc index 9b140171912..9cd3b6e9e9e 100644 --- a/source/blender/blenkernel/intern/mesh_validate.cc +++ b/source/blender/blenkernel/intern/mesh_validate.cc @@ -1315,216 +1315,6 @@ void BKE_mesh_strip_loose_edges(Mesh *me) /** \name Mesh Edge Calculation * \{ */ -/* make edges in a Mesh, for outside of editmode */ - -struct EdgeSort { - uint v1, v2; - char is_loose, is_draw; -}; - -/* edges have to be added with lowest index first for sorting */ -static void to_edgesort(struct EdgeSort *ed, uint v1, uint v2, char is_loose, short is_draw) -{ - if (v1 < v2) { - ed->v1 = v1; - ed->v2 = v2; - } - else { - ed->v1 = v2; - ed->v2 = v1; - } - ed->is_loose = is_loose; - ed->is_draw = is_draw; -} - -static int vergedgesort(const void *v1, const void *v2) -{ - const struct EdgeSort *x1 = static_cast<const struct EdgeSort *>(v1); - const struct EdgeSort *x2 = static_cast<const struct EdgeSort *>(v2); - - if (x1->v1 > x2->v1) { - return 1; - } - if (x1->v1 < x2->v1) { - return -1; - } - if (x1->v2 > x2->v2) { - return 1; - } - if (x1->v2 < x2->v2) { - return -1; - } - - return 0; -} - -/* Create edges based on known verts and faces, - * this function is only used when loading very old blend files */ - -static void mesh_calc_edges_mdata(const MVert * /*allvert*/, - const MFace *allface, - MLoop *allloop, - const MPoly *allpoly, - int /*totvert*/, - int totface, - int /*totloop*/, - int totpoly, - const bool use_old, - MEdge **r_medge, - int *r_totedge) -{ - const MPoly *mpoly; - const MFace *mface; - MEdge *medge, *med; - EdgeHash *hash; - struct EdgeSort *edsort, *ed; - int a, totedge = 0; - uint totedge_final = 0; - uint edge_index; - - /* we put all edges in array, sort them, and detect doubles that way */ - - for (a = totface, mface = allface; a > 0; a--, mface++) { - if (mface->v4) { - totedge += 4; - } - else if (mface->v3) { - totedge += 3; - } - else { - totedge += 1; - } - } - - if (totedge == 0) { - /* flag that mesh has edges */ - (*r_medge) = (MEdge *)MEM_callocN(0, __func__); - (*r_totedge) = 0; - return; - } - - ed = edsort = (EdgeSort *)MEM_mallocN(totedge * sizeof(struct EdgeSort), "EdgeSort"); - - for (a = totface, mface = allface; a > 0; a--, mface++) { - to_edgesort(ed++, mface->v1, mface->v2, !mface->v3, mface->edcode & ME_V1V2); - if (mface->v4) { - to_edgesort(ed++, mface->v2, mface->v3, 0, mface->edcode & ME_V2V3); - to_edgesort(ed++, mface->v3, mface->v4, 0, mface->edcode & ME_V3V4); - to_edgesort(ed++, mface->v4, mface->v1, 0, mface->edcode & ME_V4V1); - } - else if (mface->v3) { - to_edgesort(ed++, mface->v2, mface->v3, 0, mface->edcode & ME_V2V3); - to_edgesort(ed++, mface->v3, mface->v1, 0, mface->edcode & ME_V3V1); - } - } - - qsort(edsort, totedge, sizeof(struct EdgeSort), vergedgesort); - - /* count final amount */ - for (a = totedge, ed = edsort; a > 1; a--, ed++) { - /* edge is unique when it differs from next edge, or is last */ - if (ed->v1 != (ed + 1)->v1 || ed->v2 != (ed + 1)->v2) { - totedge_final++; - } - } - totedge_final++; - - medge = (MEdge *)MEM_callocN(sizeof(MEdge) * totedge_final, __func__); - - for (a = totedge, med = medge, ed = edsort; a > 1; a--, ed++) { - /* edge is unique when it differs from next edge, or is last */ - if (ed->v1 != (ed + 1)->v1 || ed->v2 != (ed + 1)->v2) { - med->v1 = ed->v1; - med->v2 = ed->v2; - if (use_old == false || ed->is_draw) { - med->flag = ME_EDGEDRAW | ME_EDGERENDER; - } - if (ed->is_loose) { - med->flag |= ME_LOOSEEDGE; - } - - /* order is swapped so extruding this edge as a surface won't flip face normals - * with cyclic curves */ - if (ed->v1 + 1 != ed->v2) { - SWAP(uint, med->v1, med->v2); - } - med++; - } - else { - /* Equal edge, merge the draw-flag. */ - (ed + 1)->is_draw |= ed->is_draw; - } - } - /* last edge */ - med->v1 = ed->v1; - med->v2 = ed->v2; - med->flag = ME_EDGEDRAW; - if (ed->is_loose) { - med->flag |= ME_LOOSEEDGE; - } - med->flag |= ME_EDGERENDER; - - MEM_freeN(edsort); - - /* set edge members of mloops */ - hash = BLI_edgehash_new_ex(__func__, totedge_final); - for (edge_index = 0, med = medge; edge_index < totedge_final; edge_index++, med++) { - BLI_edgehash_insert(hash, med->v1, med->v2, POINTER_FROM_UINT(edge_index)); - } - - mpoly = allpoly; - for (a = 0; a < totpoly; a++, mpoly++) { - MLoop *ml, *ml_next; - int i = mpoly->totloop; - - ml_next = allloop + mpoly->loopstart; /* first loop */ - ml = &ml_next[i - 1]; /* last loop */ - - while (i-- != 0) { - ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(hash, ml->v, ml_next->v)); - ml = ml_next; - ml_next++; - } - } - - BLI_edgehash_free(hash, nullptr); - - *r_medge = medge; - *r_totedge = totedge_final; -} - -void BKE_mesh_calc_edges_legacy(Mesh *me, const bool use_old) -{ - MEdge *medge; - int totedge = 0; - const Span<MVert> verts = me->verts(); - const Span<MPoly> polys = me->polys(); - MutableSpan<MLoop> loops = me->loops_for_write(); - - mesh_calc_edges_mdata(verts.data(), - (MFace *)CustomData_get_layer(&me->fdata, CD_MFACE), - loops.data(), - polys.data(), - verts.size(), - me->totface, - loops.size(), - polys.size(), - use_old, - &medge, - &totedge); - - if (totedge == 0) { - /* flag that mesh has edges */ - me->totedge = 0; - return; - } - - medge = (MEdge *)CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, medge, totedge); - me->totedge = totedge; - - BKE_mesh_strip_loose_faces(me); -} - void BKE_mesh_calc_edges_loose(Mesh *mesh) { const Span<MLoop> loops = mesh->loops(); @@ -1579,7 +1369,7 @@ void BKE_mesh_calc_edges_tessface(Mesh *mesh) BLI_edgesetIterator_step(ehi), i++, med++, index++) { BLI_edgesetIterator_getKey(ehi, &med->v1, &med->v2); - med->flag = ME_EDGEDRAW | ME_EDGERENDER; + med->flag = ME_EDGEDRAW; *index = ORIGINDEX_NONE; } BLI_edgesetIterator_free(ehi); diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index eb0c78e9361..31fc8afea84 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -4346,12 +4346,6 @@ void node_type_socket_templates(struct bNodeType *ntype, } } -void node_type_init(struct bNodeType *ntype, - void (*initfunc)(struct bNodeTree *ntree, struct bNode *node)) -{ - ntype->initfunc = initfunc; -} - void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth) { ntype->width = width; @@ -4399,33 +4393,6 @@ void node_type_storage(bNodeType *ntype, ntype->freefunc = freefunc; } -void node_type_update(struct bNodeType *ntype, - void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node)) -{ - ntype->updatefunc = updatefunc; -} - -void node_type_group_update(struct bNodeType *ntype, - void (*group_update_func)(struct bNodeTree *ntree, struct bNode *node)) -{ - ntype->group_update_func = group_update_func; -} - -void node_type_exec(struct bNodeType *ntype, - NodeInitExecFunction init_exec_fn, - NodeFreeExecFunction free_exec_fn, - NodeExecFunction exec_fn) -{ - ntype->init_exec_fn = init_exec_fn; - ntype->free_exec_fn = free_exec_fn; - ntype->exec_fn = exec_fn; -} - -void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn) -{ - ntype->gpu_fn = gpu_fn; -} - /* callbacks for undefined types */ static bool node_undefined_poll(bNodeType * /*ntype*/, diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 1aef42ef037..51a20cf1e35 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -1025,7 +1025,7 @@ void BKE_sound_free_waveform(bSound *sound) sound->tags &= ~SOUND_TAGS_WAVEFORM_NO_RELOAD; } -void BKE_sound_read_waveform(Main *bmain, bSound *sound, short *stop) +void BKE_sound_read_waveform(Main *bmain, bSound *sound, bool *stop) { bool need_close_audio_handles = false; if (sound->playback_handle == NULL) { @@ -1041,8 +1041,11 @@ void BKE_sound_read_waveform(Main *bmain, bSound *sound, short *stop) int length = info.length * SOUND_WAVE_SAMPLES_PER_SECOND; waveform->data = MEM_mallocN(sizeof(float[3]) * length, "SoundWaveform.samples"); + /* Ideally this would take a boolean argument. */ + short stop_i16 = *stop; waveform->length = AUD_readSound( - sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND, stop); + sound->playback_handle, waveform->data, length, SOUND_WAVE_SAMPLES_PER_SECOND, &stop_i16); + *stop = stop_i16 != 0; } else { /* Create an empty waveform here if the sound couldn't be @@ -1381,7 +1384,7 @@ int BKE_sound_scene_playing(Scene *UNUSED(scene)) void BKE_sound_read_waveform(Main *bmain, bSound *sound, /* NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop) + bool *stop) { UNUSED_VARS(sound, stop, bmain); } diff --git a/source/blender/blenkernel/intern/subdiv_mesh.cc b/source/blender/blenkernel/intern/subdiv_mesh.cc index 3b97c1f5e68..e1c434f2b2e 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.cc +++ b/source/blender/blenkernel/intern/subdiv_mesh.cc @@ -794,7 +794,7 @@ static void subdiv_copy_edge_data(SubdivMeshContext *ctx, /* TODO: Ensure crease layer isn't copied to result. */ subdiv_edge->flag = 0; if (!ctx->settings->use_optimal_display) { - subdiv_edge->flag |= ME_EDGERENDER; + subdiv_edge->flag |= ME_EDGEDRAW; } if (ctx->edge_origindex != nullptr) { ctx->edge_origindex[subdiv_edge_index] = ORIGINDEX_NONE; @@ -804,7 +804,7 @@ static void subdiv_copy_edge_data(SubdivMeshContext *ctx, const int coarse_edge_index = coarse_edge - ctx->coarse_edges; CustomData_copy_data( &ctx->coarse_mesh->edata, &ctx->subdiv_mesh->edata, coarse_edge_index, subdiv_edge_index, 1); - subdiv_edge->flag |= ME_EDGERENDER; + subdiv_edge->flag |= ME_EDGEDRAW; } static void subdiv_mesh_edge(const SubdivForeachContext *foreach_context, diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index c37f4b1ea2f..80fb637b76e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -962,7 +962,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) int edgeSize = ccgSubSurf_getEdgeSize(ss); uint i = 0; short *edgeFlags = ccgdm->edgeFlags; - const short ed_interior_flag = ccgdm->drawInteriorEdges ? (ME_EDGEDRAW | ME_EDGERENDER) : 0; + const short ed_interior_flag = ccgdm->drawInteriorEdges ? ME_EDGEDRAW : 0; totface = ccgSubSurf_getNumFaces(ss); for (index = 0; index < totface; index++) { @@ -1005,11 +1005,11 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) if (edgeFlags) { if (edgeIdx != -1) { - ed_flag |= ((edgeFlags[index] & (ME_SEAM | ME_SHARP)) | ME_EDGEDRAW | ME_EDGERENDER); + ed_flag |= ((edgeFlags[index] & (ME_SEAM | ME_SHARP)) | ME_EDGEDRAW); } } else { - ed_flag |= ME_EDGEDRAW | ME_EDGERENDER; + ed_flag |= ME_EDGEDRAW; } for (x = 0; x < edgeSize - 1; x++) { diff --git a/source/blender/blenkernel/intern/tracking_solver.c b/source/blender/blenkernel/intern/tracking_solver.c index 11041b4c0fd..e784c39ba08 100644 --- a/source/blender/blenkernel/intern/tracking_solver.c +++ b/source/blender/blenkernel/intern/tracking_solver.c @@ -56,8 +56,8 @@ typedef struct MovieReconstructContext { } MovieReconstructContext; typedef struct ReconstructProgressData { - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; char *stats_message; int message_size; @@ -465,8 +465,8 @@ static void reconstructionOptionsFromContext(libmv_ReconstructionOptions *recons } void BKE_tracking_reconstruction_solve(MovieReconstructContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress, char *stats_message, int message_size) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 1d4cbc48833..8d6dba440fd 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -141,19 +141,25 @@ static int write_audio_frame(FFMpegContext *context) frame->pts = context->audio_time / av_q2d(c->time_base); frame->nb_samples = context->audio_input_samples; frame->format = c->sample_fmt; +# ifdef FFMPEG_USE_OLD_CHANNEL_VARS frame->channels = c->channels; frame->channel_layout = c->channel_layout; + const int num_channels = c->channels; +# else + av_channel_layout_copy(&frame->ch_layout, &c->ch_layout); + const int num_channels = c->ch_layout.nb_channels; +# endif if (context->audio_deinterleave) { int channel, i; uint8_t *temp; - for (channel = 0; channel < c->channels; channel++) { + for (channel = 0; channel < num_channels; channel++) { for (i = 0; i < frame->nb_samples; i++) { memcpy(context->audio_deinterleave_buffer + (i + channel * frame->nb_samples) * context->audio_sample_size, context->audio_input_buffer + - (c->channels * i + channel) * context->audio_sample_size, + (num_channels * i + channel) * context->audio_sample_size, context->audio_sample_size); } } @@ -164,10 +170,11 @@ static int write_audio_frame(FFMpegContext *context) } avcodec_fill_audio_frame(frame, - c->channels, + num_channels, c->sample_fmt, context->audio_input_buffer, - context->audio_input_samples * c->channels * context->audio_sample_size, + context->audio_input_samples * num_channels * + context->audio_sample_size, 1); int success = 1; @@ -944,25 +951,34 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, c->sample_rate = rd->ffcodecdata.audio_mixrate; c->bit_rate = context->ffmpeg_audio_bitrate * 1000; c->sample_fmt = AV_SAMPLE_FMT_S16; - c->channels = rd->ffcodecdata.audio_channels; + const int num_channels = rd->ffcodecdata.audio_channels; + int channel_layout_mask = 0; switch (rd->ffcodecdata.audio_channels) { case FFM_CHANNELS_MONO: - c->channel_layout = AV_CH_LAYOUT_MONO; + channel_layout_mask = AV_CH_LAYOUT_MONO; break; case FFM_CHANNELS_STEREO: - c->channel_layout = AV_CH_LAYOUT_STEREO; + channel_layout_mask = AV_CH_LAYOUT_STEREO; break; case FFM_CHANNELS_SURROUND4: - c->channel_layout = AV_CH_LAYOUT_QUAD; + channel_layout_mask = AV_CH_LAYOUT_QUAD; break; case FFM_CHANNELS_SURROUND51: - c->channel_layout = AV_CH_LAYOUT_5POINT1_BACK; + channel_layout_mask = AV_CH_LAYOUT_5POINT1_BACK; break; case FFM_CHANNELS_SURROUND71: - c->channel_layout = AV_CH_LAYOUT_7POINT1; + channel_layout_mask = AV_CH_LAYOUT_7POINT1; break; } + BLI_assert(channel_layout_mask != 0); + +# ifdef FFMPEG_USE_OLD_CHANNEL_VARS + c->channels = num_channels; + c->channel_layout = channel_layout_mask; +# else + av_channel_layout_from_mask(&c->ch_layout, channel_layout_mask); +# endif if (request_float_audio_buffer(codec_id)) { /* mainly for AAC codec which is experimental */ @@ -1027,7 +1043,7 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, * not sure if that is needed anymore, so let's try out if there are any * complaints regarding some FFmpeg versions users might have. */ context->audio_input_samples = AV_INPUT_BUFFER_MIN_SIZE * 8 / c->bits_per_coded_sample / - c->channels; + num_channels; } else { context->audio_input_samples = c->frame_size; @@ -1037,11 +1053,11 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, context->audio_sample_size = av_get_bytes_per_sample(c->sample_fmt); - context->audio_input_buffer = (uint8_t *)av_malloc(context->audio_input_samples * c->channels * + context->audio_input_buffer = (uint8_t *)av_malloc(context->audio_input_samples * num_channels * context->audio_sample_size); if (context->audio_deinterleave) { context->audio_deinterleave_buffer = (uint8_t *)av_malloc( - context->audio_input_samples * c->channels * context->audio_sample_size); + context->audio_input_samples * num_channels * context->audio_sample_size); } context->audio_time = 0.0f; @@ -1432,7 +1448,11 @@ int BKE_ffmpeg_start(void *context_v, AVCodecContext *c = context->audio_codec; AUD_DeviceSpecs specs; +# ifdef FFMPEG_USE_OLD_CHANNEL_VARS specs.channels = c->channels; +# else + specs.channels = c->ch_layout.nb_channels; +# endif switch (av_get_packed_sample_fmt(c->sample_fmt)) { case AV_SAMPLE_FMT_U8: diff --git a/source/blender/blenlib/BLI_cache_mutex.hh b/source/blender/blenlib/BLI_cache_mutex.hh new file mode 100644 index 00000000000..8e2a0d1b1a5 --- /dev/null +++ b/source/blender/blenlib/BLI_cache_mutex.hh @@ -0,0 +1,106 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +/** + * A #CacheMutex is used to protect a lazily computed cache from being computed more than once. + * Using #CacheMutex instead of a "raw mutex" to protect a cache has some benefits: + * - Avoid common pitfalls like forgetting to use task isolation or a double checked lock. + * - Cleaner and less redundant code because the same locking patterns don't have to be repeated + * everywhere. + * - One can benefit from potential future improvements to #CacheMutex of which there are a few + * mentioned below. + * + * The data protected by #CacheMutex is not part of #CacheMutex. Instead, the #CacheMutex and its + * protected data should generally be placed next to each other. + * + * Each #CacheMutex protects exactly one cache, so multiple cache mutexes have to be used when a + * class has multiple caches. That is contrary to a "custom" solution using `std::mutex` where one + * mutex could protect multiple caches at the cost of higher lock contention. + * + * To make sure the cache is up to date, call `CacheMutex::ensure` and pass in the function that + * computes the cache. + * + * To tell the #CacheMutex that the cache is invalidated and to be re-evaluated upon next access + * use `CacheMutex::tag_dirty`. + * + * This example shows how one could implement a lazily computed average vertex position in an + * imaginary `Mesh` data structure: + * + * \code{.cpp} + * class Mesh { + * private: + * mutable CacheMutex average_position_cache_mutex_; + * mutable float3 average_position_cache_; + * + * public: + * const float3 &average_position() const + * { + * average_position_cache_mutex_.ensure([&]() { + * average_position_cache_ = actually_compute_average_position(); + * }); + * return average_position_cache_; + * } + * + * void tag_positions_changed() + * { + * average_position_cache_mutex_.tag_dirty(); + * } + * }; + * \endcode + * + * Possible future improvements: + * - Avoid task isolation when we know that the cache computation does not use threading. + * - Try to use a smaller mutex. The mutex does not have to be fair for this use case. + * - Try to join the cache computation instead of blocking if another thread is computing the cache + * already. + */ + +#include <atomic> +#include <mutex> + +#include "BLI_function_ref.hh" + +namespace blender { + +class CacheMutex { + private: + std::mutex mutex_; + std::atomic<bool> cache_valid_ = false; + + public: + /** + * Make sure the cache exists and is up to date. This calls `compute_cache` once to update the + * cache (which is stored outside of this class) if it is dirty, otherwise it does nothing. + * + * This function is thread-safe under the assumption that the same parameters are passed from + * every thread. + */ + void ensure(FunctionRef<void()> compute_cache); + + /** + * Reset the cache. The next time #ensure is called, it will recompute that code. + */ + void tag_dirty() + { + cache_valid_.store(false); + } + + /** + * Return true if the cache currently does not exist or has been invalidated. + */ + bool is_dirty() const + { + return !this->is_cached(); + } + + /** + * Return true if the cache exists and is valid. + */ + bool is_cached() const + { + return cache_valid_.load(std::memory_order_relaxed); + } +}; + +} // namespace blender diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index 2ac77f000e9..693a4d98675 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -54,6 +54,7 @@ set(SRC intern/bitmap_draw_2d.c intern/boxpack_2d.c intern/buffer.c + intern/cache_mutex.cc intern/compute_context.cc intern/convexhull_2d.c intern/cpp_type.cc @@ -178,6 +179,7 @@ set(SRC BLI_bounds.hh BLI_boxpack_2d.h BLI_buffer.h + BLI_cache_mutex.hh BLI_color.hh BLI_color_mix.hh BLI_compiler_attrs.h diff --git a/source/blender/blenlib/intern/cache_mutex.cc b/source/blender/blenlib/intern/cache_mutex.cc new file mode 100644 index 00000000000..db474b1ef87 --- /dev/null +++ b/source/blender/blenlib/intern/cache_mutex.cc @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "BLI_cache_mutex.hh" +#include "BLI_task.hh" + +namespace blender { + +void CacheMutex::ensure(const FunctionRef<void()> compute_cache) +{ + if (cache_valid_.load(std::memory_order_acquire)) { + return; + } + std::scoped_lock lock{mutex_}; + /* Double checked lock. */ + if (cache_valid_.load(std::memory_order_relaxed)) { + return; + } + /* Use task isolation because a mutex is locked and the cache computation might use + * multi-threading. */ + threading::isolate_task(compute_cache); + + cache_valid_.store(true, std::memory_order_release); +} + +} // namespace blender diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 25549de182a..2376bd82b69 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -626,17 +626,6 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char bool BLI_path_parent_dir(char *path) { - char tmp[FILE_MAX]; - - STRNCPY(tmp, path); - /* Does all the work of normalizing the path for us. - * - * NOTE(@campbellbarton): While it's possible strip text after the second last slash, - * this would have to be clever and skip cases like "/./" & multiple slashes. - * Since this ends up solving some of the same problems as #BLI_path_normalize, - * call this function instead of attempting to handle them separately. */ - BLI_path_normalize(NULL, tmp); - /* Use #BLI_path_name_at_index instead of checking if the strings ends with `parent_dir` * to ensure the logic isn't confused by: * - Directory names that happen to end with `..`. @@ -644,18 +633,19 @@ bool BLI_path_parent_dir(char *path) * which would cause checking for a tailing `/../` fail. * Extracting the span of the final directory avoids both these issues. */ int tail_ofs = 0, tail_len = 0; - if (!BLI_path_name_at_index(tmp, -1, &tail_ofs, &tail_len)) { + if (!BLI_path_name_at_index(path, -1, &tail_ofs, &tail_len)) { return false; } if (tail_len == 1) { /* Last path is ".", as normalize should remove this, it's safe to assume failure. * This happens when the input a single period (possibly with slashes before or after). */ - if (tmp[tail_ofs] == '.') { + if (path[tail_ofs] == '.') { return false; } } - memcpy(path, tmp, tail_ofs); + /* Input paths should already be normalized if `..` is part of the path. */ + BLI_assert(!((tail_len == 2) && (path[tail_ofs] == '.') && (path[tail_ofs + 1] == '.'))); path[tail_ofs] = '\0'; return true; } diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index e4a93762da4..cdb63bd8075 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -44,6 +44,7 @@ #include "BKE_image.h" #include "BKE_main.h" /* for Main */ #include "BKE_mesh.h" /* for ME_ defines (patching) */ +#include "BKE_mesh_legacy_convert.h" #include "BKE_modifier.h" #include "BKE_particle.h" #include "BKE_pointcache.h" diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 9a0568a3589..23d514a7b12 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -62,6 +62,7 @@ #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_pointcache.h" +#include "BKE_mesh_legacy_convert.h" #include "SEQ_iterator.h" #include "SEQ_sequencer.h" diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 8125130490a..cff8eb5a2f7 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -732,8 +732,7 @@ short BM_edge_flag_to_mflag(BMEdge *e) return (((hflag & BM_ELEM_SEAM) ? ME_SEAM : 0) | ((hflag & BM_ELEM_DRAW) ? ME_EDGEDRAW : 0) | ((hflag & BM_ELEM_SMOOTH) == 0 ? ME_SHARP : 0) | - (BM_edge_is_wire(e) ? ME_LOOSEEDGE : 0) | /* not typical */ - ME_EDGERENDER); + (BM_edge_is_wire(e) ? ME_LOOSEEDGE : 0)); } char BM_face_flag_to_mflag(BMFace *f) { diff --git a/source/blender/compositor/realtime_compositor/CMakeLists.txt b/source/blender/compositor/realtime_compositor/CMakeLists.txt index 2402adcadaf..b4352248b5b 100644 --- a/source/blender/compositor/realtime_compositor/CMakeLists.txt +++ b/source/blender/compositor/realtime_compositor/CMakeLists.txt @@ -3,6 +3,7 @@ set(INC . algorithms + cached_resources ../../blenkernel ../../blenlib ../../gpu @@ -10,6 +11,7 @@ set(INC ../../makesdna ../../makesrna ../../nodes + ../../render ../../gpu/intern ../../../../intern/guardedalloc ) @@ -31,6 +33,7 @@ set(SRC intern/shader_node.cc intern/shader_operation.cc intern/simple_operation.cc + intern/static_cache_manager.cc intern/static_shader_manager.cc intern/texture_pool.cc intern/utilities.cc @@ -51,6 +54,7 @@ set(SRC COM_shader_node.hh COM_shader_operation.hh COM_simple_operation.hh + COM_static_cache_manager.hh COM_static_shader_manager.hh COM_texture_pool.hh COM_utilities.hh @@ -58,12 +62,22 @@ set(SRC algorithms/intern/algorithm_parallel_reduction.cc algorithms/COM_algorithm_parallel_reduction.hh + + cached_resources/intern/morphological_distance_feather_weights.cc + cached_resources/intern/symmetric_blur_weights.cc + cached_resources/intern/symmetric_separable_blur_weights.cc + + cached_resources/COM_cached_resource.hh + cached_resources/COM_morphological_distance_feather_weights.hh + cached_resources/COM_symmetric_blur_weights.hh + cached_resources/COM_symmetric_separable_blur_weights.hh ) set(LIB bf_gpu bf_nodes bf_imbuf + bf_render bf_blenlib bf_blenkernel ) diff --git a/source/blender/compositor/realtime_compositor/COM_context.hh b/source/blender/compositor/realtime_compositor/COM_context.hh index b5c8cea641f..80fb4f70ca4 100644 --- a/source/blender/compositor/realtime_compositor/COM_context.hh +++ b/source/blender/compositor/realtime_compositor/COM_context.hh @@ -9,6 +9,7 @@ #include "GPU_texture.h" +#include "COM_static_cache_manager.hh" #include "COM_static_shader_manager.hh" #include "COM_texture_pool.hh" @@ -22,14 +23,17 @@ namespace blender::realtime_compositor { * providing input data like render passes and the active scene, as well as references to the data * where the output of the evaluator will be written. The class also provides a reference to the * texture pool which should be implemented by the caller and provided during construction. - * Finally, the class have an instance of a static shader manager for convenient shader - * acquisition. */ + * Finally, the class have an instance of a static shader manager and a static resource manager + * for acquiring cached shaders and resources efficiently. */ class Context { private: /* A texture pool that can be used to allocate textures for the compositor efficiently. */ TexturePool &texture_pool_; /* A static shader manager that can be used to acquire shaders for the compositor efficiently. */ StaticShaderManager shader_manager_; + /* A static cache manager that can be used to acquire cached resources for the compositor + * efficiently. */ + StaticCacheManager cache_manager_; public: Context(TexturePool &texture_pool); @@ -67,6 +71,9 @@ class Context { /* Get a reference to the static shader manager of this context. */ StaticShaderManager &shader_manager(); + + /* Get a reference to the static cache manager of this context. */ + StaticCacheManager &cache_manager(); }; } // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/COM_static_cache_manager.hh b/source/blender/compositor/realtime_compositor/COM_static_cache_manager.hh new file mode 100644 index 00000000000..20fbb156879 --- /dev/null +++ b/source/blender/compositor/realtime_compositor/COM_static_cache_manager.hh @@ -0,0 +1,77 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include <memory> + +#include "BLI_map.hh" +#include "BLI_math_vec_types.hh" + +#include "COM_morphological_distance_feather_weights.hh" +#include "COM_symmetric_blur_weights.hh" +#include "COM_symmetric_separable_blur_weights.hh" + +namespace blender::realtime_compositor { + +/* ------------------------------------------------------------------------------------------------- + * Static Cache Manager + * + * A static cache manager is a collection of cached resources that can be retrieved when needed and + * created if not already available. In particular, each cached resource type has its own Map in + * the class, where all instances of that cached resource type are stored and tracked. See the + * CachedResource class for more information. + * + * The manager deletes the cached resources that are no longer needed. A cached resource is said to + * be not needed when it was not used in the previous evaluation. This is done through the + * following mechanism: + * + * - Before every evaluation, do the following: + * 1. All resources whose CachedResource::needed flag is false are deleted. + * 2. The CachedResource::needed flag of all remaining resources is set to false. + * - During evaluation, when retrieving any cached resource, set its CachedResource::needed flag to + * true. + * + * In effect, any resource that was used in the previous evaluation but was not used in the current + * evaluation will be deleted before the next evaluation. This mechanism is implemented in the + * reset() method of the class, which should be called before every evaluation. */ +class StaticCacheManager { + private: + /* A map that stores all SymmetricBlurWeights cached resources. */ + Map<SymmetricBlurWeightsKey, std::unique_ptr<SymmetricBlurWeights>> symmetric_blur_weights_; + + /* A map that stores all SymmetricSeparableBlurWeights cached resources. */ + Map<SymmetricSeparableBlurWeightsKey, std::unique_ptr<SymmetricSeparableBlurWeights>> + symmetric_separable_blur_weights_; + + /* A map that stores all MorphologicalDistanceFeatherWeights cached resources. */ + Map<MorphologicalDistanceFeatherWeightsKey, std::unique_ptr<MorphologicalDistanceFeatherWeights>> + morphological_distance_feather_weights_; + + public: + /* Reset the cache manager by deleting the cached resources that are no longer needed because + * they weren't used in the last evaluation and prepare the remaining cached resources to track + * their needed status in the next evaluation. See the class description for more information. + * This should be called before every evaluation. */ + void reset(); + + /* Check if there is an available SymmetricBlurWeights cached resource with the given parameters + * in the manager, if one exists, return it, otherwise, return a newly created one and add it to + * the manager. In both cases, tag the cached resource as needed to keep it cached for the next + * evaluation. */ + SymmetricBlurWeights &get_symmetric_blur_weights(int type, float2 radius); + + /* Check if there is an available SymmetricSeparableBlurWeights cached resource with the given + * parameters in the manager, if one exists, return it, otherwise, return a newly created one and + * add it to the manager. In both cases, tag the cached resource as needed to keep it cached for + * the next evaluation. */ + SymmetricSeparableBlurWeights &get_symmetric_separable_blur_weights(int type, float radius); + + /* Check if there is an available MorphologicalDistanceFeatherWeights cached resource with the + * given parameters in the manager, if one exists, return it, otherwise, return a newly created + * one and add it to the manager. In both cases, tag the cached resource as needed to keep it + * cached for the next evaluation. */ + MorphologicalDistanceFeatherWeights &get_morphological_distance_feather_weights(int type, + int radius); +}; + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh b/source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh new file mode 100644 index 00000000000..fe3158ef52d --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/COM_cached_resource.hh @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +namespace blender::realtime_compositor { + +/* ------------------------------------------------------------------------------------------------- + * Cached Resource. + * + * A cached resource is any resource that can be cached across compositor evaluations and across + * multiple operations. Cached resources are managed by an instance of a StaticCacheManager and are + * freed when they are no longer needed, a state which is represented by the `needed` member in the + * class. For more information on the caching mechanism, see the StaticCacheManager class. + * + * To add a new cached resource: + * + * - Create a derived class from CachedResource to represent the resource. + * - Create a key class that can be used in a Map to identify the resource. + * - Add a new Map to StaticCacheManager mapping the key to the resource. + * - Reset the contents of the added map in StaticCacheManager::reset. + * - Add an appropriate getter method in StaticCacheManager. + * + * See the existing cached resources for reference. */ +class CachedResource { + public: + /* A flag that represents the needed status of the cached resource. See the StaticCacheManager + * class for more information on how this member is utilized in the caching mechanism. */ + bool needed = true; +}; + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/COM_morphological_distance_feather_weights.hh b/source/blender/compositor/realtime_compositor/cached_resources/COM_morphological_distance_feather_weights.hh new file mode 100644 index 00000000000..cd6827bdd6b --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/COM_morphological_distance_feather_weights.hh @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include <cstdint> + +#include "GPU_shader.h" +#include "GPU_texture.h" + +#include "COM_cached_resource.hh" + +namespace blender::realtime_compositor { + +/* ------------------------------------------------------------------------------------------------ + * Morphological Distance Feather Key. + */ +class MorphologicalDistanceFeatherWeightsKey { + public: + int type; + float radius; + + MorphologicalDistanceFeatherWeightsKey(int type, float radius); + + uint64_t hash() const; +}; + +bool operator==(const MorphologicalDistanceFeatherWeightsKey &a, + const MorphologicalDistanceFeatherWeightsKey &b); + +/* ------------------------------------------------------------------------------------------------- + * Morphological Distance Feather Weights. + * + * A cached resource that computes and caches 1D GPU textures containing the weights of the + * separable Gaussian filter of the given radius as well as an inverse distance falloff of the + * given type and radius. The weights and falloffs are symmetric, because the Gaussian and falloff + * functions are all even functions. Consequently, only the positive half of the filter is computed + * and the shader takes that into consideration. */ +class MorphologicalDistanceFeatherWeights : public CachedResource { + private: + GPUTexture *weights_texture_ = nullptr; + GPUTexture *distance_falloffs_texture_ = nullptr; + + public: + MorphologicalDistanceFeatherWeights(int type, int radius); + + ~MorphologicalDistanceFeatherWeights(); + + void compute_weights(int radius); + + void compute_distance_falloffs(int type, int radius); + + void bind_weights_as_texture(GPUShader *shader, const char *texture_name) const; + + void unbind_weights_as_texture() const; + + void bind_distance_falloffs_as_texture(GPUShader *shader, const char *texture_name) const; + + void unbind_distance_falloffs_as_texture() const; +}; + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/COM_symmetric_blur_weights.hh b/source/blender/compositor/realtime_compositor/cached_resources/COM_symmetric_blur_weights.hh new file mode 100644 index 00000000000..05d3c7c6f3e --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/COM_symmetric_blur_weights.hh @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include <cstdint> + +#include "BLI_math_vec_types.hh" + +#include "GPU_shader.h" +#include "GPU_texture.h" + +#include "COM_cached_resource.hh" + +namespace blender::realtime_compositor { + +/* ------------------------------------------------------------------------------------------------ + * Symmetric Blur Weights Key. + */ +class SymmetricBlurWeightsKey { + public: + int type; + float2 radius; + + SymmetricBlurWeightsKey(int type, float2 radius); + + uint64_t hash() const; +}; + +bool operator==(const SymmetricBlurWeightsKey &a, const SymmetricBlurWeightsKey &b); + +/* ------------------------------------------------------------------------------------------------- + * Symmetric Blur Weights. + * + * A cached resource that computes and caches a 2D GPU texture containing the weights of the filter + * of the given type and radius. The filter is assumed to be symmetric, because the filter + * functions are evaluated on the normalized distance to the center. Consequently, only the upper + * right quadrant are computed and the shader takes that into consideration. */ +class SymmetricBlurWeights : public CachedResource { + private: + GPUTexture *texture_ = nullptr; + + public: + SymmetricBlurWeights(int type, float2 radius); + + ~SymmetricBlurWeights(); + + void bind_as_texture(GPUShader *shader, const char *texture_name) const; + + void unbind_as_texture() const; +}; + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/COM_symmetric_separable_blur_weights.hh b/source/blender/compositor/realtime_compositor/cached_resources/COM_symmetric_separable_blur_weights.hh new file mode 100644 index 00000000000..85e75e4535d --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/COM_symmetric_separable_blur_weights.hh @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include <cstdint> + +#include "BLI_math_vec_types.hh" + +#include "GPU_shader.h" +#include "GPU_texture.h" + +#include "COM_cached_resource.hh" + +namespace blender::realtime_compositor { + +/* ------------------------------------------------------------------------------------------------ + * Symmetric Separable Blur Weights Key. + */ +class SymmetricSeparableBlurWeightsKey { + public: + int type; + float radius; + + SymmetricSeparableBlurWeightsKey(int type, float radius); + + uint64_t hash() const; +}; + +bool operator==(const SymmetricSeparableBlurWeightsKey &a, + const SymmetricSeparableBlurWeightsKey &b); + +/* ------------------------------------------------------------------------------------------------- + * Symmetric Separable Blur Weights. + * + * A cached resource that computes and caches a 1D GPU texture containing the weights of the + * separable filter of the given type and radius. The filter is assumed to be symmetric, because + * the filter functions are all even functions. Consequently, only the positive half of the filter + * is computed and the shader takes that into consideration. */ +class SymmetricSeparableBlurWeights : public CachedResource { + private: + GPUTexture *texture_ = nullptr; + + public: + SymmetricSeparableBlurWeights(int type, float radius); + + ~SymmetricSeparableBlurWeights(); + + void bind_as_texture(GPUShader *shader, const char *texture_name) const; + + void unbind_as_texture() const; +}; + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc new file mode 100644 index 00000000000..eac88b907b8 --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/morphological_distance_feather_weights.cc @@ -0,0 +1,159 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <cmath> +#include <cstdint> + +#include "BLI_array.hh" +#include "BLI_hash.hh" +#include "BLI_index_range.hh" + +#include "RE_pipeline.h" + +#include "DNA_scene_types.h" + +#include "GPU_shader.h" +#include "GPU_texture.h" + +#include "COM_morphological_distance_feather_weights.hh" + +namespace blender::realtime_compositor { + +/* -------------------------------------------------------------------- + * Morphological Distance Feather Weights Key. + */ + +MorphologicalDistanceFeatherWeightsKey::MorphologicalDistanceFeatherWeightsKey(int type, + float radius) + : type(type), radius(radius) +{ +} + +uint64_t MorphologicalDistanceFeatherWeightsKey::hash() const +{ + return get_default_hash_2(type, radius); +} + +bool operator==(const MorphologicalDistanceFeatherWeightsKey &a, + const MorphologicalDistanceFeatherWeightsKey &b) +{ + return a.type == b.type && a.radius == b.radius; +} + +/* -------------------------------------------------------------------- + * Morphological Distance Feather Weights. + */ + +MorphologicalDistanceFeatherWeights::MorphologicalDistanceFeatherWeights(int type, int radius) +{ + compute_weights(radius); + compute_distance_falloffs(type, radius); +} + +MorphologicalDistanceFeatherWeights::~MorphologicalDistanceFeatherWeights() +{ + GPU_texture_free(weights_texture_); + GPU_texture_free(distance_falloffs_texture_); +} + +void MorphologicalDistanceFeatherWeights::compute_weights(int radius) +{ + /* The size of filter is double the radius plus 1, but since the filter is symmetric, we only + * compute half of it and no doubling happens. We add 1 to make sure the filter size is always + * odd and there is a center weight. */ + const int size = radius + 1; + Array<float> weights(size); + + float sum = 0.0f; + + /* First, compute the center weight. */ + const float center_weight = RE_filter_value(R_FILTER_GAUSS, 0.0f); + weights[0] = center_weight; + sum += center_weight; + + /* Second, compute the other weights in the positive direction, making sure to add double the + * weight to the sum of weights because the filter is symmetric and we only loop over half of + * it. Skip the center weight already computed by dropping the front index. */ + const float scale = radius > 0.0f ? 1.0f / radius : 0.0f; + for (const int i : weights.index_range().drop_front(1)) { + const float weight = RE_filter_value(R_FILTER_GAUSS, i * scale); + weights[i] = weight; + sum += weight * 2.0f; + } + + /* Finally, normalize the weights. */ + for (const int i : weights.index_range()) { + weights[i] /= sum; + } + + weights_texture_ = GPU_texture_create_1d("Weights", size, 1, GPU_R16F, weights.data()); +} + +/* Computes a falloff that is equal to 1 at an input of zero and decrease to zero at an input of 1, + * with the rate of decrease depending on the falloff type. */ +static float compute_distance_falloff(int type, float x) +{ + x = 1.0f - x; + + switch (type) { + case PROP_SMOOTH: + return 3.0f * x * x - 2.0f * x * x * x; + case PROP_SPHERE: + return std::sqrt(2.0f * x - x * x); + case PROP_ROOT: + return std::sqrt(x); + case PROP_SHARP: + return x * x; + case PROP_INVSQUARE: + return x * (2.0f - x); + case PROP_LIN: + return x; + default: + BLI_assert_unreachable(); + return x; + } +} + +void MorphologicalDistanceFeatherWeights::compute_distance_falloffs(int type, int radius) +{ + /* The size of the distance falloffs is double the radius plus 1, but since the falloffs are + * symmetric, we only compute half of them and no doubling happens. We add 1 to make sure the + * falloffs size is always odd and there is a center falloff. */ + const int size = radius + 1; + Array<float> falloffs(size); + + /* Compute the distance falloffs in the positive direction only, because the falloffs are + * symmetric. */ + const float scale = radius > 0.0f ? 1.0f / radius : 0.0f; + for (const int i : falloffs.index_range()) { + falloffs[i] = compute_distance_falloff(type, i * scale); + } + + distance_falloffs_texture_ = GPU_texture_create_1d( + "Distance Factors", size, 1, GPU_R16F, falloffs.data()); +} + +void MorphologicalDistanceFeatherWeights::bind_weights_as_texture(GPUShader *shader, + const char *texture_name) const +{ + const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + GPU_texture_bind(weights_texture_, texture_image_unit); +} + +void MorphologicalDistanceFeatherWeights::unbind_weights_as_texture() const +{ + GPU_texture_unbind(weights_texture_); +} + +void MorphologicalDistanceFeatherWeights::bind_distance_falloffs_as_texture( + GPUShader *shader, const char *texture_name) const +{ + const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + GPU_texture_bind(distance_falloffs_texture_, texture_image_unit); +} + +void MorphologicalDistanceFeatherWeights::unbind_distance_falloffs_as_texture() const +{ + GPU_texture_unbind(distance_falloffs_texture_); +} + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc new file mode 100644 index 00000000000..a22d32a8e18 --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_blur_weights.cc @@ -0,0 +1,115 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <cstdint> + +#include "BLI_array.hh" +#include "BLI_hash.hh" +#include "BLI_index_range.hh" +#include "BLI_math_vec_types.hh" +#include "BLI_math_vector.hh" + +#include "RE_pipeline.h" + +#include "GPU_shader.h" +#include "GPU_texture.h" + +#include "COM_symmetric_blur_weights.hh" + +namespace blender::realtime_compositor { + +/* -------------------------------------------------------------------- + * Symmetric Blur Weights Key. + */ + +SymmetricBlurWeightsKey::SymmetricBlurWeightsKey(int type, float2 radius) + : type(type), radius(radius) +{ +} + +uint64_t SymmetricBlurWeightsKey::hash() const +{ + return get_default_hash_3(type, radius.x, radius.y); +} + +bool operator==(const SymmetricBlurWeightsKey &a, const SymmetricBlurWeightsKey &b) +{ + return a.type == b.type && a.radius == b.radius; +} + +/* -------------------------------------------------------------------- + * Symmetric Blur Weights. + */ + +SymmetricBlurWeights::SymmetricBlurWeights(int type, float2 radius) +{ + /* The full size of filter is double the radius plus 1, but since the filter is symmetric, we + * only compute a single quadrant of it and so no doubling happens. We add 1 to make sure the + * filter size is always odd and there is a center weight. */ + const float2 scale = math::safe_divide(float2(1.0f), radius); + const int2 size = int2(math::ceil(radius)) + int2(1); + Array<float> weights(size.x * size.y); + + float sum = 0.0f; + + /* First, compute the center weight. */ + const float center_weight = RE_filter_value(type, 0.0f); + weights[0] = center_weight; + sum += center_weight; + + /* Then, compute the weights along the positive x axis, making sure to add double the weight to + * the sum of weights because the filter is symmetric and we only loop over the positive half + * of the x axis. Skip the center weight already computed by dropping the front index. */ + for (const int x : IndexRange(size.x).drop_front(1)) { + const float weight = RE_filter_value(type, x * scale.x); + weights[x] = weight; + sum += weight * 2.0f; + } + + /* Then, compute the weights along the positive y axis, making sure to add double the weight to + * the sum of weights because the filter is symmetric and we only loop over the positive half + * of the y axis. Skip the center weight already computed by dropping the front index. */ + for (const int y : IndexRange(size.y).drop_front(1)) { + const float weight = RE_filter_value(type, y * scale.y); + weights[size.x * y] = weight; + sum += weight * 2.0f; + } + + /* Then, compute the other weights in the upper right quadrant, making sure to add quadruple + * the weight to the sum of weights because the filter is symmetric and we only loop over one + * quadrant of it. Skip the weights along the y and x axis already computed by dropping the + * front index. */ + for (const int y : IndexRange(size.y).drop_front(1)) { + for (const int x : IndexRange(size.x).drop_front(1)) { + const float weight = RE_filter_value(type, math::length(float2(x, y) * scale)); + weights[size.x * y + x] = weight; + sum += weight * 4.0f; + } + } + + /* Finally, normalize the weights. */ + for (const int y : IndexRange(size.y)) { + for (const int x : IndexRange(size.x)) { + weights[size.x * y + x] /= sum; + } + } + + texture_ = GPU_texture_create_2d("Weights", size.x, size.y, 1, GPU_R16F, weights.data()); +} + +SymmetricBlurWeights::~SymmetricBlurWeights() +{ + GPU_texture_free(texture_); +} + +void SymmetricBlurWeights::bind_as_texture(GPUShader *shader, const char *texture_name) const +{ + const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + GPU_texture_bind(texture_, texture_image_unit); +} + +void SymmetricBlurWeights::unbind_as_texture() const +{ + GPU_texture_unbind(texture_); +} + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc new file mode 100644 index 00000000000..b8c47d5a5d0 --- /dev/null +++ b/source/blender/compositor/realtime_compositor/cached_resources/intern/symmetric_separable_blur_weights.cc @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <cstdint> + +#include "BLI_array.hh" +#include "BLI_hash.hh" +#include "BLI_index_range.hh" +#include "BLI_math_base.hh" + +#include "RE_pipeline.h" + +#include "GPU_shader.h" +#include "GPU_texture.h" + +#include "COM_symmetric_separable_blur_weights.hh" + +namespace blender::realtime_compositor { + +/* -------------------------------------------------------------------- + * Symmetric Separable Blur Weights Key. + */ + +SymmetricSeparableBlurWeightsKey::SymmetricSeparableBlurWeightsKey(int type, float radius) + : type(type), radius(radius) +{ +} + +uint64_t SymmetricSeparableBlurWeightsKey::hash() const +{ + return get_default_hash_2(type, radius); +} + +bool operator==(const SymmetricSeparableBlurWeightsKey &a, + const SymmetricSeparableBlurWeightsKey &b) +{ + return a.type == b.type && a.radius == b.radius; +} + +/* -------------------------------------------------------------------- + * Symmetric Separable Blur Weights. + */ + +SymmetricSeparableBlurWeights::SymmetricSeparableBlurWeights(int type, float radius) +{ + /* The size of filter is double the radius plus 1, but since the filter is symmetric, we only + * compute half of it and no doubling happens. We add 1 to make sure the filter size is always + * odd and there is a center weight. */ + const int size = math::ceil(radius) + 1; + Array<float> weights(size); + + float sum = 0.0f; + + /* First, compute the center weight. */ + const float center_weight = RE_filter_value(type, 0.0f); + weights[0] = center_weight; + sum += center_weight; + + /* Second, compute the other weights in the positive direction, making sure to add double the + * weight to the sum of weights because the filter is symmetric and we only loop over half of + * it. Skip the center weight already computed by dropping the front index. */ + const float scale = radius > 0.0f ? 1.0f / radius : 0.0f; + for (const int i : weights.index_range().drop_front(1)) { + const float weight = RE_filter_value(type, i * scale); + weights[i] = weight; + sum += weight * 2.0f; + } + + /* Finally, normalize the weights. */ + for (const int i : weights.index_range()) { + weights[i] /= sum; + } + + texture_ = GPU_texture_create_1d("Weights", size, 1, GPU_R16F, weights.data()); +} + +SymmetricSeparableBlurWeights::~SymmetricSeparableBlurWeights() +{ + GPU_texture_free(texture_); +} + +void SymmetricSeparableBlurWeights::bind_as_texture(GPUShader *shader, + const char *texture_name) const +{ + const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); + GPU_texture_bind(texture_, texture_image_unit); +} + +void SymmetricSeparableBlurWeights::unbind_as_texture() const +{ + GPU_texture_unbind(texture_); +} + +} // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/intern/context.cc b/source/blender/compositor/realtime_compositor/intern/context.cc index 924398f6747..0b123a2c271 100644 --- a/source/blender/compositor/realtime_compositor/intern/context.cc +++ b/source/blender/compositor/realtime_compositor/intern/context.cc @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include "COM_context.hh" +#include "COM_static_cache_manager.hh" #include "COM_static_shader_manager.hh" #include "COM_texture_pool.hh" @@ -32,4 +33,9 @@ StaticShaderManager &Context::shader_manager() return shader_manager_; } +StaticCacheManager &Context::cache_manager() +{ + return cache_manager_; +} + } // namespace blender::realtime_compositor diff --git a/source/blender/compositor/realtime_compositor/intern/evaluator.cc b/source/blender/compositor/realtime_compositor/intern/evaluator.cc index 48457bec199..1cd7d4f8951 100644 --- a/source/blender/compositor/realtime_compositor/intern/evaluator.cc +++ b/source/blender/compositor/realtime_compositor/intern/evaluator.cc @@ -28,6 +28,7 @@ Evaluator::Evaluator(Context &context, bNodeTree &node_tree) void Evaluator::evaluate() { + context_.cache_manager().reset(); context_.texture_pool().reset(); if (!is_compiled_) { diff --git a/source/blender/compositor/realtime_compositor/intern/static_cache_manager.cc b/source/blender/compositor/realtime_compositor/intern/static_cache_manager.cc new file mode 100644 index 00000000000..da78412a815 --- /dev/null +++ b/source/blender/compositor/realtime_compositor/intern/static_cache_manager.cc @@ -0,0 +1,74 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <memory> + +#include "BLI_math_vec_types.hh" + +#include "COM_morphological_distance_feather_weights.hh" +#include "COM_symmetric_blur_weights.hh" +#include "COM_symmetric_separable_blur_weights.hh" + +#include "COM_static_cache_manager.hh" + +namespace blender::realtime_compositor { + +/* -------------------------------------------------------------------- + * Static Cache Manager. + */ + +void StaticCacheManager::reset() +{ + /* First, delete all resources that are no longer needed. */ + symmetric_blur_weights_.remove_if([](auto item) { return !item.value->needed; }); + symmetric_separable_blur_weights_.remove_if([](auto item) { return !item.value->needed; }); + morphological_distance_feather_weights_.remove_if([](auto item) { return !item.value->needed; }); + + /* Second, reset the needed status of the remaining resources to false to ready them to track + * their needed status for the next evaluation. */ + for (auto &value : symmetric_blur_weights_.values()) { + value->needed = false; + } + for (auto &value : symmetric_separable_blur_weights_.values()) { + value->needed = false; + } + for (auto &value : morphological_distance_feather_weights_.values()) { + value->needed = false; + } +} + +SymmetricBlurWeights &StaticCacheManager::get_symmetric_blur_weights(int type, float2 radius) +{ + const SymmetricBlurWeightsKey key(type, radius); + + auto &weights = *symmetric_blur_weights_.lookup_or_add_cb( + key, [&]() { return std::make_unique<SymmetricBlurWeights>(type, radius); }); + + weights.needed = true; + return weights; +} + +SymmetricSeparableBlurWeights &StaticCacheManager::get_symmetric_separable_blur_weights( + int type, float radius) +{ + const SymmetricSeparableBlurWeightsKey key(type, radius); + + auto &weights = *symmetric_separable_blur_weights_.lookup_or_add_cb( + key, [&]() { return std::make_unique<SymmetricSeparableBlurWeights>(type, radius); }); + + weights.needed = true; + return weights; +} + +MorphologicalDistanceFeatherWeights &StaticCacheManager:: + get_morphological_distance_feather_weights(int type, int radius) +{ + const MorphologicalDistanceFeatherWeightsKey key(type, radius); + + auto &weights = *morphological_distance_feather_weights_.lookup_or_add_cb( + key, [&]() { return std::make_unique<MorphologicalDistanceFeatherWeights>(type, radius); }); + + weights.needed = true; + return weights; +} + +} // namespace blender::realtime_compositor diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index 4010b491141..5902dc18165 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -24,6 +24,8 @@ set(INC ../render ../render/intern ../compositor/realtime_compositor + ../compositor/realtime_compositor/algorithms + ../compositor/realtime_compositor/cached_resources ../windowmanager ../../../intern/atomic diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 9bf0cce2af2..26a264c1716 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -142,7 +142,7 @@ typedef struct EEVEE_LightBake { struct GPUTexture *dummy_layer_color; int total, done; /* to compute progress */ - short *stop, *do_update; + bool *stop, *do_update; float *progress; /** For only handling the resources. */ @@ -778,7 +778,7 @@ wmJob *EEVEE_lightbake_job_create(struct wmWindowManager *wm, } if (old_lbake->stop != NULL) { - *old_lbake->stop = 1; + *old_lbake->stop = true; } BLI_mutex_unlock(old_lbake->mutex); } @@ -1359,13 +1359,13 @@ static bool lightbake_do_sample(EEVEE_LightBake *lbake, DRW_custom_pipeline(&draw_engine_eevee_type, depsgraph, render_callback, lbake); lbake->done += 1; *lbake->progress = lbake->done / (float)lbake->total; - *lbake->do_update = 1; + *lbake->do_update = true; eevee_lightbake_context_disable(lbake); return true; } -void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float *progress) +void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float *progress) { EEVEE_LightBake *lbake = (EEVEE_LightBake *)custom_data; Depsgraph *depsgraph = lbake->depsgraph; @@ -1394,8 +1394,8 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float /* Resource allocation can fail. Early exit in this case. */ if (lbake->lcache->flag & LIGHTCACHE_INVALID) { - *lbake->stop = 1; - *lbake->do_update = 1; + *lbake->stop = true; + *lbake->do_update = true; lbake->lcache->flag &= ~LIGHTCACHE_BAKING; eevee_lightbake_context_disable(lbake); eevee_lightbake_delete_resources(lbake); diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.h b/source/blender/draw/engines/eevee/eevee_lightcache.h index 4e94e1914a7..73961f1919d 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.h +++ b/source/blender/draw/engines/eevee/eevee_lightcache.h @@ -42,7 +42,7 @@ void *EEVEE_lightbake_job_data_alloc(struct Main *bmain, int frame); void EEVEE_lightbake_job_data_free(void *custom_data); void EEVEE_lightbake_update(void *custom_data); -void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float *progress); +void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float *progress); /** * This is to update the world irradiance and reflection contribution from diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 4744c0db6ce..7c5e8313532 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -88,14 +88,14 @@ BLI_INLINE Material *workbench_object_material_get(Object *ob, int mat_nr) BLI_INLINE void workbench_material_get_image( Object *ob, int mat_nr, Image **r_image, ImageUser **r_iuser, eGPUSamplerState *r_sampler) { - bNode *node; + const bNode *node; *r_sampler = 0; ED_object_get_active_image(ob, mat_nr, r_image, r_iuser, &node, NULL); if (node && *r_image) { switch (node->type) { case SH_NODE_TEX_IMAGE: { - NodeTexImage *storage = node->storage; + const NodeTexImage *storage = node->storage; const bool use_filter = (storage->interpolation != SHD_INTERP_CLOSEST); const bool use_repeat = (storage->extension == SHD_IMAGE_EXTENSION_REPEAT); const bool use_clip = (storage->extension == SHD_IMAGE_EXTENSION_CLIP); @@ -105,7 +105,7 @@ BLI_INLINE void workbench_material_get_image( break; } case SH_NODE_TEX_ENVIRONMENT: { - NodeTexEnvironment *storage = node->storage; + const NodeTexEnvironment *storage = node->storage; const bool use_filter = (storage->interpolation != SHD_INTERP_CLOSEST); SET_FLAG_FROM_TEST(*r_sampler, use_filter, GPU_SAMPLER_FILTER); break; diff --git a/source/blender/draw/intern/draw_command.cc b/source/blender/draw/intern/draw_command.cc index 10dd63e05dc..6e999815e8d 100644 --- a/source/blender/draw/intern/draw_command.cc +++ b/source/blender/draw/intern/draw_command.cc @@ -166,7 +166,10 @@ void StateSet::execute(RecordingState &recording_state) const */ BLI_assert(DST.state_lock == 0); - if (!assign_if_different(recording_state.pipeline_state, new_state)) { + bool state_changed = assign_if_different(recording_state.pipeline_state, new_state); + bool clip_changed = assign_if_different(recording_state.clip_plane_count, clip_plane_count); + + if (!state_changed && !clip_changed) { return; } @@ -190,12 +193,7 @@ void StateSet::execute(RecordingState &recording_state) const } /* TODO: this should be part of shader state. */ - if (new_state & DRW_STATE_CLIP_PLANES) { - GPU_clip_distances(recording_state.view_clip_plane_count); - } - else { - GPU_clip_distances(0); - } + GPU_clip_distances(recording_state.clip_plane_count); if (new_state & DRW_STATE_IN_FRONT_SELECT) { /* XXX `GPU_depth_range` is not a perfect solution diff --git a/source/blender/draw/intern/draw_command.hh b/source/blender/draw/intern/draw_command.hh index ed75ac21031..12c9916ee6d 100644 --- a/source/blender/draw/intern/draw_command.hh +++ b/source/blender/draw/intern/draw_command.hh @@ -39,7 +39,7 @@ struct RecordingState { bool front_facing = true; bool inverted_view = false; DRWState pipeline_state = DRW_STATE_NO_DRAW; - int view_clip_plane_count = 0; + int clip_plane_count = 0; /** Used for gl_BaseInstance workaround. */ GPUStorageBuf *resource_id_buf = nullptr; @@ -325,6 +325,7 @@ struct Clear { struct StateSet { DRWState new_state; + int clip_plane_count; void execute(RecordingState &state) const; std::string serialize() const; diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index 40b05dff51f..85701a10f4b 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -64,8 +64,8 @@ static void drw_deferred_shader_compilation_exec( void *custom_data, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *UNUSED(do_update), + bool *stop, + bool *UNUSED(do_update), float *UNUSED(progress)) { GPU_render_begin(); diff --git a/source/blender/draw/intern/draw_pass.hh b/source/blender/draw/intern/draw_pass.hh index 892dfdddfcf..2c1fd16928e 100644 --- a/source/blender/draw/intern/draw_pass.hh +++ b/source/blender/draw/intern/draw_pass.hh @@ -159,8 +159,10 @@ class PassBase { * * IMPORTANT: This does not set the stencil mask/reference values. Add a call to state_stencil() * to ensure correct behavior of stencil aware draws. + * + * TODO(fclem): clip_plane_count should be part of shader state. */ - void state_set(DRWState state); + void state_set(DRWState state, int clip_plane_count = 0); /** * Clear the current frame-buffer. @@ -731,9 +733,13 @@ template<class T> inline void PassBase<T>::barrier(eGPUBarrier type) /** \name State Implementation * \{ */ -template<class T> inline void PassBase<T>::state_set(DRWState state) +template<class T> inline void PassBase<T>::state_set(DRWState state, int clip_plane_count) { - create_command(Type::StateSet).state_set = {state}; + /** \note This is for compatibility with the old clip plane API. */ + if (clip_plane_count > 0) { + state |= DRW_STATE_CLIP_PLANES; + } + create_command(Type::StateSet).state_set = {state, clip_plane_count}; } template<class T> diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edge_fac.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edge_fac.cc index a968bd07c87..de1f5181ac5 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edge_fac.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edge_fac.cc @@ -66,7 +66,7 @@ static void extract_edge_fac_init(const MeshRenderData *mr, * We could have a flag in the mesh instead or check the modifier stack. */ const MEdge *med = mr->medge; for (int e_index = 0; e_index < mr->edge_len; e_index++, med++) { - if ((med->flag & ME_EDGERENDER) == 0) { + if ((med->flag & ME_EDGEDRAW) == 0) { data->use_edge_render = true; break; } @@ -118,7 +118,7 @@ static void extract_edge_fac_iter_poly_mesh(const MeshRenderData *mr, if (data->use_edge_render) { const MEdge *med = &mr->medge[ml->e]; - data->vbo_data[ml_index] = (med->flag & ME_EDGERENDER) ? 255 : 0; + data->vbo_data[ml_index] = (med->flag & ME_EDGEDRAW) ? 255 : 0; } else { diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c index 37c1524c2ff..ab3edfdd4fa 100644 --- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c +++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c @@ -68,6 +68,8 @@ #include "gpencil_intern.h" +#define SEARCH_RADIUS_PIXEL 20 + /* ************************************************ */ /* General Brush Editing Context */ @@ -78,6 +80,7 @@ typedef struct tGP_BrushEditData { Main *bmain; Scene *scene; Object *object; + Object *ob_eval; ScrArea *area; ARegion *region; @@ -1181,6 +1184,8 @@ static bool gpencil_sculpt_brush_init(bContext *C, wmOperator *op) } /* Check if some modifier can transform the stroke. */ gso->is_transformed = BKE_gpencil_has_transform_modifiers(ob); + + gso->ob_eval = (Object *)DEG_get_evaluated_id(gso->depsgraph, &ob->id); } else { unit_m4(gso->inv_mat); @@ -1196,9 +1201,13 @@ static bool gpencil_sculpt_brush_init(bContext *C, wmOperator *op) gso->brush = brush; BKE_curvemapping_init(gso->brush->curve); - if (brush->gpencil_settings->sculpt_mode_flag & - (GP_SCULPT_FLAGMODE_AUTOMASK_STROKE | GP_SCULPT_FLAGMODE_AUTOMASK_LAYER | - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL)) { + const bool is_automasking = (ts->gp_sculpt.flag & + (GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE | + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE)) != 0; + if (is_automasking) { gso->automasking_strokes = BLI_ghash_ptr_new(__func__); } else { @@ -1604,13 +1613,16 @@ static bool gpencil_sculpt_brush_do_frame(bContext *C, bGPdata *gpd = ob->data; const char tool = gso->brush->gpencil_sculpt_tool; GP_SpaceConversion *gsc = &gso->gsc; + ToolSettings *ts = gso->scene->toolsettings; Brush *brush = gso->brush; const int radius = (brush->flag & GP_BRUSH_USE_PRESSURE) ? gso->brush->size * gso->pressure : gso->brush->size; - const bool is_automasking = (brush->gpencil_settings->sculpt_mode_flag & - (GP_SCULPT_FLAGMODE_AUTOMASK_STROKE | - GP_SCULPT_FLAGMODE_AUTOMASK_LAYER | - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL)) != 0; + const bool is_automasking = (ts->gp_sculpt.flag & + (GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE | + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE)) != 0; /* Calc bound box matrix. */ float bound_mat[4][4]; BKE_gpencil_layer_transform_matrix_get(gso->depsgraph, gso->object, gpl, bound_mat); @@ -1743,27 +1755,111 @@ static bool gpencil_sculpt_brush_do_frame(bContext *C, return changed; } +/* Find the stroke nearer to the brush. */ +static void get_nearest_stroke_to_brush(tGP_BrushEditData *gso, + int mval_i[2], + bGPDlayer **r_gpl, + bGPDstroke **r_gps) +{ + const int radius = SEARCH_RADIUS_PIXEL; + + Object *ob_eval = gso->ob_eval; + bGPdata *gpd = (bGPdata *)ob_eval->data; + GP_SpaceConversion *gsc = &gso->gsc; + const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); + float dist = FLT_MAX; + + LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { + if (!BKE_gpencil_layer_is_editable(gpl) || (gpl->actframe == NULL)) { + continue; + } + /* Calculate bound box matrix. */ + float bound_mat[4][4]; + BKE_gpencil_layer_transform_matrix_get(gso->depsgraph, gso->object, gpl, bound_mat); + + bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe; + for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { + LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { + bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps; + if (gps->totpoints == 0) { + continue; + } + /* Check if the color is editable. */ + if (ED_gpencil_stroke_material_editable(gso->object, gpl, gps) == false) { + continue; + } + + /* Check if the stroke collide with brush. */ + if (!ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) { + continue; + } + + bGPDspoint *pt; + int pc2D[2] = {0}; + bGPDspoint npt; + + for (int i = 0; i < gps->totpoints; i++) { + pt = gps->points + i; + gpencil_point_to_world_space(pt, bound_mat, &npt); + gpencil_point_to_xy(gsc, gps, &npt, &pc2D[0], &pc2D[1]); + float d = len_v2v2_int(mval_i, pc2D); + if (d < dist) { + dist = d; + *r_gpl = gpl; + *r_gps = gps_active; + } + } + } + /* If not multi-edit, exit loop. */ + if (!is_multiedit) { + break; + } + } + } +} + /* Get list of Auto-Masking strokes. */ static bool get_automasking_strokes_list(tGP_BrushEditData *gso) { - bGPdata *gpd = gso->gpd; + Object *ob_eval = gso->ob_eval; + bGPdata *gpd = (bGPdata *)ob_eval->data; GP_SpaceConversion *gsc = &gso->gsc; - Brush *brush = gso->brush; + ToolSettings *ts = gso->scene->toolsettings; Object *ob = gso->object; - Material *mat_active = BKE_gpencil_material(ob, ob->actcol); + const eGP_Sculpt_SettingsFlag flag = ts->gp_sculpt.flag; const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); - const bool is_masking_stroke = (brush->gpencil_settings->sculpt_mode_flag & - GP_SCULPT_FLAGMODE_AUTOMASK_STROKE) != 0; - const bool is_masking_layer = (brush->gpencil_settings->sculpt_mode_flag & - GP_SCULPT_FLAGMODE_AUTOMASK_LAYER) != 0; - const bool is_masking_material = (brush->gpencil_settings->sculpt_mode_flag & - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL) != 0; + const bool is_masking_stroke = (flag & GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE) != 0; + const bool is_masking_layer_stroke = (flag & GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE) != 0; + const bool is_masking_material_stroke = (flag & GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE) != + 0; + const bool is_masking_layer_active = (flag & GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE) != 0; + const bool is_masking_material_active = (flag & GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE) != + 0; int mval_i[2]; round_v2i_v2fl(mval_i, gso->mval); /* Define a fix number of pixel as cursor radius. */ - const int radius = 10; + const int radius = SEARCH_RADIUS_PIXEL; bGPDlayer *gpl_active = BKE_gpencil_layer_active_get(gpd); + Material *mat_active = BKE_gpencil_material(ob, ob->actcol); + + /* By default use active values. */ + bGPDlayer *gpl_active_stroke = gpl_active; + Material *mat_active_stroke = mat_active; + /* Find nearest stroke to find the layer and material. */ + if (is_masking_layer_stroke || is_masking_material_stroke) { + bGPDlayer *gpl_near = NULL; + bGPDstroke *gps_near = NULL; + get_nearest_stroke_to_brush(gso, mval_i, &gpl_near, &gps_near); + if (gps_near != NULL) { + if (is_masking_layer_stroke) { + gpl_active_stroke = gpl_near; + } + if (is_masking_material_stroke) { + mat_active_stroke = BKE_object_material_get(ob, gps_near->mat_nr + 1); + } + } + } LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { /* Only editable and visible layers are considered. */ @@ -1777,87 +1873,113 @@ static bool get_automasking_strokes_list(tGP_BrushEditData *gso) bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe; for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { + bGPDstroke *gps_active = (gps->runtime.gps_orig) ? gps->runtime.gps_orig : gps; + bool pick_stroke = false; + bool pick_layer_stroke = false; + bool pick_material_stroke = false; + bool pick_layer_active = false; + bool pick_material_active = false; + if (gps->totpoints == 0) { continue; } - /* Check if the color is editable. */ + /* Check if the material is editable. */ if (ED_gpencil_stroke_material_editable(gso->object, gpl, gps) == false) { continue; } - /* Layer Auto-Masking. */ - if ((is_masking_layer) && (gpl == gpl_active)) { - BLI_ghash_insert(gso->automasking_strokes, gps, gps); - continue; + /* Stroke Layer Auto-Masking. */ + if (is_masking_layer_stroke && (gpl == gpl_active_stroke)) { + pick_layer_stroke = true; } - /* Material Auto-Masking. */ - if (is_masking_material) { + /* Active Layer Auto-Masking. */ + if (is_masking_layer_active && (gpl == gpl_active)) { + pick_layer_active = true; + } + /* Stroke Material Auto-Masking. */ + if (is_masking_material_stroke) { Material *mat = BKE_object_material_get(ob, gps->mat_nr + 1); - if (mat == mat_active) { - BLI_ghash_insert(gso->automasking_strokes, gps, gps); - continue; + if (mat == mat_active_stroke) { + pick_material_stroke = true; } } - - /* If Stroke Auto-Masking is not enabled, nothing else to do. */ - if (!is_masking_stroke) { - continue; + /* Active Material Auto-Masking. */ + if (is_masking_material_active) { + Material *mat = BKE_object_material_get(ob, gps->mat_nr + 1); + if (mat == mat_active) { + pick_material_active = true; + } } /* Check if the stroke collide with brush. */ - if (!ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) { - continue; - } - - bGPDspoint *pt1, *pt2; - int pc1[2] = {0}; - int pc2[2] = {0}; - bGPDspoint npt; + if ((is_masking_stroke) && + ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) { - if (gps->totpoints == 1) { - gpencil_point_to_world_space(gps->points, bound_mat, &npt); - gpencil_point_to_xy(gsc, gps, &npt, &pc1[0], &pc1[1]); + bGPDspoint *pt1, *pt2; + int pc1[2] = {0}; + int pc2[2] = {0}; + bGPDspoint npt; - /* Only check if point is inside. */ - if (len_v2v2_int(mval_i, pc1) <= radius) { - BLI_ghash_insert(gso->automasking_strokes, gps, gps); - } - } - else { - /* Loop over the points in the stroke, checking for intersections - * - an intersection means that we touched the stroke. - */ - for (int i = 0; (i + 1) < gps->totpoints; i++) { - /* Get points to work with. */ - pt1 = gps->points + i; - pt2 = gps->points + i + 1; - - /* Check first point. */ - gpencil_point_to_world_space(pt1, bound_mat, &npt); + if (gps->totpoints == 1) { + gpencil_point_to_world_space(gps->points, bound_mat, &npt); gpencil_point_to_xy(gsc, gps, &npt, &pc1[0], &pc1[1]); - if (len_v2v2_int(mval_i, pc1) <= radius) { - BLI_ghash_insert(gso->automasking_strokes, gps, gps); - i = gps->totpoints; - continue; - } - /* Check second point. */ - gpencil_point_to_world_space(pt2, bound_mat, &npt); - gpencil_point_to_xy(gsc, gps, &npt, &pc2[0], &pc2[1]); - if (len_v2v2_int(mval_i, pc2) <= radius) { - BLI_ghash_insert(gso->automasking_strokes, gps, gps); - i = gps->totpoints; - continue; + /* Only check if point is inside. */ + if (len_v2v2_int(mval_i, pc1) <= radius) { + pick_stroke = true; } - - /* Check segment. */ - if (gpencil_stroke_inside_circle(gso->mval, radius, pc1[0], pc1[1], pc2[0], pc2[1])) { - BLI_ghash_insert(gso->automasking_strokes, gps, gps); - i = gps->totpoints; - continue; + } + else { + /* Loop over the points in the stroke, checking for intersections + * - an intersection means that we touched the stroke. + */ + for (int i = 0; (i + 1) < gps->totpoints && !pick_stroke; i++) { + /* Get points to work with. */ + pt1 = gps->points + i; + pt2 = gps->points + i + 1; + + /* Check first point. */ + gpencil_point_to_world_space(pt1, bound_mat, &npt); + gpencil_point_to_xy(gsc, gps, &npt, &pc1[0], &pc1[1]); + if (len_v2v2_int(mval_i, pc1) <= radius) { + pick_stroke = true; + i = gps->totpoints; + } + + /* Check second point. */ + gpencil_point_to_world_space(pt2, bound_mat, &npt); + gpencil_point_to_xy(gsc, gps, &npt, &pc2[0], &pc2[1]); + if (len_v2v2_int(mval_i, pc2) <= radius) { + pick_stroke = true; + i = gps->totpoints; + } + + /* Check segment. */ + if (!pick_stroke && gpencil_stroke_inside_circle( + gso->mval, radius, pc1[0], pc1[1], pc2[0], pc2[1])) { + pick_stroke = true; + i = gps->totpoints; + } } } } + /* if the stroke meets all the masking conditions, add to the hash table. */ + if (is_masking_stroke && !pick_stroke) { + continue; + } + if (is_masking_layer_stroke && !pick_layer_stroke) { + continue; + } + if (is_masking_material_stroke && !pick_material_stroke) { + continue; + } + if (is_masking_layer_active && !pick_layer_active) { + continue; + } + if (is_masking_material_active && !pick_material_active) { + continue; + } + BLI_ghash_insert(gso->automasking_strokes, gps_active, gps_active); } /* If not multi-edit, exit loop. */ if (!is_multiedit) { @@ -1877,7 +1999,7 @@ static bool gpencil_sculpt_brush_apply_standard(bContext *C, tGP_BrushEditData * Object *obact = gso->object; bool changed = false; - Object *ob_eval = (Object *)DEG_get_evaluated_id(depsgraph, &obact->id); + Object *ob_eval = gso->ob_eval; bGPdata *gpd = (bGPdata *)ob_eval->data; /* Calculate brush-specific data which applies equally to all points */ @@ -1971,6 +2093,7 @@ static void gpencil_sculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA * { tGP_BrushEditData *gso = op->customdata; Brush *brush = gso->brush; + ToolSettings *ts = gso->scene->toolsettings; const int radius = (brush->flag & GP_BRUSH_USE_PRESSURE) ? gso->brush->size * gso->pressure : gso->brush->size; float mousef[2]; @@ -2012,9 +2135,10 @@ static void gpencil_sculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA * /* Get list of Auto-Masking strokes. */ if ((!gso->automasking_ready) && - (brush->gpencil_settings->sculpt_mode_flag & - (GP_SCULPT_FLAGMODE_AUTOMASK_STROKE | GP_SCULPT_FLAGMODE_AUTOMASK_LAYER | - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL))) { + (ts->gp_sculpt.flag & + (GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE | GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE | + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE | GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE | + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE))) { gso->automasking_ready = get_automasking_strokes_list(gso); } @@ -2082,20 +2206,6 @@ static void gpencil_sculpt_brush_apply_event(bContext *C, wmOperator *op, const if (gso->brush == NULL) { gso->brush = gso->brush_prev; } - Brush *brush = gso->brush; - if (brush->gpencil_settings->sculpt_mode_flag & - (GP_SCULPT_FLAGMODE_AUTOMASK_STROKE | GP_SCULPT_FLAGMODE_AUTOMASK_LAYER | - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL)) { - if (gso->automasking_strokes == NULL) { - gso->automasking_strokes = BLI_ghash_ptr_new(__func__); - } - } - else { - if (gso->automasking_strokes != NULL) { - BLI_ghash_free(gso->automasking_strokes, NULL, NULL); - } - gso->automasking_strokes = NULL; - } } else { if (gso->brush_prev != NULL) { diff --git a/source/blender/editors/gpencil/gpencil_trace_ops.c b/source/blender/editors/gpencil/gpencil_trace_ops.c index 36165c6b7c0..1a18e10412e 100644 --- a/source/blender/editors/gpencil/gpencil_trace_ops.c +++ b/source/blender/editors/gpencil/gpencil_trace_ops.c @@ -45,7 +45,7 @@ typedef struct TraceJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; bContext *C; @@ -198,7 +198,7 @@ static void trace_initialize_job_data(TraceJob *trace_job) } } -static void trace_start_job(void *customdata, short *stop, short *do_update, float *progress) +static void trace_start_job(void *customdata, bool *stop, bool *do_update, float *progress) { TraceJob *trace_job = customdata; @@ -257,7 +257,7 @@ static void trace_start_job(void *customdata, short *stop, short *do_update, flo trace_job->success = !trace_job->was_canceled; *do_update = true; - *stop = 0; + *stop = false; } static void trace_end_job(void *customdata) @@ -339,7 +339,7 @@ static int gpencil_trace_image_exec(bContext *C, wmOperator *op) ED_object_base_activate(job->C, job->base_active); if ((job->image->source == IMA_SRC_FILE) || (job->frame_num > 0)) { - short stop = 0, do_update = true; + bool stop = false, do_update = true; float progress; trace_start_job(job, &stop, &do_update, &progress); trace_end_job(job); diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index da303f3552b..20e62ac8626 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -51,6 +51,7 @@ void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Image *ima, bool automatic); +void ED_space_image_sync(struct Main *bmain, Image *image, bool ignore_render_viewer); void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima); struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima); void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index b97cd6a9099..5fea8711a84 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -73,8 +73,8 @@ bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **r_ima, struct ImageUser **r_iuser, - struct bNode **r_node, - struct bNodeTree **r_ntree); + const struct bNode **r_node, + const struct bNodeTree **r_ntree); void ED_object_assign_active_image(struct Main *bmain, struct Object *ob, int mat_nr, diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 9a4f98ebcd6..a5e2cd02f3b 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1309,8 +1309,8 @@ static void ui_id_preview_image_render_size( const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job); static void ui_studiolight_icon_job_exec(void *customdata, - short *UNUSED(stop), - short *UNUSED(do_update), + bool *UNUSED(stop), + bool *UNUSED(do_update), float *UNUSED(progress)) { Icon **tmp = (Icon **)customdata; diff --git a/source/blender/editors/interface/interface_panel.cc b/source/blender/editors/interface/interface_panel.cc index 24d8281aad8..05b6ecf29d5 100644 --- a/source/blender/editors/interface/interface_panel.cc +++ b/source/blender/editors/interface/interface_panel.cc @@ -2026,7 +2026,7 @@ static void ui_panel_drag_collapse_handler_add(const bContext *C, const bool was ui_panel_drag_collapse_handler, ui_panel_drag_collapse_handler_remove, dragcol_data, - 0); + eWM_EventHandlerFlag(0)); } /** @@ -2510,8 +2510,12 @@ static void panel_handle_data_ensure(const bContext *C, { if (panel->activedata == nullptr) { panel->activedata = MEM_callocN(sizeof(uiHandlePanelData), __func__); - WM_event_add_ui_handler( - C, &win->modalhandlers, ui_handler_panel, ui_handler_remove_panel, panel, 0); + WM_event_add_ui_handler(C, + &win->modalhandlers, + ui_handler_panel, + ui_handler_remove_panel, + panel, + eWM_EventHandlerFlag(0)); } uiHandlePanelData *data = static_cast<uiHandlePanelData *>(panel->activedata); diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc index b468360ff9b..9901f4e1836 100644 --- a/source/blender/editors/mesh/mesh_data.cc +++ b/source/blender/editors/mesh/mesh_data.cc @@ -1191,7 +1191,7 @@ static void mesh_add_edges(Mesh *mesh, int len) MutableSpan<MEdge> edges = mesh->edges_for_write(); for (MEdge &edge : edges.take_back(len)) { - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } bke::MutableAttributeAccessor attributes = mesh->attributes_for_write(); diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 4b6ce69294f..91641de1605 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -461,7 +461,7 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj) CTX_DATA_END; } -static void multiresbake_startjob(void *bkv, short *stop, short *do_update, float *progress) +static void multiresbake_startjob(void *bkv, bool *stop, bool *do_update, float *progress) { MultiresBakerJobData *data; MultiresBakeJob *bkj = bkv; diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index b8e5c4e5522..e69ccf5a50d 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -106,7 +106,7 @@ typedef struct BakeAPIRender { /* Progress Callbacks. */ float *progress; - short *do_update; + bool *do_update; /* Operator state. */ ReportList *reports; @@ -150,12 +150,12 @@ static int bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) * for exec() when there is no render job * NOTE: this won't check for the escape key being pressed, but doing so isn't thread-safe. */ -static int bake_break(void *UNUSED(rjv)) +static bool bake_break(void *UNUSED(rjv)) { if (G.is_break) { - return 1; + return true; } - return 0; + return false; } static void bake_update_image(ScrArea *area, Image *image) @@ -467,8 +467,8 @@ static bool bake_object_check(const Scene *scene, } for (int i = 0; i < ob->totcol; i++) { - bNodeTree *ntree = NULL; - bNode *node = NULL; + const bNodeTree *ntree = NULL; + const bNode *node = NULL; const int mat_nr = i + 1; Image *image; ED_object_get_active_image(ob, mat_nr, &image, NULL, &node, &ntree); @@ -1854,7 +1854,7 @@ finally: return result; } -static void bake_startjob(void *bkv, short *UNUSED(stop), short *do_update, float *progress) +static void bake_startjob(void *bkv, bool *UNUSED(stop), bool *do_update, float *progress) { BakeAPIRender *bkr = (BakeAPIRender *)bkv; diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index 85a35861329..a87e52db129 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -614,7 +614,7 @@ bool ED_object_modifier_convert_psys_to_mesh(ReportList * /*reports*/, if (k) { medge->v1 = cvert - 1; medge->v2 = cvert; - medge->flag = ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE; + medge->flag = ME_EDGEDRAW | ME_LOOSEEDGE; medge++; } else { @@ -633,7 +633,7 @@ bool ED_object_modifier_convert_psys_to_mesh(ReportList * /*reports*/, if (k) { medge->v1 = cvert - 1; medge->v2 = cvert; - medge->flag = ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE; + medge->flag = ME_EDGEDRAW | ME_LOOSEEDGE; medge++; } else { @@ -3023,7 +3023,7 @@ static bool ocean_bake_poll(bContext *C) struct OceanBakeJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; int current_frame; struct OceanCache *och; @@ -3062,7 +3062,7 @@ static void oceanbake_update(void *customdata, float progress, int *cancel) *(oj->progress) = progress; } -static void oceanbake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void oceanbake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { OceanBakeJob *oj = static_cast<OceanBakeJob *>(customdata); @@ -3075,7 +3075,7 @@ static void oceanbake_startjob(void *customdata, short *stop, short *do_update, BKE_ocean_bake(oj->ocean, oj->och, oceanbake_update, (void *)oj); *do_update = true; - *stop = 0; + *stop = false; } static void oceanbake_endjob(void *customdata) diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index c3764b34469..b9acf5ae27b 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -654,7 +654,7 @@ enum eSymmetryAxes { struct QuadriFlowJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; const struct wmOperator *op; @@ -836,7 +836,7 @@ static Mesh *remesh_symmetry_mirror(Object *ob, Mesh *mesh, eSymmetryAxes symmet return mesh_mirror; } -static void quadriflow_start_job(void *customdata, short *stop, short *do_update, float *progress) +static void quadriflow_start_job(void *customdata, bool *stop, bool *do_update, float *progress) { QuadriFlowJob *qj = static_cast<QuadriFlowJob *>(customdata); @@ -884,7 +884,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update if (new_mesh == nullptr) { *do_update = true; - *stop = 0; + *stop = false; if (qj->success == 1) { /* This is not a user cancellation event. */ qj->success = 0; @@ -917,7 +917,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update BKE_mesh_batch_cache_dirty_tag(static_cast<Mesh *>(ob->data), BKE_MESH_BATCH_DIRTY_ALL); *do_update = true; - *stop = 0; + *stop = false; } static void quadriflow_end_job(void *customdata) @@ -992,7 +992,7 @@ static int quadriflow_remesh_exec(bContext *C, wmOperator *op) if (op->flag == 0) { /* This is called directly from the exec operator, this operation is now blocking */ job->is_nonblocking_job = false; - short stop = 0, do_update = true; + bool stop = false, do_update = true; float progress; quadriflow_start_job(job, &stop, &do_update, &progress); quadriflow_end_job(job); diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index 0c2aca8b97b..7d0b62db827 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -7,6 +7,7 @@ #include <cstdlib> #include <cstring> +#include <limits> #include <numeric> #include "DNA_anim_types.h" @@ -1643,8 +1644,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) /* done */ } else if (around == V3D_AROUND_CENTER_BOUNDS) { - float3 min; - float3 max; + float3 min(std::numeric_limits<float>::max()); + float3 max(-std::numeric_limits<float>::max()); if (curves.bounds_min_max(min, max)) { cent = math::midpoint(min, max); } diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index 41238eb171b..1a3f0f0f2ac 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -285,7 +285,7 @@ void DPAINT_OT_output_toggle(wmOperatorType *ot) typedef struct DynamicPaintBakeJob { /* from wmJob */ void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; struct Main *bmain; @@ -429,7 +429,7 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) ED_update_for_newframe(job->bmain, job->depsgraph); } -static void dpaint_bake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void dpaint_bake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { DynamicPaintBakeJob *job = customdata; @@ -450,7 +450,7 @@ static void dpaint_bake_startjob(void *customdata, short *stop, short *do_update dynamicPaint_bakeImageSequence(job); *do_update = true; - *stop = 0; + *stop = false; } /* diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 314796e96e4..d5e55c99444 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -61,7 +61,7 @@ typedef struct FluidJob { /* from wmJob */ void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; const char *type; const char *name; @@ -349,7 +349,7 @@ static void fluid_bake_endjob(void *customdata) } } -static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void fluid_bake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { FluidJob *job = customdata; FluidDomainSettings *fds = job->fmd->domain; @@ -428,7 +428,7 @@ static void fluid_bake_startjob(void *customdata, short *stop, short *do_update, *do_update = true; } if (stop) { - *stop = 0; + *stop = false; } } @@ -461,7 +461,7 @@ static void fluid_free_endjob(void *customdata) } } -static void fluid_free_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void fluid_free_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { FluidJob *job = customdata; FluidDomainSettings *fds = job->fmd->domain; @@ -504,7 +504,7 @@ static void fluid_free_startjob(void *customdata, short *stop, short *do_update, #endif *do_update = true; - *stop = 0; + *stop = false; /* Update scene so that viewport shows freed up scene */ ED_update_for_newframe(job->bmain, job->depsgraph); diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 97cd0d1d149..9fac93187ee 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -86,7 +86,7 @@ static bool ptcache_add_remove_poll(bContext *C) typedef struct PointCacheJob { wmWindowManager *wm; void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; PTCacheBaker *baker; @@ -126,7 +126,7 @@ static void ptcache_job_update(void *customdata, float progress, int *cancel) *(job->progress) = progress; } -static void ptcache_job_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void ptcache_job_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { PointCacheJob *job = customdata; @@ -144,7 +144,7 @@ static void ptcache_job_startjob(void *customdata, short *stop, short *do_update BKE_ptcache_bake(job->baker); *do_update = true; - *stop = 0; + *stop = false; } static void ptcache_job_endjob(void *customdata) diff --git a/source/blender/editors/render/render_internal.cc b/source/blender/editors/render/render_internal.cc index 41f1497cac2..5abf5867f92 100644 --- a/source/blender/editors/render/render_internal.cc +++ b/source/blender/editors/render/render_internal.cc @@ -69,7 +69,7 @@ #include "render_intern.hh" /* Render Callbacks */ -static int render_break(void *rjv); +static bool render_break(void *rjv); struct RenderJob { Main *main; @@ -87,8 +87,8 @@ struct RenderJob { Image *image; ImageUser iuser; bool image_outdated; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; ReportList *reports; int orig_layer; @@ -638,7 +638,7 @@ static void current_scene_update(void *rjv, Scene *scene) rj->iuser.scene = scene; } -static void render_startjob(void *rjv, short *stop, short *do_update, float *progress) +static void render_startjob(void *rjv, bool *stop, bool *do_update, float *progress) { RenderJob *rj = static_cast<RenderJob *>(rjv); @@ -792,29 +792,29 @@ static void render_endjob(void *rjv) } /* called by render, check job 'stop' value or the global */ -static int render_breakjob(void *rjv) +static bool render_breakjob(void *rjv) { RenderJob *rj = static_cast<RenderJob *>(rjv); if (G.is_break) { - return 1; + return true; } if (rj->stop && *(rj->stop)) { - return 1; + return true; } - return 0; + return false; } /** * For exec() when there is no render job * NOTE: this won't check for the escape key being pressed, but doing so isn't thread-safe. */ -static int render_break(void * /*rjv*/) +static bool render_break(void * /*rjv*/) { if (G.is_break) { - return 1; + return true; } - return 0; + return false; } /* runs in thread, no cursor setting here works. careful with notifiers too (malloc conflicts) */ diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc index 5bfa038b4f4..09394ea33be 100644 --- a/source/blender/editors/render/render_preview.cc +++ b/source/blender/editors/render/render_preview.cc @@ -104,7 +104,7 @@ static void icon_copy_rect(ImBuf *ibuf, uint w, uint h, uint *rect); struct ShaderPreview { /* from wmJob */ void *owner; - short *stop, *do_update; + bool *stop, *do_update; Scene *scene; ID *id, *id_copy; @@ -1047,7 +1047,7 @@ static void shader_preview_update(void *spv, RenderResult * /*rr*/, struct rcti } /* called by renderer, checks job value */ -static int shader_preview_break(void *spv) +static bool shader_preview_break(void *spv) { ShaderPreview *sp = static_cast<ShaderPreview *>(spv); @@ -1223,7 +1223,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs } /* runs inside thread for material and icons */ -static void shader_preview_startjob(void *customdata, short *stop, short *do_update) +static void shader_preview_startjob(void *customdata, bool *stop, bool *do_update) { ShaderPreview *sp = static_cast<ShaderPreview *>(customdata); @@ -1408,7 +1408,7 @@ static void set_alpha(char *cp, int sizex, int sizey, char alpha) } } -static void icon_preview_startjob(void *customdata, short *stop, short *do_update) +static void icon_preview_startjob(void *customdata, bool *stop, bool *do_update) { ShaderPreview *sp = static_cast<ShaderPreview *>(customdata); @@ -1488,8 +1488,8 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat * does not run two of them at the same time. */ static void common_preview_startjob(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float * /*progress*/) { ShaderPreview *sp = static_cast<ShaderPreview *>(customdata); @@ -1509,8 +1509,8 @@ static void common_preview_startjob(void *customdata, static void other_id_types_preview_render(IconPreview *ip, IconPreviewSize *cur_size, const ePreviewRenderMethod pr_method, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ShaderPreview *sp = MEM_cnew<ShaderPreview>("Icon ShaderPreview"); @@ -1570,8 +1570,8 @@ static int icon_previewimg_size_index_get(const IconPreviewSize *icon_size, } static void icon_preview_startjob_all_sizes(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { IconPreview *ip = (IconPreview *)customdata; @@ -1735,7 +1735,7 @@ class PreviewLoadJob { void push_load_request(PreviewImage *preview, eIconSizes icon_size); private: - static void run_fn(void *customdata, short *stop, short *do_update, float *progress); + static void run_fn(void *customdata, bool *stop, bool *do_update, float *progress); static void update_fn(void *customdata); static void end_fn(void *customdata); static void free_fn(void *customdata); @@ -1755,7 +1755,8 @@ PreviewLoadJob::~PreviewLoadJob() PreviewLoadJob &PreviewLoadJob::ensure_job(wmWindowManager *wm, wmWindow *win) { - wmJob *wm_job = WM_jobs_get(wm, win, nullptr, "Load Previews", 0, WM_JOB_TYPE_LOAD_PREVIEW); + wmJob *wm_job = WM_jobs_get( + wm, win, nullptr, "Load Previews", eWM_JobFlag(0), WM_JOB_TYPE_LOAD_PREVIEW); if (!WM_jobs_is_running(wm_job)) { PreviewLoadJob *job_data = MEM_new<PreviewLoadJob>("PreviewLoadJobData"); @@ -1776,7 +1777,7 @@ void PreviewLoadJob::load_jobless(PreviewImage *preview, const eIconSizes icon_s job_data.push_load_request(preview, icon_size); - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0; run_fn(&job_data, &stop, &do_update, &progress); update_fn(&job_data); @@ -1798,7 +1799,7 @@ void PreviewLoadJob::push_load_request(PreviewImage *preview, const eIconSizes i BLI_thread_queue_push(todo_queue_, &requested_previews_.back()); } -void PreviewLoadJob::run_fn(void *customdata, short *stop, short *do_update, float * /*progress*/) +void PreviewLoadJob::run_fn(void *customdata, bool *stop, bool *do_update, float * /*progress*/) { PreviewLoadJob *job_data = static_cast<PreviewLoadJob *>(customdata); @@ -1936,7 +1937,7 @@ void ED_preview_icon_render( } IconPreview ip = {nullptr}; - short stop = false, update = false; + bool stop = false, update = false; float progress = 0.0f; ED_preview_ensure_dbase(); diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 83ce447e8cf..e5c2b9702e5 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -1398,7 +1398,7 @@ static int light_cache_bake_exec(bContext *C, wmOperator *op) light_cache_bake_tag_cache(scene, op); - short stop = 0, do_update; + bool stop = false, do_update; float progress; /* Not actually used. */ EEVEE_lightbake_job(rj, &stop, &do_update, &progress); EEVEE_lightbake_job_data_free(rj); diff --git a/source/blender/editors/sculpt_paint/paint_image.cc b/source/blender/editors/sculpt_paint/paint_image.cc index 8c6358520ca..f334b2eb8f8 100644 --- a/source/blender/editors/sculpt_paint/paint_image.cc +++ b/source/blender/editors/sculpt_paint/paint_image.cc @@ -780,20 +780,7 @@ void ED_object_texture_paint_mode_enter_ex(Main *bmain, Scene *scene, Object *ob } if (ima) { - wmWindowManager *wm = static_cast<wmWindowManager *>(bmain->wm.first); - LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { - const bScreen *screen = WM_window_get_active_screen(win); - LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - SpaceLink *sl = static_cast<SpaceLink *>(area->spacedata.first); - if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)sl; - - if (!sima->pin) { - ED_space_image_set(bmain, sima, ima, true); - } - } - } - } + ED_space_image_sync(bmain, ima, false); } ob->mode |= OB_MODE_TEXTURE_PAINT; diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index ea33449f0dd..c85044bf915 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -74,6 +74,7 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" +#include "ED_image.h" #include "ED_node.h" #include "ED_object.h" #include "ED_paint.h" @@ -6704,6 +6705,7 @@ static bool proj_paint_add_slot(bContext *C, wmOperator *op) BKE_texpaint_slot_refresh_cache(scene, ma, ob); BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_USER_NEW_IMAGE); WM_event_add_notifier(C, NC_IMAGE | NA_ADDED, ima); + ED_space_image_sync(bmain, ima, false); } if (layer) { BKE_texpaint_slot_refresh_cache(scene, ma, ob); diff --git a/source/blender/editors/sculpt_paint/sculpt_brush_types.c b/source/blender/editors/sculpt_paint/sculpt_brush_types.c index 92541d10a59..666fa884e03 100644 --- a/source/blender/editors/sculpt_paint/sculpt_brush_types.c +++ b/source/blender/editors/sculpt_paint/sculpt_brush_types.c @@ -1441,6 +1441,9 @@ static void do_rotate_brush_task_cb_ex(void *__restrict userdata, if (!sculpt_brush_test_sq_fn(&test, orig_data.co)) { continue; } + + SCULPT_automasking_node_update(ss, &automask_data, &vd); + float vec[3], rot[3][3]; const float fade = bstrength * SCULPT_brush_strength_factor(ss, brush, diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c index 9a690f36aab..10a037a1c3c 100644 --- a/source/blender/editors/space_clip/clip_editor.c +++ b/source/blender/editors/space_clip/clip_editor.c @@ -676,8 +676,8 @@ typedef struct PrefetchQueue { SpinLock spin; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; } PrefetchQueue; @@ -819,7 +819,7 @@ static uchar *prefetch_thread_next_frame(PrefetchQueue *queue, (queue->initial_frame - queue->current_frame); } - *queue->do_update = 1; + *queue->do_update = true; *queue->progress = (float)frames_processed / (queue->end_frame - queue->start_frame); } } @@ -868,7 +868,7 @@ static void prefetch_task_func(TaskPool *__restrict pool, void *task_data) if (!result) { /* no more space in the cache, stop reading frames */ - *queue->stop = 1; + *queue->stop = true; break; } } @@ -880,8 +880,8 @@ static void start_prefetch_threads(MovieClip *clip, int end_frame, short render_size, short render_flag, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { int tot_thread = BLI_task_scheduler_num_threads(); @@ -918,7 +918,7 @@ static bool prefetch_movie_frame(MovieClip *clip, int frame, short render_size, short render_flag, - short *stop) + bool *stop) { MovieClipUser user = *DNA_struct_default_get(MovieClipUser); @@ -940,14 +940,14 @@ static bool prefetch_movie_frame(MovieClip *clip, if (!result) { /* no more space in the cache, we could stop prefetching here */ - *stop = 1; + *stop = true; } IMB_freeImBuf(ibuf); } else { /* error reading frame, fair enough stop attempting further reading */ - *stop = 1; + *stop = true; } } @@ -961,8 +961,8 @@ static void do_prefetch_movie(MovieClip *clip, int end_frame, short render_size, short render_flag, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { int frame; @@ -976,7 +976,7 @@ static void do_prefetch_movie(MovieClip *clip, frames_processed++; - *do_update = 1; + *do_update = true; *progress = (float)frames_processed / (end_frame - start_frame); } @@ -988,12 +988,12 @@ static void do_prefetch_movie(MovieClip *clip, frames_processed++; - *do_update = 1; + *do_update = true; *progress = (float)frames_processed / (end_frame - start_frame); } } -static void prefetch_startjob(void *pjv, short *stop, short *do_update, float *progress) +static void prefetch_startjob(void *pjv, bool *stop, bool *do_update, float *progress) { PrefetchJob *pj = pjv; diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 486f9f9ccb0..2c0668625a0 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1219,8 +1219,8 @@ static void do_movie_proxy(void *pjv, int UNUSED(build_count), int *build_undistort_sizes, int build_undistort_count, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ProxyJob *pj = pjv; @@ -1285,8 +1285,8 @@ typedef struct ProxyQueue { int efra; SpinLock spin; - const short *stop; - short *do_update; + const bool *stop; + bool *do_update; float *progress; } ProxyQueue; @@ -1343,7 +1343,7 @@ static uchar *proxy_thread_next_frame(ProxyQueue *queue, queue->cfra++; close(file); - *queue->do_update = 1; + *queue->do_update = true; *queue->progress = (float)(queue->cfra - queue->sfra) / (queue->efra - queue->sfra); } BLI_spin_unlock(&queue->spin); @@ -1392,8 +1392,8 @@ static void do_sequence_proxy(void *pjv, int build_undistort_count, /* Cannot be const, because it is assigned to a non-const variable. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ProxyJob *pj = pjv; @@ -1452,7 +1452,7 @@ static void do_sequence_proxy(void *pjv, MEM_freeN(handles); } -static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress) +static void proxy_startjob(void *pjv, bool *stop, bool *do_update, float *progress) { ProxyJob *pj = pjv; MovieClip *clip = pj->clip; diff --git a/source/blender/editors/space_clip/tracking_ops_solve.c b/source/blender/editors/space_clip/tracking_ops_solve.c index bfa45053e96..ddfcaa282e3 100644 --- a/source/blender/editors/space_clip/tracking_ops_solve.c +++ b/source/blender/editors/space_clip/tracking_ops_solve.c @@ -87,7 +87,7 @@ static void solve_camera_updatejob(void *scv) BLI_strncpy(tracking->stats->message, scj->stats_message, sizeof(tracking->stats->message)); } -static void solve_camera_startjob(void *scv, short *stop, short *do_update, float *progress) +static void solve_camera_startjob(void *scv, bool *stop, bool *do_update, float *progress) { SolveCameraJob *scj = (SolveCameraJob *)scv; BKE_tracking_reconstruction_solve( diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index f6fd2980c19..2753af609e7 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -204,8 +204,8 @@ static void track_markers_startjob( void *tmv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { TrackMarkersJob *tmj = (TrackMarkersJob *)tmv; @@ -353,7 +353,7 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job) return OPERATOR_RUNNING_MODAL; } - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; track_markers_startjob(tmj, &stop, &do_update, &progress); track_markers_endjob(tmj); diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 3870178f119..9ca5b1da7da 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -246,7 +246,7 @@ struct FileList { bool (*check_dir_fn)(struct FileList *, char *, const bool); /* Fill filelist (to be called by read job). */ - void (*read_job_fn)(struct FileListReadJob *, short *, short *, float *); + void (*read_job_fn)(struct FileListReadJob *, bool *, bool *, float *); /* Filter an entry of current filelist. */ bool (*filter_fn)(struct FileListInternEntry *, const char *, FileListFilter *); @@ -295,24 +295,24 @@ enum { static ImBuf *gSpecialFileImages[SPECIAL_IMG_MAX]; static void filelist_readjob_main(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_lib(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_dir(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_asset_library(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); static void filelist_readjob_main_assets(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); /* helper, could probably go in BKE actually? */ @@ -3401,7 +3401,7 @@ struct FileListReadJob { static void filelist_readjob_append_entries(FileListReadJob *job_params, ListBase *from_entries, int from_entries_num, - short *do_update) + bool *do_update) { BLI_assert(BLI_listbase_count(from_entries) == from_entries_num); if (from_entries_num <= 0) { @@ -3456,8 +3456,8 @@ static bool filelist_readjob_should_recurse_into_entry(const int max_recursion, static void filelist_readjob_recursive_dir_add_items(const bool do_lib, FileListReadJob *job_params, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3594,8 +3594,8 @@ static void filelist_readjob_recursive_dir_add_items(const bool do_lib, static void filelist_readjob_do(const bool do_lib, FileListReadJob *job_params, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3611,16 +3611,16 @@ static void filelist_readjob_do(const bool do_lib, } static void filelist_readjob_dir(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { filelist_readjob_do(false, job_params, stop, do_update, progress); } static void filelist_readjob_lib(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { filelist_readjob_do(true, job_params, stop, do_update, progress); @@ -3643,7 +3643,7 @@ static void filelist_asset_library_path(const FileListReadJob *job_params, /** * Load asset library data, which currently means loading the asset catalogs for the library. */ -static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, short *do_update) +static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, bool *do_update) { FileList *tmp_filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3667,8 +3667,8 @@ static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params } static void filelist_readjob_main_assets_add_items(FileListReadJob *job_params, - short * /*stop*/, - short *do_update, + bool * /*stop*/, + bool *do_update, float * /*progress*/) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3729,8 +3729,8 @@ static bool filelist_contains_main(const FileList *filelist, const Main *bmain) } static void filelist_readjob_asset_library(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3753,8 +3753,8 @@ static void filelist_readjob_asset_library(FileListReadJob *job_params, } static void filelist_readjob_main(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { /* TODO! */ @@ -3762,8 +3762,8 @@ static void filelist_readjob_main(FileListReadJob *job_params, } static void filelist_readjob_main_assets(FileListReadJob *job_params, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { FileList *filelist = job_params->tmp_filelist; /* Use the thread-safe filelist queue. */ @@ -3791,7 +3791,7 @@ static bool filelist_readjob_is_partial_read(const FileListReadJob *read_job) * some current entries are kept and we just call the readjob to update the main files (see * #FileListReadJob.only_main_data). */ -static void filelist_readjob_startjob(void *flrjv, short *stop, short *do_update, float *progress) +static void filelist_readjob_startjob(void *flrjv, bool *stop, bool *do_update, float *progress) { FileListReadJob *flrj = static_cast<FileListReadJob *>(flrjv); @@ -3939,8 +3939,8 @@ void filelist_readjob_start(FileList *filelist, const int space_notifier, const const bool no_threads = (filelist->tags & FILELIST_TAGS_NO_THREADS) || flrj->only_main_data; if (no_threads) { - short dummy_stop = false; - short dummy_do_update = false; + bool dummy_stop = false; + bool dummy_do_update = false; float dummy_progress = 0.0f; /* Single threaded execution. Just directly call the callbacks. */ diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index cea53908d4f..959f8b01ec8 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -1147,8 +1147,8 @@ static void fsmenu_bookmark_validate_job_startjob( void *fsmenuv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *UNUSED(progress)) { FSMenu *fsmenu = fsmenuv; diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 0122e509c3b..68b1a9e4466 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -67,6 +67,30 @@ void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automati WM_main_add_notifier(NC_SPACE | ND_SPACE_IMAGE, NULL); } +void ED_space_image_sync(struct Main *bmain, struct Image *image, bool ignore_render_viewer) +{ + wmWindowManager *wm = (wmWindowManager *)bmain->wm.first; + LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { + const bScreen *screen = WM_window_get_active_screen(win); + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype != SPACE_IMAGE) { + continue; + } + SpaceImage *sima = (SpaceImage *)sl; + if (sima->pin) { + continue; + } + if (ignore_render_viewer && sima->image && + ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + continue; + } + ED_space_image_set(bmain, sima, image, true); + } + } + } +} + void ED_space_image_auto_set(const bContext *C, SpaceImage *sima) { if (sima->mode != SI_MODE_UV || sima->pin) { diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index c6aeda8c9ab..7982b47f363 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -89,8 +89,8 @@ struct CompoJob { Depsgraph *compositor_depsgraph; bNodeTree *localtree; /* Jon system integration. */ - const short *stop; - short *do_update; + const bool *stop; + bool *do_update; float *progress; }; @@ -166,7 +166,7 @@ static int compo_get_recalc_flags(const bContext *C) } /* called by compo, only to check job 'stop' value */ -static int compo_breakjob(void *cjv) +static bool compo_breakjob(void *cjv) { CompoJob *cj = (CompoJob *)cjv; @@ -250,8 +250,8 @@ static void compo_progressjob(void *cjv, float progress) static void compo_startjob(void *cjv, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { CompoJob *cj = (CompoJob *)cjv; @@ -737,26 +737,7 @@ void ED_node_set_active( * - current image is not a Render Result or ViewerNode (want to keep looking at these) */ if (node->id != nullptr && GS(node->id->name) == ID_IM) { Image *image = (Image *)node->id; - wmWindowManager *wm = (wmWindowManager *)bmain->wm.first; - LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { - const bScreen *screen = WM_window_get_active_screen(win); - LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { - LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { - if (sl->spacetype != SPACE_IMAGE) { - continue; - } - SpaceImage *sima = (SpaceImage *)sl; - if (sima->pin) { - continue; - } - if (sima->image && - ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { - continue; - } - ED_space_image_set(bmain, sima, image, true); - } - } - } + ED_space_image_sync(bmain, image, true); } if (r_active_texture_changed) { diff --git a/source/blender/editors/space_sequencer/sequencer_drag_drop.c b/source/blender/editors/space_sequencer/sequencer_drag_drop.c index c892e7d7e55..d43ce26d2a1 100644 --- a/source/blender/editors/space_sequencer/sequencer_drag_drop.c +++ b/source/blender/editors/space_sequencer/sequencer_drag_drop.c @@ -505,8 +505,8 @@ typedef struct DropJobData { } DropJobData; static void prefetch_data_fn(void *custom_data, - short *UNUSED(stop), - short *UNUSED(do_update), + bool *UNUSED(stop), + bool *UNUSED(do_update), float *UNUSED(progress)) { DropJobData *job_data = (DropJobData *)custom_data; diff --git a/source/blender/editors/space_sequencer/sequencer_preview.c b/source/blender/editors/space_sequencer/sequencer_preview.c index 2820edc95aa..2410055d76d 100644 --- a/source/blender/editors/space_sequencer/sequencer_preview.c +++ b/source/blender/editors/space_sequencer/sequencer_preview.c @@ -51,7 +51,7 @@ static void free_preview_job(void *data) } /* Only this runs inside thread. */ -static void preview_startjob(void *data, short *stop, short *do_update, float *progress) +static void preview_startjob(void *data, bool *stop, bool *do_update, float *progress) { PreviewJob *pj = data; PreviewJobAudio *previewjb; diff --git a/source/blender/editors/space_sequencer/sequencer_proxy.c b/source/blender/editors/space_sequencer/sequencer_proxy.c index c851d3a29d4..30817771015 100644 --- a/source/blender/editors/space_sequencer/sequencer_proxy.c +++ b/source/blender/editors/space_sequencer/sequencer_proxy.c @@ -118,7 +118,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) if (seq->flag & SELECT) { ListBase queue = {NULL, NULL}; LinkData *link; - short stop = 0, do_update; + bool stop = false, do_update; float progress; SEQ_proxy_rebuild_context(bmain, depsgraph, scene, seq, file_list, &queue, false); @@ -126,7 +126,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) for (link = queue.first; link; link = link->next) { struct SeqIndexBuildContext *context = link->data; SEQ_proxy_rebuild(context, &stop, &do_update, &progress); - SEQ_proxy_rebuild_finish(context, 0); + SEQ_proxy_rebuild_finish(context, false); } SEQ_relations_free_imbuf(scene, &ed->seqbase, false); } diff --git a/source/blender/editors/space_sequencer/sequencer_thumbnails.c b/source/blender/editors/space_sequencer/sequencer_thumbnails.c index 460054f3b44..d1606b14152 100644 --- a/source/blender/editors/space_sequencer/sequencer_thumbnails.c +++ b/source/blender/editors/space_sequencer/sequencer_thumbnails.c @@ -132,8 +132,8 @@ static void seq_get_thumb_image_dimensions(Sequence *seq, } static void thumbnail_start_job(void *data, - short *stop, - short *UNUSED(do_update), + bool *stop, + bool *UNUSED(do_update), float *UNUSED(progress)) { ThumbnailDrawJob *tj = data; diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index c0030ae1a70..87c467d44d8 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -258,6 +258,8 @@ static void snap_object_data_mesh_get(SnapObjectContext *sctx, BLI_assert(r_treedata->loop == loops.data()); BLI_assert(!polys.data() || r_treedata->looptri); BLI_assert(!r_treedata->tree || r_treedata->looptri); + + UNUSED_VARS_NDEBUG(verts, polys, loops); } /* Searches for the #Mesh_Runtime associated with the object that is most likely to be updated due diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index b65f4889347..0e77a8ba4ad 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -111,8 +111,8 @@ bool ED_object_get_active_image(Object *ob, int mat_nr, Image **r_ima, ImageUser **r_iuser, - bNode **r_node, - bNodeTree **r_ntree) + const bNode **r_node, + const bNodeTree **r_ntree) { Material *ma = DEG_is_evaluated_object(ob) ? BKE_object_material_get_eval(ob, mat_nr) : BKE_object_material_get(ob, mat_nr); diff --git a/source/blender/freestyle/intern/python/BPy_BBox.cpp b/source/blender/freestyle/intern/python/BPy_BBox.cpp index 8fb5f60eff7..30ff0af7c1e 100644 --- a/source/blender/freestyle/intern/python/BPy_BBox.cpp +++ b/source/blender/freestyle/intern/python/BPy_BBox.cpp @@ -65,43 +65,44 @@ static PyObject *BBox_repr(BPy_BBox *self) /*-----------------------BPy_BBox type definition ------------------------------*/ PyTypeObject BBox_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "BBox", /* tp_name */ - sizeof(BPy_BBox), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BBox_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)BBox_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BBox_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BBox_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "BBox", + /*tp_basicsize*/ sizeof(BPy_BBox), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BBox_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)BBox_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ BBox_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)BBox_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp index 6b23565a23e..3f9e96ffa73 100644 --- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp @@ -137,43 +137,44 @@ static PyGetSetDef BPy_BinaryPredicate0D_getseters[] = { /*-----------------------BPy_BinaryPredicate0D type definition ------------------------------*/ PyTypeObject BinaryPredicate0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "BinaryPredicate0D", /* tp_name */ - sizeof(BPy_BinaryPredicate0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BinaryPredicate0D___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)BinaryPredicate0D___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)BinaryPredicate0D___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BinaryPredicate0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_BinaryPredicate0D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BinaryPredicate0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "BinaryPredicate0D", + /*tp_basicsize*/ sizeof(BPy_BinaryPredicate0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BinaryPredicate0D___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)BinaryPredicate0D___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)BinaryPredicate0D___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ BinaryPredicate0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_BinaryPredicate0D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)BinaryPredicate0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp index 9e3e5979871..bf4bf2d099a 100644 --- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp @@ -170,44 +170,45 @@ static PyGetSetDef BPy_BinaryPredicate1D_getseters[] = { }; /*-----------------------BPy_BinaryPredicate1D type definition ------------------------------*/ + PyTypeObject BinaryPredicate1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "BinaryPredicate1D", /* tp_name */ - sizeof(BPy_BinaryPredicate1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BinaryPredicate1D___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)BinaryPredicate1D___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)BinaryPredicate1D___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BinaryPredicate1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_BinaryPredicate1D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BinaryPredicate1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "BinaryPredicate1D", + /*tp_basicsize*/ sizeof(BPy_BinaryPredicate1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BinaryPredicate1D___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)BinaryPredicate1D___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)BinaryPredicate1D___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ BinaryPredicate1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_BinaryPredicate1D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)BinaryPredicate1D___init__, + /*tp_alloc*/ nullptr, + PyType_GenericNew, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp index d79c2f4d9b0..a4b83b840f3 100644 --- a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp +++ b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp @@ -280,10 +280,14 @@ static PyMethodDef module_functions[] = { static PyModuleDef module_definition = { PyModuleDef_HEAD_INIT, - "Freestyle.ContextFunctions", - module_docstring, - -1, - module_functions, + /*m_name*/ "Freestyle.ContextFunctions", + /*m_doc*/ module_docstring, + /*m_size*/ -1, + /*m_methods*/ module_functions, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; //------------------- MODULE INITIALIZATION -------------------------------- diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index 237f1802026..f99e66c822d 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -509,10 +509,14 @@ static PyMethodDef module_functions[] = { static PyModuleDef module_definition = { PyModuleDef_HEAD_INIT, - "_freestyle", - module_docstring, - -1, - module_functions, + /*m_name*/ "_freestyle", + /*m_doc*/ module_docstring, + /*m_size*/ -1, + /*m_methods*/ module_functions, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; //-------------------MODULE INITIALIZATION-------------------------------- diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp index 7f71bbf1fdd..7bc3f2ea05a 100644 --- a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp +++ b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp @@ -522,43 +522,44 @@ static Py_hash_t FrsMaterial_hash(PyObject *self) /*-----------------------BPy_FrsMaterial type definition ------------------------------*/ PyTypeObject FrsMaterial_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Material", /* tp_name */ - sizeof(BPy_FrsMaterial), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)FrsMaterial_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)FrsMaterial_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - (hashfunc)FrsMaterial_hash, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FrsMaterial_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - (richcmpfunc)BPy_FrsMaterial_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_FrsMaterial_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FrsMaterial_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Material", + /*tp_basicsize*/ sizeof(BPy_FrsMaterial), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)FrsMaterial_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)FrsMaterial_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ (hashfunc)FrsMaterial_hash, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FrsMaterial_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ (richcmpfunc)BPy_FrsMaterial_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_FrsMaterial_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FrsMaterial_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp b/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp index 684edb26a97..3a07fdb3d88 100644 --- a/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp +++ b/source/blender/freestyle/intern/python/BPy_FrsNoise.cpp @@ -316,43 +316,44 @@ static PyMethodDef BPy_FrsNoise_methods[] = { /*-----------------------BPy_FrsNoise type definition ------------------------------*/ PyTypeObject FrsNoise_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Noise", /* tp_name */ - sizeof(BPy_FrsNoise), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)FrsNoise_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)FrsNoise_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FrsNoise_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_FrsNoise_methods, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FrsNoise_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Noise", + /*tp_basicsize*/ sizeof(BPy_FrsNoise), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)FrsNoise_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)FrsNoise_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FrsNoise_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_FrsNoise_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FrsNoise_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_Id.cpp b/source/blender/freestyle/intern/python/BPy_Id.cpp index 66880d6185c..7745bc11512 100644 --- a/source/blender/freestyle/intern/python/BPy_Id.cpp +++ b/source/blender/freestyle/intern/python/BPy_Id.cpp @@ -155,43 +155,44 @@ static PyGetSetDef BPy_Id_getseters[] = { /*-----------------------BPy_Id type definition ------------------------------*/ PyTypeObject Id_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Id", /* tp_name */ - sizeof(BPy_Id), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Id_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)Id_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Id_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - (richcmpfunc)Id_RichCompare, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_Id_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Id_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Id", + /*tp_basicsize*/ sizeof(BPy_Id), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Id_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)Id_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Id_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ (richcmpfunc)Id_RichCompare, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_Id_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Id_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp index 711cf9c6bab..c862b226271 100644 --- a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp +++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp @@ -112,10 +112,14 @@ static PyMethodDef module_functions[] = { static PyModuleDef module_definition = { PyModuleDef_HEAD_INIT, - "Freestyle.Integrator", - module_docstring, - -1, - module_functions, + /*m_name*/ "Freestyle.Integrator", + /*m_doc*/ module_docstring, + /*m_size*/ -1, + /*m_methods*/ module_functions, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /*-----------------------BPy_IntegrationType type definition ------------------------------*/ @@ -139,43 +143,44 @@ PyDoc_STRVAR(IntegrationType_doc, " last of the values obtained for the 0D elements."); PyTypeObject IntegrationType_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "IntegrationType", /* tp_name */ - sizeof(PyLongObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - IntegrationType_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &PyLong_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "IntegrationType", + /*tp_basicsize*/ sizeof(PyLongObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ IntegrationType_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &PyLong_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ nullptr, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /*-----------------------BPy_IntegrationType instance definitions -------------------------*/ diff --git a/source/blender/freestyle/intern/python/BPy_Interface0D.cpp b/source/blender/freestyle/intern/python/BPy_Interface0D.cpp index 083fdbf58db..11ac078124a 100644 --- a/source/blender/freestyle/intern/python/BPy_Interface0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_Interface0D.cpp @@ -297,43 +297,44 @@ static PyGetSetDef BPy_Interface0D_getseters[] = { /*-----------------------BPy_Interface0D type definition ------------------------------*/ PyTypeObject Interface0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Interface0D", /* tp_name */ - sizeof(BPy_Interface0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Interface0D_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)Interface0D_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Interface0D_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_Interface0D_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_Interface0D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Interface0D_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Interface0D", + /*tp_basicsize*/ sizeof(BPy_Interface0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Interface0D_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)Interface0D_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Interface0D_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_Interface0D_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_Interface0D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Interface0D_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp index d636fb4e6b8..992d69ad594 100644 --- a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp @@ -323,43 +323,44 @@ static PyGetSetDef BPy_Interface1D_getseters[] = { /*-----------------------BPy_Interface1D type definition ------------------------------*/ PyTypeObject Interface1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Interface1D", /* tp_name */ - sizeof(BPy_Interface1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Interface1D_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)Interface1D_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Interface1D_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_Interface1D_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_Interface1D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Interface1D_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Interface1D", + /*tp_basicsize*/ sizeof(BPy_Interface1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Interface1D_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)Interface1D_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Interface1D_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_Interface1D_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_Interface1D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Interface1D_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_Iterator.cpp b/source/blender/freestyle/intern/python/BPy_Iterator.cpp index b167faa15e5..f35c201d3eb 100644 --- a/source/blender/freestyle/intern/python/BPy_Iterator.cpp +++ b/source/blender/freestyle/intern/python/BPy_Iterator.cpp @@ -212,43 +212,44 @@ static PyGetSetDef BPy_Iterator_getseters[] = { /*-----------------------BPy_Iterator type definition ------------------------------*/ PyTypeObject Iterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Iterator", /* tp_name */ - sizeof(BPy_Iterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Iterator_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)Iterator_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Iterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_Iterator_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_Iterator_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Iterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Iterator", + /*tp_basicsize*/ sizeof(BPy_Iterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Iterator_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)Iterator_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Iterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_Iterator_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_Iterator_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Iterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_MediumType.cpp b/source/blender/freestyle/intern/python/BPy_MediumType.cpp index cf8e900e003..72bb8203077 100644 --- a/source/blender/freestyle/intern/python/BPy_MediumType.cpp +++ b/source/blender/freestyle/intern/python/BPy_MediumType.cpp @@ -29,43 +29,44 @@ PyDoc_STRVAR(MediumType_doc, "* Stroke.OPAQUE_MEDIUM: To simulate an opaque medium (oil, spray...)."); PyTypeObject MediumType_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "MediumType", /* tp_name */ - sizeof(PyLongObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - MediumType_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &PyLong_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "MediumType", + /*tp_basicsize*/ sizeof(PyLongObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ MediumType_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &PyLong_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ nullptr, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /*-----------------------BPy_IntegrationType instance definitions -------------------------*/ diff --git a/source/blender/freestyle/intern/python/BPy_Nature.cpp b/source/blender/freestyle/intern/python/BPy_Nature.cpp index 33c4ce17820..c06e6859514 100644 --- a/source/blender/freestyle/intern/python/BPy_Nature.cpp +++ b/source/blender/freestyle/intern/python/BPy_Nature.cpp @@ -23,40 +23,42 @@ static PyObject *BPy_Nature_or(PyObject *a, PyObject *b); /*-----------------------BPy_Nature number method definitions --------------------*/ static PyNumberMethods nature_as_number = { - nullptr, /* binaryfunc nb_add */ - nullptr, /* binaryfunc nb_subtract */ - nullptr, /* binaryfunc nb_multiply */ - nullptr, /* binaryfunc nb_remainder */ - nullptr, /* binaryfunc nb_divmod */ - nullptr, /* ternaryfunc nb_power */ - nullptr, /* unaryfunc nb_negative */ - nullptr, /* unaryfunc nb_positive */ - nullptr, /* unaryfunc nb_absolute */ - nullptr, /* inquiry nb_bool */ - nullptr, /* unaryfunc nb_invert */ - nullptr, /* binaryfunc nb_lshift */ - nullptr, /* binaryfunc nb_rshift */ - (binaryfunc)BPy_Nature_and, /* binaryfunc nb_and */ - (binaryfunc)BPy_Nature_xor, /* binaryfunc nb_xor */ - (binaryfunc)BPy_Nature_or, /* binaryfunc nb_or */ - nullptr, /* unaryfunc nb_int */ - nullptr, /* void *nb_reserved */ - nullptr, /* unaryfunc nb_float */ - nullptr, /* binaryfunc nb_inplace_add */ - nullptr, /* binaryfunc nb_inplace_subtract */ - nullptr, /* binaryfunc nb_inplace_multiply */ - nullptr, /* binaryfunc nb_inplace_remainder */ - nullptr, /* ternaryfunc nb_inplace_power */ - nullptr, /* binaryfunc nb_inplace_lshift */ - nullptr, /* binaryfunc nb_inplace_rshift */ - nullptr, /* binaryfunc nb_inplace_and */ - nullptr, /* binaryfunc nb_inplace_xor */ - nullptr, /* binaryfunc nb_inplace_or */ - nullptr, /* binaryfunc nb_floor_divide */ - nullptr, /* binaryfunc nb_true_divide */ - nullptr, /* binaryfunc nb_inplace_floor_divide */ - nullptr, /* binaryfunc nb_inplace_true_divide */ - nullptr, /* unaryfunc nb_index */ + /*nb_add*/ nullptr, + /*nb_subtract*/ nullptr, + /*nb_multiply*/ nullptr, + /*nb_remainder*/ nullptr, + /*nb_divmod*/ nullptr, + /*nb_power*/ nullptr, + /*nb_negative*/ nullptr, + /*nb_positive*/ nullptr, + /*nb_absolute*/ nullptr, + /*nb_bool*/ nullptr, + /*nb_invert*/ nullptr, + /*nb_lshift*/ nullptr, + /*nb_rshift*/ nullptr, + /*nb_and*/ (binaryfunc)BPy_Nature_and, + /*nb_xor*/ (binaryfunc)BPy_Nature_xor, + /*nb_or*/ (binaryfunc)BPy_Nature_or, + /*nb_int*/ nullptr, + /*nb_reserved*/ nullptr, + /*nb_float*/ nullptr, + /*nb_inplace_add*/ nullptr, + /*nb_inplace_subtract*/ nullptr, + /*nb_inplace_multiply*/ nullptr, + /*nb_inplace_remainder*/ nullptr, + /*nb_inplace_power*/ nullptr, + /*nb_inplace_lshift*/ nullptr, + /*nb_inplace_rshift*/ nullptr, + /*nb_inplace_and*/ nullptr, + /*nb_inplace_xor*/ nullptr, + /*nb_inplace_or*/ nullptr, + /*nb_floor_divide*/ nullptr, + /*nb_true_divide*/ nullptr, + /*nb_inplace_floor_divide*/ nullptr, + /*nb_inplace_true_divide*/ nullptr, + /*nb_index*/ nullptr, + /*nb_matrix_multiply*/ NULL, + /*nb_inplace_matrix_multiply*/ NULL, }; /*-----------------------BPy_Nature docstring ------------------------------------*/ @@ -91,43 +93,44 @@ PyDoc_STRVAR(Nature_doc, /*-----------------------BPy_Nature type definition ------------------------------*/ PyTypeObject Nature_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Nature", /* tp_name */ - sizeof(PyLongObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - &nature_as_number, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - Nature_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &PyLong_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Nature", + /*tp_basicsize*/ sizeof(PyLongObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ &nature_as_number, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ Nature_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &PyLong_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ nullptr, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /*-----------------------BPy_Nature instance definitions ----------------------------------*/ diff --git a/source/blender/freestyle/intern/python/BPy_Operators.cpp b/source/blender/freestyle/intern/python/BPy_Operators.cpp index 860573016f2..df2312c8680 100644 --- a/source/blender/freestyle/intern/python/BPy_Operators.cpp +++ b/source/blender/freestyle/intern/python/BPy_Operators.cpp @@ -756,43 +756,44 @@ static PyMethodDef BPy_Operators_methods[] = { /*-----------------------BPy_Operators type definition ------------------------------*/ PyTypeObject Operators_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Operators", /* tp_name */ - sizeof(BPy_Operators), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Operators_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - Operators_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_Operators_methods, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Operators", + /*tp_basicsize*/ sizeof(BPy_Operators), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Operators_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ Operators_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_Operators_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ nullptr, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp index 92867e36479..c3f4daf5d21 100644 --- a/source/blender/freestyle/intern/python/BPy_SShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp @@ -267,43 +267,44 @@ static PyGetSetDef BPy_SShape_getseters[] = { /*-----------------------BPy_SShape type definition ------------------------------*/ PyTypeObject SShape_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SShape", /* tp_name */ - sizeof(BPy_SShape), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)SShape_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)SShape_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SShape_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_SShape_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_SShape_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SShape_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "SShape", + /*tp_basicsize*/ sizeof(BPy_SShape), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)SShape_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)SShape_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SShape_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_SShape_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_SShape_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SShape_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp index c68c30f9602..ed2af40545a 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp @@ -661,43 +661,44 @@ static PyGetSetDef BPy_StrokeAttribute_getseters[] = { /*-----------------------BPy_StrokeAttribute type definition ------------------------------*/ PyTypeObject StrokeAttribute_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "StrokeAttribute", /* tp_name */ - sizeof(BPy_StrokeAttribute), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)StrokeAttribute_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)StrokeAttribute_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - StrokeAttribute_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_StrokeAttribute_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_StrokeAttribute_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)StrokeAttribute_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "StrokeAttribute", + /*tp_basicsize*/ sizeof(BPy_StrokeAttribute), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)StrokeAttribute_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)StrokeAttribute_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ StrokeAttribute_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_StrokeAttribute_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_StrokeAttribute_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)StrokeAttribute_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp b/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp index f9e1d0e86d3..42e8452a4b5 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeShader.cpp @@ -266,43 +266,44 @@ static PyGetSetDef BPy_StrokeShader_getseters[] = { /*-----------------------BPy_StrokeShader type definition ------------------------------*/ PyTypeObject StrokeShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "StrokeShader", /* tp_name */ - sizeof(BPy_StrokeShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)StrokeShader___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)StrokeShader___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - StrokeShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_StrokeShader_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_StrokeShader_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)StrokeShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "StrokeShader", + /*tp_basicsize*/ sizeof(BPy_StrokeShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)StrokeShader___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)StrokeShader___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ StrokeShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_StrokeShader_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_StrokeShader_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)StrokeShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.cpp index cf70c989054..a8f4c5e4f3a 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryFunction0D.cpp @@ -108,43 +108,44 @@ static PyGetSetDef BPy_UnaryFunction0D_getseters[] = { /*-----------------------BPy_UnaryFunction0D type definition ------------------------------*/ PyTypeObject UnaryFunction0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0D", /* tp_name */ - sizeof(BPy_UnaryFunction0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0D___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0D___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction0D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0D", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0D___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0D___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction0D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ nullptr, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.cpp index 65604de1f83..a78c6a056e6 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryFunction1D.cpp @@ -102,43 +102,44 @@ static PyGetSetDef BPy_UnaryFunction1D_getseters[] = { /*-----------------------BPy_UnaryFunction1D type definition ------------------------------*/ PyTypeObject UnaryFunction1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1D", /* tp_name */ - sizeof(BPy_UnaryFunction1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1D___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1D___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1D", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1D___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1D___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ nullptr, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp index b8169aae9cd..388f5d52ff0 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp @@ -151,43 +151,44 @@ static PyGetSetDef BPy_UnaryPredicate0D_getseters[] = { /*-----------------------BPy_UnaryPredicate0D type definition ------------------------------*/ PyTypeObject UnaryPredicate0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryPredicate0D", /* tp_name */ - sizeof(BPy_UnaryPredicate0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryPredicate0D___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryPredicate0D___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryPredicate0D___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryPredicate0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryPredicate0D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryPredicate0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryPredicate0D", + /*tp_basicsize*/ sizeof(BPy_UnaryPredicate0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryPredicate0D___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryPredicate0D___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryPredicate0D___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryPredicate0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryPredicate0D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryPredicate0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp index 94ff12a4b56..9240b4ed3ea 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp @@ -209,43 +209,44 @@ static PyGetSetDef BPy_UnaryPredicate1D_getseters[] = { /*-----------------------BPy_UnaryPredicate1D type definition ------------------------------*/ PyTypeObject UnaryPredicate1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryPredicate1D", /* tp_name */ - sizeof(BPy_UnaryPredicate1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryPredicate1D___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryPredicate1D___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryPredicate1D___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryPredicate1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryPredicate1D_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryPredicate1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryPredicate1D", + /*tp_basicsize*/ sizeof(BPy_UnaryPredicate1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryPredicate1D___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryPredicate1D___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryPredicate1D___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryPredicate1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryPredicate1D_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryPredicate1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_ViewMap.cpp b/source/blender/freestyle/intern/python/BPy_ViewMap.cpp index bc000c5f1a7..31d6b89828e 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewMap.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewMap.cpp @@ -168,43 +168,44 @@ static PyGetSetDef BPy_ViewMap_getseters[] = { /*-----------------------BPy_ViewMap type definition ------------------------------*/ PyTypeObject ViewMap_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ViewMap", /* tp_name */ - sizeof(BPy_ViewMap), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)ViewMap_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)ViewMap_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ViewMap_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_ViewMap_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_ViewMap_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ViewMap_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ViewMap", + /*tp_basicsize*/ sizeof(BPy_ViewMap), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)ViewMap_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)ViewMap_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ViewMap_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_ViewMap_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_ViewMap_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ViewMap_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp index 130526ac309..58c60e9b9fd 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp @@ -338,43 +338,44 @@ static PyGetSetDef BPy_ViewShape_getseters[] = { /*-----------------------BPy_ViewShape type definition ------------------------------*/ PyTypeObject ViewShape_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ViewShape", /* tp_name */ - sizeof(BPy_ViewShape), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)ViewShape_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)ViewShape_repr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ViewShape_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_ViewShape_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_ViewShape_getseters, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ViewShape_init, /* tp_init */ - nullptr, /* tp_alloc */ - PyType_GenericNew, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ViewShape", + /*tp_basicsize*/ sizeof(BPy_ViewShape), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)ViewShape_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)ViewShape_repr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ViewShape_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_ViewShape_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_ViewShape_getseters, + /*tp_base*/ nullptr, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ViewShape_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ PyType_GenericNew, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp index a76b40fd847..58ff6eeafa4 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_FalseBP1D.cpp @@ -42,44 +42,45 @@ static int FalseBP1D___init__(BPy_FalseBP1D *self, PyObject *args, PyObject *kwd } /*-----------------------BPy_FalseBP1D type definition ------------------------------*/ + PyTypeObject FalseBP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "FalseBP1D", /* tp_name */ - sizeof(BPy_FalseBP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FalseBP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &BinaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FalseBP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "FalseBP1D", + /*tp_basicsize*/ sizeof(BPy_FalseBP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FalseBP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &BinaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FalseBP1D___init__, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.cpp index fe68e4ed3b8..55025c43c17 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_Length2DBP1D.cpp @@ -45,43 +45,44 @@ static int Length2DBP1D___init__(BPy_Length2DBP1D *self, PyObject *args, PyObjec /*-----------------------BPy_Length2DBP1D type definition ------------------------------*/ PyTypeObject Length2DBP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Length2DBP1D", /* tp_name */ - sizeof(BPy_Length2DBP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Length2DBP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &BinaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Length2DBP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Length2DBP1D", + /*tp_basicsize*/ sizeof(BPy_Length2DBP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Length2DBP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &BinaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Length2DBP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.cpp index 48b112aca6a..e202b661171 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_SameShapeIdBP1D.cpp @@ -44,43 +44,44 @@ static int SameShapeIdBP1D___init__(BPy_SameShapeIdBP1D *self, PyObject *args, P /*-----------------------BPy_SameShapeIdBP1D type definition ------------------------------*/ PyTypeObject SameShapeIdBP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SameShapeIdBP1D", /* tp_name */ - sizeof(BPy_SameShapeIdBP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SameShapeIdBP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &BinaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SameShapeIdBP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "SameShapeIdBP1D", + /*tp_basicsize*/ sizeof(BPy_SameShapeIdBP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SameShapeIdBP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &BinaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SameShapeIdBP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.cpp index 5bf588d30d6..7dfcd10b468 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_TrueBP1D.cpp @@ -44,43 +44,44 @@ static int TrueBP1D___init__(BPy_TrueBP1D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_TrueBP1D type definition ------------------------------*/ PyTypeObject TrueBP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "TrueBP1D", /* tp_name */ - sizeof(BPy_TrueBP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TrueBP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &BinaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TrueBP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "TrueBP1D", + /*tp_basicsize*/ sizeof(BPy_TrueBP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ TrueBP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &BinaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)TrueBP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp index 2a88efdb3ba..fd0d2dcfebd 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp @@ -74,43 +74,44 @@ static int ViewMapGradientNormBP1D___init__(BPy_ViewMapGradientNormBP1D *self, /*-----------------------BPy_ViewMapGradientNormBP1D type definition ----------------------------*/ PyTypeObject ViewMapGradientNormBP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ViewMapGradientNormBP1D", /* tp_name */ - sizeof(BPy_ViewMapGradientNormBP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ViewMapGradientNormBP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &BinaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ViewMapGradientNormBP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ViewMapGradientNormBP1D", + /*tp_basicsize*/ sizeof(BPy_ViewMapGradientNormBP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ViewMapGradientNormBP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &BinaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ViewMapGradientNormBP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp index a4067be3dc1..655f9cdce1e 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp @@ -221,44 +221,45 @@ static PyGetSetDef BPy_CurvePoint_getseters[] = { }; /*-----------------------BPy_CurvePoint type definition ------------------------------*/ + PyTypeObject CurvePoint_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "CurvePoint", /* tp_name */ - sizeof(BPy_CurvePoint), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - CurvePoint_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_CurvePoint_getseters, /* tp_getset */ - &Interface0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)CurvePoint_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "CurvePoint", + /*tp_basicsize*/ sizeof(BPy_CurvePoint), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ CurvePoint_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_CurvePoint_getseters, + /*tp_base*/ &Interface0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)CurvePoint_init, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index 55faebc509c..9d3089e2bc2 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -440,44 +440,45 @@ static PyGetSetDef BPy_SVertex_getseters[] = { }; /*-----------------------BPy_SVertex type definition ------------------------------*/ + PyTypeObject SVertex_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SVertex", /* tp_name */ - sizeof(BPy_SVertex), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SVertex_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_SVertex_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_SVertex_getseters, /* tp_getset */ - &Interface0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SVertex_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "SVertex", + /*tp_basicsize*/ sizeof(BPy_SVertex), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SVertex_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_SVertex_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_SVertex_getseters, + /*tp_base*/ &Interface0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SVertex_init, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp index 7b9e7bd213a..07b399de1dc 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_ViewVertex.cpp @@ -147,44 +147,45 @@ static PyGetSetDef BPy_ViewVertex_getseters[] = { }; /*-----------------------BPy_ViewVertex type definition ------------------------------*/ + PyTypeObject ViewVertex_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ViewVertex", /* tp_name */ - sizeof(BPy_ViewVertex), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ViewVertex_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_ViewVertex_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_ViewVertex_getseters, /* tp_getset */ - &Interface0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ViewVertex_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "ViewVertex", + /*tp_basicsize*/ sizeof(BPy_ViewVertex), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ViewVertex_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_ViewVertex_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_ViewVertex_getseters, + /*tp_base*/ &Interface0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ViewVertex_init, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp index 35eb95c6f23..f6edde778d4 100644 --- a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp @@ -341,44 +341,45 @@ static PyGetSetDef BPy_StrokeVertex_getseters[] = { }; /*-----------------------BPy_StrokeVertex type definition ------------------------------*/ + PyTypeObject StrokeVertex_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "StrokeVertex", /* tp_name */ - sizeof(BPy_StrokeVertex), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - StrokeVertex_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_StrokeVertex_getseters, /* tp_getset */ - &CurvePoint_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)StrokeVertex_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "StrokeVertex", + /*tp_basicsize*/ sizeof(BPy_StrokeVertex), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ StrokeVertex_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_StrokeVertex_getseters, + /*tp_base*/ &CurvePoint_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)StrokeVertex_init, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp index 59fead5f70c..5e597f5294b 100644 --- a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp @@ -92,44 +92,45 @@ static PyGetSetDef BPy_NonTVertex_getseters[] = { }; /*-----------------------BPy_NonTVertex type definition ------------------------------*/ + PyTypeObject NonTVertex_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "NonTVertex", /* tp_name */ - sizeof(BPy_NonTVertex), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - NonTVertex_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_NonTVertex_getseters, /* tp_getset */ - &ViewVertex_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)NonTVertex_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "NonTVertex", + /*tp_basicsize*/ sizeof(BPy_NonTVertex), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NonTVertex_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_NonTVertex_getseters, + /*tp_base*/ &ViewVertex_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)NonTVertex_init, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp index ca4908cae7b..737f1548826 100644 --- a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_TVertex.cpp @@ -202,44 +202,45 @@ static PyGetSetDef BPy_TVertex_getseters[] = { }; /*-----------------------BPy_TVertex type definition ------------------------------*/ + PyTypeObject TVertex_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "TVertex", /* tp_name */ - sizeof(BPy_TVertex), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TVertex_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_TVertex_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_TVertex_getseters, /* tp_getset */ - &ViewVertex_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TVertex_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "TVertex", + /*tp_basicsize*/ sizeof(BPy_TVertex), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ TVertex_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_TVertex_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_TVertex_getseters, + /*tp_base*/ &ViewVertex_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)TVertex_init, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp index bf527673f36..9684f96d586 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp @@ -106,16 +106,16 @@ static PyObject *FEdge_sq_item(BPy_FEdge *self, Py_ssize_t keynum) } static PySequenceMethods BPy_FEdge_as_sequence = { - (lenfunc)FEdge_sq_length, /* sq_length */ - nullptr, /* sq_concat */ - nullptr, /* sq_repeat */ - (ssizeargfunc)FEdge_sq_item, /* sq_item */ - nullptr, /* sq_slice */ - nullptr, /* sq_ass_item */ - nullptr, /* *was* sq_ass_slice */ - nullptr, /* sq_contains */ - nullptr, /* sq_inplace_concat */ - nullptr, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)FEdge_sq_length, + /*sq_concat*/ nullptr, + /*sq_repeat*/ nullptr, + /*sq_item*/ (ssizeargfunc)FEdge_sq_item, + /*was_sq_slice*/ nullptr, /* DEPRECATED. */ + /*sq_ass_item*/ nullptr, + /*was_sq_ass_slice*/ nullptr, /* DEPRECATED. */ + /*sq_contains*/ nullptr, + /*sq_inplace_concat*/ nullptr, + /*sq_inplace_repeat*/ nullptr, }; /*----------------------FEdge get/setters ----------------------------*/ @@ -342,43 +342,44 @@ static PyGetSetDef BPy_FEdge_getseters[] = { /*-----------------------BPy_FEdge type definition ------------------------------*/ PyTypeObject FEdge_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "FEdge", /* tp_name */ - sizeof(BPy_FEdge), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - &BPy_FEdge_as_sequence, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FEdge_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_FEdge_getseters, /* tp_getset */ - &Interface1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FEdge_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "FEdge", + /*tp_basicsize*/ sizeof(BPy_FEdge), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ &BPy_FEdge_as_sequence, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FEdge_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_FEdge_getseters, + /*tp_base*/ &Interface1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FEdge_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp index 1e69ae65605..cc6e6cb7d53 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp @@ -174,43 +174,44 @@ static PyGetSetDef BPy_FrsCurve_getseters[] = { /*-----------------------BPy_FrsCurve type definition ------------------------------*/ PyTypeObject FrsCurve_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Curve", /* tp_name */ - sizeof(BPy_FrsCurve), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FrsCurve_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_FrsCurve_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_FrsCurve_getseters, /* tp_getset */ - &Interface1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FrsCurve_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Curve", + /*tp_basicsize*/ sizeof(BPy_FrsCurve), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FrsCurve_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_FrsCurve_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_FrsCurve_getseters, + /*tp_base*/ &Interface1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FrsCurve_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp index 3e7d4fd9e1c..8acbfefa995 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp @@ -474,56 +474,57 @@ static PyGetSetDef BPy_Stroke_getseters[] = { /*-----------------------BPy_Stroke type definition ------------------------------*/ static PySequenceMethods BPy_Stroke_as_sequence = { - (lenfunc)Stroke_sq_length, /* sq_length */ - nullptr, /* sq_concat */ - nullptr, /* sq_repeat */ - (ssizeargfunc)Stroke_sq_item, /* sq_item */ - nullptr, /* sq_slice */ - nullptr, /* sq_ass_item */ - nullptr, /* *was* sq_ass_slice */ - nullptr, /* sq_contains */ - nullptr, /* sq_inplace_concat */ - nullptr, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)Stroke_sq_length, + /*sq_concat*/ nullptr, + /*sq_repeat*/ nullptr, + /*sq_item*/ (ssizeargfunc)Stroke_sq_item, + /*was_sq_slice*/ nullptr, /* DEPRECATED. */ + /*sq_ass_item*/ nullptr, + /*was_sq_ass_slice*/ nullptr, /* DEPRECATED. */ + /*sq_contains*/ nullptr, + /*sq_inplace_concat*/ nullptr, + /*sq_inplace_repeat*/ nullptr, }; PyTypeObject Stroke_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Stroke", /* tp_name */ - sizeof(BPy_Stroke), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - &BPy_Stroke_as_sequence, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Stroke_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)Stroke_iter, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_Stroke_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_Stroke_getseters, /* tp_getset */ - &Interface1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Stroke_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Stroke", + /*tp_basicsize*/ sizeof(BPy_Stroke), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ &BPy_Stroke_as_sequence, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Stroke_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)Stroke_iter, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_Stroke_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_Stroke_getseters, + /*tp_base*/ &Interface1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Stroke_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp index 1ad8c503782..f15b3c3050a 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp @@ -368,43 +368,44 @@ static PyGetSetDef BPy_ViewEdge_getseters[] = { /*-----------------------BPy_ViewEdge type definition ------------------------------*/ PyTypeObject ViewEdge_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ViewEdge", /* tp_name */ - sizeof(BPy_ViewEdge), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ViewEdge_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_ViewEdge_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_ViewEdge_getseters, /* tp_getset */ - &Interface1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ViewEdge_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ViewEdge", + /*tp_basicsize*/ sizeof(BPy_ViewEdge), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ViewEdge_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_ViewEdge_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_ViewEdge_getseters, + /*tp_base*/ &Interface1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ViewEdge_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp index 5f98252844f..e69572687ca 100644 --- a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp @@ -134,43 +134,44 @@ static PyMethodDef BPy_Chain_methods[] = { /*-----------------------BPy_Chain type definition ------------------------------*/ PyTypeObject Chain_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Chain", /* tp_name */ - sizeof(BPy_Chain), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Chain_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_Chain_methods, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &FrsCurve_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Chain_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Chain", + /*tp_basicsize*/ sizeof(BPy_Chain), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Chain_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_Chain_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &FrsCurve_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Chain_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp index aae8d5514c9..bb8c8f42042 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp @@ -390,43 +390,44 @@ static PyGetSetDef BPy_FEdgeSharp_getseters[] = { /*-----------------------BPy_FEdgeSharp type definition ------------------------------*/ PyTypeObject FEdgeSharp_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "FEdgeSharp", /* tp_name */ - sizeof(BPy_FEdgeSharp), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FEdgeSharp_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_FEdgeSharp_getseters, /* tp_getset */ - &FEdge_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FEdgeSharp_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "FEdgeSharp", + /*tp_basicsize*/ sizeof(BPy_FEdgeSharp), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FEdgeSharp_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_FEdgeSharp_getseters, + /*tp_base*/ &FEdge_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FEdgeSharp_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp index 6516ad8af9c..47f0aff8374 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp @@ -239,43 +239,44 @@ static PyGetSetDef BPy_FEdgeSmooth_getseters[] = { /*-----------------------BPy_FEdgeSmooth type definition ------------------------------*/ PyTypeObject FEdgeSmooth_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "FEdgeSmooth", /* tp_name */ - sizeof(BPy_FEdgeSmooth), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FEdgeSmooth_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_FEdgeSmooth_getseters, /* tp_getset */ - &FEdge_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FEdgeSmooth_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "FEdgeSmooth", + /*tp_basicsize*/ sizeof(BPy_FEdgeSmooth), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FEdgeSmooth_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_FEdgeSmooth_getseters, + /*tp_base*/ &FEdge_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FEdgeSmooth_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp index 883eb3b0beb..ba17a92ca0d 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp @@ -169,43 +169,44 @@ static PyGetSetDef BPy_AdjacencyIterator_getseters[] = { /*-----------------------BPy_AdjacencyIterator type definition ------------------------------*/ PyTypeObject AdjacencyIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "AdjacencyIterator", /* tp_name */ - sizeof(BPy_AdjacencyIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - AdjacencyIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)AdjacencyIterator_iter, /* tp_iter */ - (iternextfunc)AdjacencyIterator_iternext, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_AdjacencyIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)AdjacencyIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "AdjacencyIterator", + /*tp_basicsize*/ sizeof(BPy_AdjacencyIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ AdjacencyIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)AdjacencyIterator_iter, + /*tp_iternext*/ (iternextfunc)AdjacencyIterator_iternext, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_AdjacencyIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)AdjacencyIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp index 1960d33ea88..4d35cdabee9 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp @@ -151,43 +151,44 @@ static void ChainPredicateIterator_dealloc(BPy_ChainPredicateIterator *self) /*-----------------------BPy_ChainPredicateIterator type definition ----------------------------*/ PyTypeObject ChainPredicateIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ChainPredicateIterator", /* tp_name */ - sizeof(BPy_ChainPredicateIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)ChainPredicateIterator_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ChainPredicateIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &ChainingIterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ChainPredicateIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ChainPredicateIterator", + /*tp_basicsize*/ sizeof(BPy_ChainPredicateIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)ChainPredicateIterator_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ChainPredicateIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &ChainingIterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ChainPredicateIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp index 784ee87cc06..ea4ab4b5a7b 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp @@ -105,43 +105,44 @@ static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self, /*-----------------------BPy_ChainSilhouetteIterator type definition ----------------------------*/ PyTypeObject ChainSilhouetteIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ChainSilhouetteIterator", /* tp_name */ - sizeof(BPy_ChainSilhouetteIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ChainSilhouetteIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &ChainingIterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ChainSilhouetteIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ChainSilhouetteIterator", + /*tp_basicsize*/ sizeof(BPy_ChainSilhouetteIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ChainSilhouetteIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &ChainingIterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ChainSilhouetteIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp index c38a8a9314c..3fde8abe1f9 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp @@ -238,43 +238,44 @@ static PyGetSetDef BPy_ChainingIterator_getseters[] = { /*-----------------------BPy_ChainingIterator type definition ------------------------------*/ PyTypeObject ChainingIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ChainingIterator", /* tp_name */ - sizeof(BPy_ChainingIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ChainingIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_ChainingIterator_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_ChainingIterator_getseters, /* tp_getset */ - &ViewEdgeIterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ChainingIterator___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ChainingIterator", + /*tp_basicsize*/ sizeof(BPy_ChainingIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ChainingIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_ChainingIterator_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_ChainingIterator_getseters, + /*tp_base*/ &ViewEdgeIterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ChainingIterator___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp index c5b7d0f96da..180a3e00a9b 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp @@ -119,43 +119,44 @@ static PyGetSetDef BPy_CurvePointIterator_getseters[] = { /*-----------------------BPy_CurvePointIterator type definition ------------------------------*/ PyTypeObject CurvePointIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "CurvePointIterator", /* tp_name */ - sizeof(BPy_CurvePointIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - CurvePointIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_CurvePointIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)CurvePointIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "CurvePointIterator", + /*tp_basicsize*/ sizeof(BPy_CurvePointIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ CurvePointIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_CurvePointIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)CurvePointIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp index 6e4b1832c72..9d12de9efb7 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp @@ -192,43 +192,44 @@ static PyGetSetDef BPy_Interface0DIterator_getseters[] = { /*-----------------------BPy_Interface0DIterator type definition ------------------------------*/ PyTypeObject Interface0DIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Interface0DIterator", /* tp_name */ - sizeof(BPy_Interface0DIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Interface0DIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)Interface0DIterator_iter, /* tp_iter */ - (iternextfunc)Interface0DIterator_iternext, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_Interface0DIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Interface0DIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Interface0DIterator", + /*tp_basicsize*/ sizeof(BPy_Interface0DIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Interface0DIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)Interface0DIterator_iter, + /*tp_iternext*/ (iternextfunc)Interface0DIterator_iternext, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_Interface0DIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Interface0DIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp index 09b40dc01e3..78b8cd07fb4 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp @@ -146,43 +146,44 @@ static PyGetSetDef BPy_SVertexIterator_getseters[] = { /*-----------------------BPy_SVertexIterator type definition ------------------------------*/ PyTypeObject SVertexIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SVertexIterator", /* tp_name */ - sizeof(BPy_SVertexIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SVertexIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_SVertexIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SVertexIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "SVertexIterator", + /*tp_basicsize*/ sizeof(BPy_SVertexIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SVertexIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_SVertexIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SVertexIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp index 4cfaa51d794..abbaae19b9e 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp @@ -277,43 +277,44 @@ static PyGetSetDef BPy_StrokeVertexIterator_getseters[] = { /*-----------------------BPy_StrokeVertexIterator type definition ------------------------------*/ PyTypeObject StrokeVertexIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "StrokeVertexIterator", /* tp_name */ - sizeof(BPy_StrokeVertexIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - StrokeVertexIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)StrokeVertexIterator_iter, /* tp_iter */ - (iternextfunc)StrokeVertexIterator_iternext, /* tp_iternext */ - BPy_StrokeVertexIterator_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_StrokeVertexIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)StrokeVertexIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "StrokeVertexIterator", + /*tp_basicsize*/ sizeof(BPy_StrokeVertexIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ StrokeVertexIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)StrokeVertexIterator_iter, + /*tp_iternext*/ (iternextfunc)StrokeVertexIterator_iternext, + /*tp_methods*/ BPy_StrokeVertexIterator_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_StrokeVertexIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)StrokeVertexIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp index 937a7103c66..7d1691d577f 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp @@ -222,43 +222,44 @@ static PyGetSetDef BPy_ViewEdgeIterator_getseters[] = { /*-----------------------BPy_ViewEdgeIterator type definition ------------------------------*/ PyTypeObject ViewEdgeIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ViewEdgeIterator", /* tp_name */ - sizeof(BPy_ViewEdgeIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ViewEdgeIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - BPy_ViewEdgeIterator_methods, /* tp_methods */ - nullptr, /* tp_members */ - BPy_ViewEdgeIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ViewEdgeIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ViewEdgeIterator", + /*tp_basicsize*/ sizeof(BPy_ViewEdgeIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ViewEdgeIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ BPy_ViewEdgeIterator_methods, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_ViewEdgeIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ViewEdgeIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp index f503494b898..7dad62818f4 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp @@ -128,43 +128,44 @@ static PyGetSetDef BPy_orientedViewEdgeIterator_getseters[] = { /*-----------------------BPy_orientedViewEdgeIterator type definition ---------------------------*/ PyTypeObject orientedViewEdgeIterator_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "orientedViewEdgeIterator", /* tp_name */ - sizeof(BPy_orientedViewEdgeIterator), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - orientedViewEdgeIterator_doc, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - (getiterfunc)orientedViewEdgeIterator_iter, /* tp_iter */ - (iternextfunc)orientedViewEdgeIterator_iternext, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_orientedViewEdgeIterator_getseters, /* tp_getset */ - &Iterator_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)orientedViewEdgeIterator_init, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "orientedViewEdgeIterator", + /*tp_basicsize*/ sizeof(BPy_orientedViewEdgeIterator), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ orientedViewEdgeIterator_doc, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)orientedViewEdgeIterator_iter, + /*tp_iternext*/ (iternextfunc)orientedViewEdgeIterator_iternext, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_orientedViewEdgeIterator_getseters, + /*tp_base*/ &Iterator_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)orientedViewEdgeIterator_init, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp index ce8c62374a6..d54e305c963 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp @@ -55,43 +55,44 @@ static int BackboneStretcherShader___init__(BPy_BackboneStretcherShader *self, /*-----------------------BPy_BackboneStretcherShader type definition ----------------------------*/ PyTypeObject BackboneStretcherShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "BackboneStretcherShader", /* tp_name */ - sizeof(BPy_BackboneStretcherShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BackboneStretcherShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BackboneStretcherShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "BackboneStretcherShader", + /*tp_basicsize*/ sizeof(BPy_BackboneStretcherShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ BackboneStretcherShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)BackboneStretcherShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp index 3970fdbe511..23de68b3cf4 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp @@ -55,43 +55,44 @@ static int BezierCurveShader___init__(BPy_BezierCurveShader *self, PyObject *arg /*-----------------------BPy_BezierCurveShader type definition ------------------------------*/ PyTypeObject BezierCurveShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "BezierCurveShader", /* tp_name */ - sizeof(BPy_BezierCurveShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BezierCurveShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BezierCurveShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "BezierCurveShader", + /*tp_basicsize*/ sizeof(BPy_BezierCurveShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ BezierCurveShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)BezierCurveShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp index b1d413bb426..c0dfebfaf37 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp @@ -75,43 +75,44 @@ static int BlenderTextureShader___init__(BPy_BlenderTextureShader *self, /*-----------------------BPy_BlenderTextureShader type definition ------------------------------*/ PyTypeObject BlenderTextureShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "BlenderTextureShader", /* tp_name */ - sizeof(BPy_BlenderTextureShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BlenderTextureShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BlenderTextureShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "BlenderTextureShader", + /*tp_basicsize*/ sizeof(BPy_BlenderTextureShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ BlenderTextureShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)BlenderTextureShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp index b357baa394c..99e344ee24b 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp @@ -73,43 +73,44 @@ static int CalligraphicShader___init__(BPy_CalligraphicShader *self, /*-----------------------BPy_CalligraphicShader type definition ------------------------------*/ PyTypeObject CalligraphicShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "CalligraphicShader", /* tp_name */ - sizeof(BPy_CalligraphicShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - CalligraphicShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)CalligraphicShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "CalligraphicShader", + /*tp_basicsize*/ sizeof(BPy_CalligraphicShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ CalligraphicShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)CalligraphicShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp index 01ed7bc5cf8..c6e0da91d22 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp @@ -54,43 +54,44 @@ static int ColorNoiseShader___init__(BPy_ColorNoiseShader *self, PyObject *args, /*-----------------------BPy_ColorNoiseShader type definition ------------------------------*/ PyTypeObject ColorNoiseShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ColorNoiseShader", /* tp_name */ - sizeof(BPy_ColorNoiseShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ColorNoiseShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ColorNoiseShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ColorNoiseShader", + /*tp_basicsize*/ sizeof(BPy_ColorNoiseShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ColorNoiseShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ColorNoiseShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp index e7eff87fb2b..d8cdadfd539 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp @@ -60,43 +60,44 @@ static int ConstantColorShader___init__(BPy_ConstantColorShader *self, /*-----------------------BPy_ConstantColorShader type definition ------------------------------*/ PyTypeObject ConstantColorShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ConstantColorShader", /* tp_name */ - sizeof(BPy_ConstantColorShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ConstantColorShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ConstantColorShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ConstantColorShader", + /*tp_basicsize*/ sizeof(BPy_ConstantColorShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ConstantColorShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ConstantColorShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp index e05658e500f..c03a8fe11fe 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp @@ -54,43 +54,44 @@ static int ConstantThicknessShader___init__(BPy_ConstantThicknessShader *self, /*-----------------------BPy_ConstantThicknessShader type definition ----------------------------*/ PyTypeObject ConstantThicknessShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ConstantThicknessShader", /* tp_name */ - sizeof(BPy_ConstantThicknessShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ConstantThicknessShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ConstantThicknessShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ConstantThicknessShader", + /*tp_basicsize*/ sizeof(BPy_ConstantThicknessShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ConstantThicknessShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ConstantThicknessShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp index 88ce8099669..bf86e283161 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp @@ -60,43 +60,44 @@ static int ConstrainedIncreasingThicknessShader___init__( /*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ---------------*/ PyTypeObject ConstrainedIncreasingThicknessShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ConstrainedIncreasingThicknessShader", /* tp_name */ - sizeof(BPy_ConstrainedIncreasingThicknessShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ConstrainedIncreasingThicknessShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ConstrainedIncreasingThicknessShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ConstrainedIncreasingThicknessShader", + /*tp_basicsize*/ sizeof(BPy_ConstrainedIncreasingThicknessShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ConstrainedIncreasingThicknessShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ConstrainedIncreasingThicknessShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp index 08c5e70d11a..25bfa182043 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp @@ -62,43 +62,44 @@ static int GuidingLinesShader___init__(BPy_GuidingLinesShader *self, /*-----------------------BPy_GuidingLinesShader type definition ------------------------------*/ PyTypeObject GuidingLinesShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GuidingLinesShader", /* tp_name */ - sizeof(BPy_GuidingLinesShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GuidingLinesShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GuidingLinesShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GuidingLinesShader", + /*tp_basicsize*/ sizeof(BPy_GuidingLinesShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GuidingLinesShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GuidingLinesShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp index 33f2eb41548..d8f8ae84543 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp @@ -82,43 +82,44 @@ static int IncreasingColorShader___init__(BPy_IncreasingColorShader *self, /*-----------------------BPy_IncreasingColorShader type definition ------------------------------*/ PyTypeObject IncreasingColorShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "IncreasingColorShader", /* tp_name */ - sizeof(BPy_IncreasingColorShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - IncreasingColorShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)IncreasingColorShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "IncreasingColorShader", + /*tp_basicsize*/ sizeof(BPy_IncreasingColorShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ IncreasingColorShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)IncreasingColorShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp index 9e489f24c88..7bc1f73d9e8 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp @@ -60,43 +60,44 @@ static int IncreasingThicknessShader___init__(BPy_IncreasingThicknessShader *sel /*-----------------------BPy_IncreasingThicknessShader type definition --------------------------*/ PyTypeObject IncreasingThicknessShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "IncreasingThicknessShader", /* tp_name */ - sizeof(BPy_IncreasingThicknessShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - IncreasingThicknessShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)IncreasingThicknessShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "IncreasingThicknessShader", + /*tp_basicsize*/ sizeof(BPy_IncreasingThicknessShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ IncreasingThicknessShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)IncreasingThicknessShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp index 25021696694..9afdf786e5c 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp @@ -61,43 +61,44 @@ static int PolygonalizationShader___init__(BPy_PolygonalizationShader *self, /*-----------------------BPy_PolygonalizationShader type definition -----------------------------*/ PyTypeObject PolygonalizationShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "PolygonalizationShader", /* tp_name */ - sizeof(BPy_PolygonalizationShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - PolygonalizationShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)PolygonalizationShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "PolygonalizationShader", + /*tp_basicsize*/ sizeof(BPy_PolygonalizationShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ PolygonalizationShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)PolygonalizationShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp index 9bf322cd1f8..6ee3f0130b8 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp @@ -52,43 +52,44 @@ static int SamplingShader___init__(BPy_SamplingShader *self, PyObject *args, PyO /*-----------------------BPy_SamplingShader type definition ------------------------------*/ PyTypeObject SamplingShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SamplingShader", /* tp_name */ - sizeof(BPy_SamplingShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SamplingShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SamplingShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "SamplingShader", + /*tp_basicsize*/ sizeof(BPy_SamplingShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SamplingShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SamplingShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp index 1a3cba74f18..b07a1f26a3e 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp @@ -84,43 +84,44 @@ static int SmoothingShader___init__(BPy_SmoothingShader *self, PyObject *args, P /*-----------------------BPy_SmoothingShader type definition ------------------------------*/ PyTypeObject SmoothingShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SmoothingShader", /* tp_name */ - sizeof(BPy_SmoothingShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SmoothingShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SmoothingShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "SmoothingShader", + /*tp_basicsize*/ sizeof(BPy_SmoothingShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SmoothingShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SmoothingShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp index 26f0dcadf86..04ea15d7b47 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp @@ -78,43 +78,44 @@ static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader *self, /*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/ PyTypeObject SpatialNoiseShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "SpatialNoiseShader", /* tp_name */ - sizeof(BPy_SpatialNoiseShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SpatialNoiseShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SpatialNoiseShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "SpatialNoiseShader", + /*tp_basicsize*/ sizeof(BPy_SpatialNoiseShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ SpatialNoiseShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)SpatialNoiseShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp index a79bee0b120..ec6e7e69b49 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp @@ -54,43 +54,44 @@ static int StrokeTextureStepShader___init__(BPy_StrokeTextureStepShader *self, /*-----------------------BPy_StrokeTextureStepShader type definition ----------------------------*/ PyTypeObject StrokeTextureStepShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "StrokeTextureStepShader", /* tp_name */ - sizeof(BPy_StrokeTextureStepShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - StrokeTextureStepShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)StrokeTextureStepShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "StrokeTextureStepShader", + /*tp_basicsize*/ sizeof(BPy_StrokeTextureStepShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ StrokeTextureStepShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)StrokeTextureStepShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp index 24bcbff1990..08731659cc4 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp @@ -56,43 +56,44 @@ static int ThicknessNoiseShader___init__(BPy_ThicknessNoiseShader *self, /*-----------------------BPy_ThicknessNoiseShader type definition ------------------------------*/ PyTypeObject ThicknessNoiseShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ThicknessNoiseShader", /* tp_name */ - sizeof(BPy_ThicknessNoiseShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ThicknessNoiseShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ThicknessNoiseShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ThicknessNoiseShader", + /*tp_basicsize*/ sizeof(BPy_ThicknessNoiseShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ThicknessNoiseShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ThicknessNoiseShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp index e36c99713e8..81f1aca792d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp @@ -53,43 +53,44 @@ static int TipRemoverShader___init__(BPy_TipRemoverShader *self, PyObject *args, /*-----------------------BPy_TipRemoverShader type definition ------------------------------*/ PyTypeObject TipRemoverShader_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "TipRemoverShader", /* tp_name */ - sizeof(BPy_TipRemoverShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TipRemoverShader___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TipRemoverShader___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "TipRemoverShader", + /*tp_basicsize*/ sizeof(BPy_TipRemoverShader), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ TipRemoverShader___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &StrokeShader_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)TipRemoverShader___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp index da4fdfe5095..a8be9722cff 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp @@ -171,43 +171,44 @@ static PyObject *UnaryFunction0DDouble___call__(BPy_UnaryFunction0DDouble *self, /*-----------------------BPy_UnaryFunction0DDouble type definition ------------------------------*/ PyTypeObject UnaryFunction0DDouble_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DDouble", /* tp_name */ - sizeof(BPy_UnaryFunction0DDouble), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DDouble___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DDouble___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DDouble___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DDouble___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DDouble___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DDouble", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DDouble), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DDouble___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DDouble___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DDouble___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DDouble___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DDouble___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp index d6c095c9f0a..b1a1cf816d4 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp @@ -110,43 +110,44 @@ static PyObject *UnaryFunction0DEdgeNature___call__(BPy_UnaryFunction0DEdgeNatur /*-----------------------BPy_UnaryFunction0DEdgeNature type definition --------------------------*/ PyTypeObject UnaryFunction0DEdgeNature_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DEdgeNature", /* tp_name */ - sizeof(BPy_UnaryFunction0DEdgeNature), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DEdgeNature___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DEdgeNature___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DEdgeNature___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DEdgeNature___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DEdgeNature___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DEdgeNature", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DEdgeNature), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DEdgeNature___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DEdgeNature___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DEdgeNature___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DEdgeNature___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DEdgeNature___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp index 20511cb0d4b..588959667c5 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp @@ -147,43 +147,44 @@ static PyObject *UnaryFunction0DFloat___call__(BPy_UnaryFunction0DFloat *self, /*-----------------------BPy_UnaryFunction0DFloat type definition ------------------------------*/ PyTypeObject UnaryFunction0DFloat_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DFloat", /* tp_name */ - sizeof(BPy_UnaryFunction0DFloat), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DFloat___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DFloat___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DFloat___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DFloat___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DFloat___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DFloat", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DFloat), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DFloat___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DFloat___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DFloat___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DFloat___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DFloat___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp index 61a7693d605..f0a62995c6d 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp @@ -106,43 +106,44 @@ static PyObject *UnaryFunction0DId___call__(BPy_UnaryFunction0DId *self, /*-----------------------BPy_UnaryFunction0DId type definition ------------------------------*/ PyTypeObject UnaryFunction0DId_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DId", /* tp_name */ - sizeof(BPy_UnaryFunction0DId), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DId___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DId___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DId___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DId___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DId___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DId", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DId), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DId___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DId___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DId___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DId___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DId___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp index 224f1ad7229..0c8294ff8dc 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp @@ -109,43 +109,44 @@ static PyObject *UnaryFunction0DMaterial___call__(BPy_UnaryFunction0DMaterial *s /*-----------------------BPy_UnaryFunction0DMaterial type definition ----------------------------*/ PyTypeObject UnaryFunction0DMaterial_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DMaterial", /* tp_name */ - sizeof(BPy_UnaryFunction0DMaterial), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DMaterial___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DMaterial___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DMaterial___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DMaterial___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DMaterial___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DMaterial", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DMaterial), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DMaterial___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DMaterial___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DMaterial___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DMaterial___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DMaterial___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp index 8faefd085d6..c6e7fed4424 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp @@ -112,43 +112,44 @@ static PyObject *UnaryFunction0DUnsigned___call__(BPy_UnaryFunction0DUnsigned *s /*-----------------------BPy_UnaryFunction0DUnsigned type definition ----------------------------*/ PyTypeObject UnaryFunction0DUnsigned_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DUnsigned", /* tp_name */ - sizeof(BPy_UnaryFunction0DUnsigned), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DUnsigned___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DUnsigned___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DUnsigned___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DUnsigned___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DUnsigned___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DUnsigned", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DUnsigned), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DUnsigned___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DUnsigned___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DUnsigned___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DUnsigned___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DUnsigned___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp index c13dbc85eee..fda4536b252 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp @@ -115,43 +115,44 @@ static PyObject *UnaryFunction0DVec2f___call__(BPy_UnaryFunction0DVec2f *self, /*-----------------------BPy_UnaryFunction0DVec2f type definition ------------------------------*/ PyTypeObject UnaryFunction0DVec2f_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DVec2f", /* tp_name */ - sizeof(BPy_UnaryFunction0DVec2f), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DVec2f___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DVec2f___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DVec2f___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DVec2f___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DVec2f___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DVec2f", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DVec2f), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DVec2f___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DVec2f___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DVec2f___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DVec2f___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DVec2f___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp index d373ae7fe03..5409bd94789 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp @@ -108,43 +108,44 @@ static PyObject *UnaryFunction0DVec3f___call__(BPy_UnaryFunction0DVec3f *self, /*-----------------------BPy_UnaryFunction0DVec3f type definition ------------------------------*/ PyTypeObject UnaryFunction0DVec3f_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DVec3f", /* tp_name */ - sizeof(BPy_UnaryFunction0DVec3f), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DVec3f___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DVec3f___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DVec3f___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DVec3f___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DVec3f___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DVec3f", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DVec3f), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DVec3f___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DVec3f___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DVec3f___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DVec3f___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DVec3f___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp index 7f5b98da223..73049f8e0c2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp @@ -121,43 +121,44 @@ static PyObject *UnaryFunction0DVectorViewShape___call__(BPy_UnaryFunction0DVect /*-----------------------BPy_UnaryFunction0DVectorViewShape type definition ---------------------*/ PyTypeObject UnaryFunction0DVectorViewShape_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DVectorViewShape", /* tp_name */ - sizeof(BPy_UnaryFunction0DVectorViewShape), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DVectorViewShape___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DVectorViewShape___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DVectorViewShape___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DVectorViewShape___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DVectorViewShape___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DVectorViewShape", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DVectorViewShape), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DVectorViewShape___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DVectorViewShape___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DVectorViewShape___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DVectorViewShape___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DVectorViewShape___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp index 06a08cc02f5..319087b5092 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp @@ -117,43 +117,44 @@ static PyObject *UnaryFunction0DViewShape___call__(BPy_UnaryFunction0DViewShape /*-----------------------BPy_UnaryFunction0DViewShape type definition ---------------------------*/ PyTypeObject UnaryFunction0DViewShape_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction0DViewShape", /* tp_name */ - sizeof(BPy_UnaryFunction0DViewShape), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction0DViewShape___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction0DViewShape___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction0DViewShape___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction0DViewShape___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction0DViewShape___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction0DViewShape", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction0DViewShape), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction0DViewShape___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction0DViewShape___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction0DViewShape___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction0DViewShape___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction0DViewShape___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.cpp index deea7008002..55a02890066 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Id/BPy_ShapeIdF0D.cpp @@ -58,43 +58,44 @@ static int ShapeIdF0D___init__(BPy_ShapeIdF0D *self, PyObject *args, PyObject *k /*-----------------------BPy_ShapeIdF0D type definition ------------------------------*/ PyTypeObject ShapeIdF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ShapeIdF0D", /* tp_name */ - sizeof(BPy_ShapeIdF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ShapeIdF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DId_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ShapeIdF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ShapeIdF0D", + /*tp_basicsize*/ sizeof(BPy_ShapeIdF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ShapeIdF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DId_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ShapeIdF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.cpp index 49273ddf132..5abd54a48ad 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Material/BPy_MaterialF0D.cpp @@ -61,43 +61,44 @@ static int MaterialF0D___init__(BPy_MaterialF0D *self, PyObject *args, PyObject /*-----------------------BPy_MaterialF0D type definition ------------------------------*/ PyTypeObject MaterialF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "MaterialF0D", /* tp_name */ - sizeof(BPy_MaterialF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - MaterialF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DMaterial_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)MaterialF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "MaterialF0D", + /*tp_basicsize*/ sizeof(BPy_MaterialF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ MaterialF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DMaterial_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)MaterialF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.cpp index 66a93f961e7..750e5253793 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Nature_EdgeNature/BPy_CurveNatureF0D.cpp @@ -52,43 +52,44 @@ static int CurveNatureF0D___init__(BPy_CurveNatureF0D *self, PyObject *args, PyO /*-----------------------BPy_CurveNatureF0D type definition ------------------------------*/ PyTypeObject CurveNatureF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "CurveNatureF0D", /* tp_name */ - sizeof(BPy_CurveNatureF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - CurveNatureF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DEdgeNature_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)CurveNatureF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "CurveNatureF0D", + /*tp_basicsize*/ sizeof(BPy_CurveNatureF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ CurveNatureF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DEdgeNature_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)CurveNatureF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.cpp index 0b5c818de9d..ba4f1e9bc37 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_Normal2DF0D.cpp @@ -54,43 +54,44 @@ static int Normal2DF0D___init__(BPy_Normal2DF0D *self, PyObject *args, PyObject /*-----------------------BPy_Normal2DF0D type definition ------------------------------*/ PyTypeObject Normal2DF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Normal2DF0D", /* tp_name */ - sizeof(BPy_Normal2DF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Normal2DF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DVec2f_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Normal2DF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Normal2DF0D", + /*tp_basicsize*/ sizeof(BPy_Normal2DF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Normal2DF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DVec2f_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Normal2DF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.cpp index 7792cbb2495..9d6d1e31da3 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec2f/BPy_VertexOrientation2DF0D.cpp @@ -56,43 +56,44 @@ static int VertexOrientation2DF0D___init__(BPy_VertexOrientation2DF0D *self, /*-----------------------BPy_VertexOrientation2DF0D type definition -----------------------------*/ PyTypeObject VertexOrientation2DF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "VertexOrientation2DF0D", /* tp_name */ - sizeof(BPy_VertexOrientation2DF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - VertexOrientation2DF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DVec2f_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)VertexOrientation2DF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "VertexOrientation2DF0D", + /*tp_basicsize*/ sizeof(BPy_VertexOrientation2DF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ VertexOrientation2DF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DVec2f_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)VertexOrientation2DF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.cpp index 9a0aa3ae4a8..95cf14eafdf 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_Vec3f/BPy_VertexOrientation3DF0D.cpp @@ -56,43 +56,44 @@ static int VertexOrientation3DF0D___init__(BPy_VertexOrientation3DF0D *self, /*-----------------------BPy_VertexOrientation3DF0D type definition -----------------------------*/ PyTypeObject VertexOrientation3DF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "VertexOrientation3DF0D", /* tp_name */ - sizeof(BPy_VertexOrientation3DF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - VertexOrientation3DF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DVec3f_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)VertexOrientation3DF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "VertexOrientation3DF0D", + /*tp_basicsize*/ sizeof(BPy_VertexOrientation3DF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ VertexOrientation3DF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DVec3f_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)VertexOrientation3DF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.cpp index 7a7e13dbb90..92644c21bde 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetOccludeeF0D.cpp @@ -51,43 +51,44 @@ static int GetOccludeeF0D___init__(BPy_GetOccludeeF0D *self, PyObject *args, PyO /*-----------------------BPy_GetOccludeeF0D type definition ------------------------------*/ PyTypeObject GetOccludeeF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetOccludeeF0D", /* tp_name */ - sizeof(BPy_GetOccludeeF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetOccludeeF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DViewShape_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetOccludeeF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetOccludeeF0D", + /*tp_basicsize*/ sizeof(BPy_GetOccludeeF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetOccludeeF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DViewShape_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetOccludeeF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.cpp index 6b9c2355c6c..38cc90f366a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_ViewShape/BPy_GetShapeF0D.cpp @@ -51,43 +51,44 @@ static int GetShapeF0D___init__(BPy_GetShapeF0D *self, PyObject *args, PyObject /*-----------------------BPy_GetShapeF0D type definition ------------------------------*/ PyTypeObject GetShapeF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetShapeF0D", /* tp_name */ - sizeof(BPy_GetShapeF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetShapeF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DViewShape_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetShapeF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetShapeF0D", + /*tp_basicsize*/ sizeof(BPy_GetShapeF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetShapeF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DViewShape_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetShapeF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.cpp index a596e13c465..884d7da3f77 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_Curvature2DAngleF0D.cpp @@ -56,43 +56,44 @@ static int Curvature2DAngleF0D___init__(BPy_Curvature2DAngleF0D *self, /*-----------------------BPy_Curvature2DAngleF0D type definition ------------------------------*/ PyTypeObject Curvature2DAngleF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Curvature2DAngleF0D", /* tp_name */ - sizeof(BPy_Curvature2DAngleF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Curvature2DAngleF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Curvature2DAngleF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Curvature2DAngleF0D", + /*tp_basicsize*/ sizeof(BPy_Curvature2DAngleF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Curvature2DAngleF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Curvature2DAngleF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.cpp index 25385d05b7b..3668c81c454 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_DensityF0D.cpp @@ -61,43 +61,44 @@ static int DensityF0D___init__(BPy_DensityF0D *self, PyObject *args, PyObject *k /*-----------------------BPy_DensityF0D type definition ------------------------------*/ PyTypeObject DensityF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "DensityF0D", /* tp_name */ - sizeof(BPy_DensityF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - DensityF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)DensityF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "DensityF0D", + /*tp_basicsize*/ sizeof(BPy_DensityF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ DensityF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)DensityF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.cpp index c3be379e32d..2c3b78ffbc9 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedXF0D.cpp @@ -51,43 +51,44 @@ static int GetProjectedXF0D___init__(BPy_GetProjectedXF0D *self, PyObject *args, /*-----------------------BPy_GetProjectedXF0D type definition ------------------------------*/ PyTypeObject GetProjectedXF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetProjectedXF0D", /* tp_name */ - sizeof(BPy_GetProjectedXF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetProjectedXF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetProjectedXF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetProjectedXF0D", + /*tp_basicsize*/ sizeof(BPy_GetProjectedXF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetProjectedXF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetProjectedXF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.cpp index b6ce4bc9bcd..47d3ee34fb0 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedYF0D.cpp @@ -51,43 +51,44 @@ static int GetProjectedYF0D___init__(BPy_GetProjectedYF0D *self, PyObject *args, /*-----------------------BPy_GetProjectedYF0D type definition ------------------------------*/ PyTypeObject GetProjectedYF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetProjectedYF0D", /* tp_name */ - sizeof(BPy_GetProjectedYF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetProjectedYF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetProjectedYF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetProjectedYF0D", + /*tp_basicsize*/ sizeof(BPy_GetProjectedYF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetProjectedYF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetProjectedYF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.cpp index 4bba4e23665..8978624eea0 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetProjectedZF0D.cpp @@ -51,43 +51,44 @@ static int GetProjectedZF0D___init__(BPy_GetProjectedZF0D *self, PyObject *args, /*-----------------------BPy_GetProjectedZF0D type definition ------------------------------*/ PyTypeObject GetProjectedZF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetProjectedZF0D", /* tp_name */ - sizeof(BPy_GetProjectedZF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetProjectedZF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetProjectedZF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetProjectedZF0D", + /*tp_basicsize*/ sizeof(BPy_GetProjectedZF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetProjectedZF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetProjectedZF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.cpp index 3ed3cf7f7f3..39bc12a1b2a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetXF0D.cpp @@ -51,43 +51,44 @@ static int GetXF0D___init__(BPy_GetXF0D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_GetXF0D type definition ------------------------------*/ PyTypeObject GetXF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetXF0D", /* tp_name */ - sizeof(BPy_GetXF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetXF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetXF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetXF0D", + /*tp_basicsize*/ sizeof(BPy_GetXF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetXF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetXF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.cpp index fd8238e4726..5c0435cc3a4 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetYF0D.cpp @@ -51,43 +51,44 @@ static int GetYF0D___init__(BPy_GetYF0D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_GetYF0D type definition ------------------------------*/ PyTypeObject GetYF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetYF0D", /* tp_name */ - sizeof(BPy_GetYF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetYF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetYF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetYF0D", + /*tp_basicsize*/ sizeof(BPy_GetYF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetYF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetYF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.cpp index 8c44c9bf7dc..fc569cac044 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_GetZF0D.cpp @@ -51,43 +51,44 @@ static int GetZF0D___init__(BPy_GetZF0D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_GetZF0D type definition ------------------------------*/ PyTypeObject GetZF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetZF0D", /* tp_name */ - sizeof(BPy_GetZF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetZF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetZF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetZF0D", + /*tp_basicsize*/ sizeof(BPy_GetZF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetZF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetZF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.cpp index 0dc9f9b4b21..93f1ee6cd13 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_LocalAverageDepthF0D.cpp @@ -59,43 +59,44 @@ static int LocalAverageDepthF0D___init__(BPy_LocalAverageDepthF0D *self, /*-----------------------BPy_LocalAverageDepthF0D type definition ------------------------------*/ PyTypeObject LocalAverageDepthF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "LocalAverageDepthF0D", /* tp_name */ - sizeof(BPy_LocalAverageDepthF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - LocalAverageDepthF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)LocalAverageDepthF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "LocalAverageDepthF0D", + /*tp_basicsize*/ sizeof(BPy_LocalAverageDepthF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ LocalAverageDepthF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)LocalAverageDepthF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.cpp index 395da54356d..019340204a5 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_double/BPy_ZDiscontinuityF0D.cpp @@ -56,43 +56,44 @@ static int ZDiscontinuityF0D___init__(BPy_ZDiscontinuityF0D *self, PyObject *arg /*-----------------------BPy_ZDiscontinuityF0D type definition ------------------------------*/ PyTypeObject ZDiscontinuityF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ZDiscontinuityF0D", /* tp_name */ - sizeof(BPy_ZDiscontinuityF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ZDiscontinuityF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ZDiscontinuityF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ZDiscontinuityF0D", + /*tp_basicsize*/ sizeof(BPy_ZDiscontinuityF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ZDiscontinuityF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ZDiscontinuityF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.cpp index fffea12e0da..c9ad1b20b47 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetCurvilinearAbscissaF0D.cpp @@ -54,43 +54,44 @@ static int GetCurvilinearAbscissaF0D___init__(BPy_GetCurvilinearAbscissaF0D *sel /*-----------------------BPy_GetCurvilinearAbscissaF0D type definition --------------------------*/ PyTypeObject GetCurvilinearAbscissaF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetCurvilinearAbscissaF0D", /* tp_name */ - sizeof(BPy_GetCurvilinearAbscissaF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetCurvilinearAbscissaF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DFloat_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetCurvilinearAbscissaF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetCurvilinearAbscissaF0D", + /*tp_basicsize*/ sizeof(BPy_GetCurvilinearAbscissaF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetCurvilinearAbscissaF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DFloat_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetCurvilinearAbscissaF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.cpp index 4354d651f27..1420e41d90a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetParameterF0D.cpp @@ -49,44 +49,45 @@ static int GetParameterF0D___init__(BPy_GetParameterF0D *self, PyObject *args, P } /*-----------------------BPy_GetParameterF0D type definition ------------------------------*/ + PyTypeObject GetParameterF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetParameterF0D", /* tp_name */ - sizeof(BPy_GetParameterF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetParameterF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DFloat_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetParameterF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "GetParameterF0D", + /*tp_basicsize*/ sizeof(BPy_GetParameterF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetParameterF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DFloat_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetParameterF0D___init__, + /*tp_alloc*/ nullptr, + nullptr, /*tp_new*/ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.cpp index 671844fb6b3..1fce16fc53a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_GetViewMapGradientNormF0D.cpp @@ -59,43 +59,44 @@ static int GetViewMapGradientNormF0D___init__(BPy_GetViewMapGradientNormF0D *sel /*-----------------------BPy_GetViewMapGradientNormF0D type definition --------------------------*/ PyTypeObject GetViewMapGradientNormF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetViewMapGradientNormF0D", /* tp_name */ - sizeof(BPy_GetViewMapGradientNormF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetViewMapGradientNormF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DFloat_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetViewMapGradientNormF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetViewMapGradientNormF0D", + /*tp_basicsize*/ sizeof(BPy_GetViewMapGradientNormF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetViewMapGradientNormF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DFloat_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetViewMapGradientNormF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.cpp index ed1902cbd8b..b65032d650f 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadCompleteViewMapPixelF0D.cpp @@ -57,43 +57,44 @@ static int ReadCompleteViewMapPixelF0D___init__(BPy_ReadCompleteViewMapPixelF0D /*-----------------------BPy_ReadCompleteViewMapPixelF0D type definition ------------------------*/ PyTypeObject ReadCompleteViewMapPixelF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ReadCompleteViewMapPixelF0D", /* tp_name */ - sizeof(BPy_ReadCompleteViewMapPixelF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ReadCompleteViewMapPixelF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DFloat_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ReadCompleteViewMapPixelF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ReadCompleteViewMapPixelF0D", + /*tp_basicsize*/ sizeof(BPy_ReadCompleteViewMapPixelF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ReadCompleteViewMapPixelF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DFloat_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ReadCompleteViewMapPixelF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.cpp index cd60d99593a..ff934bc4a50 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadMapPixelF0D.cpp @@ -58,43 +58,44 @@ static int ReadMapPixelF0D___init__(BPy_ReadMapPixelF0D *self, PyObject *args, P /*-----------------------BPy_ReadMapPixelF0D type definition ------------------------------*/ PyTypeObject ReadMapPixelF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ReadMapPixelF0D", /* tp_name */ - sizeof(BPy_ReadMapPixelF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ReadMapPixelF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DFloat_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ReadMapPixelF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ReadMapPixelF0D", + /*tp_basicsize*/ sizeof(BPy_ReadMapPixelF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ReadMapPixelF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DFloat_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ReadMapPixelF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.cpp index 82362704119..262dc90a2d7 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_float/BPy_ReadSteerableViewMapPixelF0D.cpp @@ -63,43 +63,44 @@ static int ReadSteerableViewMapPixelF0D___init__(BPy_ReadSteerableViewMapPixelF0 /*-----------------------BPy_ReadSteerableViewMapPixelF0D type definition -----------------------*/ PyTypeObject ReadSteerableViewMapPixelF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ReadSteerableViewMapPixelF0D", /* tp_name */ - sizeof(BPy_ReadSteerableViewMapPixelF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ReadSteerableViewMapPixelF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DFloat_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ReadSteerableViewMapPixelF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ReadSteerableViewMapPixelF0D", + /*tp_basicsize*/ sizeof(BPy_ReadSteerableViewMapPixelF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ReadSteerableViewMapPixelF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DFloat_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ReadSteerableViewMapPixelF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp index 2c4300a8059..658345bed1b 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp @@ -59,43 +59,44 @@ static int QuantitativeInvisibilityF0D___init__(BPy_QuantitativeInvisibilityF0D /*-----------------------BPy_QuantitativeInvisibilityF0D type definition ------------------------*/ PyTypeObject QuantitativeInvisibilityF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "QuantitativeInvisibilityF0D", /* tp_name */ - sizeof(BPy_QuantitativeInvisibilityF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - QuantitativeInvisibilityF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DUnsigned_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)QuantitativeInvisibilityF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "QuantitativeInvisibilityF0D", + /*tp_basicsize*/ sizeof(BPy_QuantitativeInvisibilityF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ QuantitativeInvisibilityF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DUnsigned_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)QuantitativeInvisibilityF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.cpp index 797708daa9b..e91528a42a2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_vector_ViewShape/BPy_GetOccludersF0D.cpp @@ -52,43 +52,44 @@ static int GetOccludersF0D___init__(BPy_GetOccludersF0D *self, PyObject *args, P /*-----------------------BPy_GetOccludersF0D type definition ------------------------------*/ PyTypeObject GetOccludersF0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetOccludersF0D", /* tp_name */ - sizeof(BPy_GetOccludersF0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetOccludersF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DVectorViewShape_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetOccludersF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetOccludersF0D", + /*tp_basicsize*/ sizeof(BPy_GetOccludersF0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetOccludersF0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction0DVectorViewShape_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetOccludersF0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp index 3fe84b3a76f..2adaeee6e9f 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp @@ -252,43 +252,44 @@ static PyGetSetDef BPy_UnaryFunction1DDouble_getseters[] = { /*-----------------------BPy_UnaryFunction1DDouble type definition ------------------------------*/ PyTypeObject UnaryFunction1DDouble_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DDouble", /* tp_name */ - sizeof(BPy_UnaryFunction1DDouble), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DDouble___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DDouble___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DDouble___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DDouble___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DDouble_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DDouble___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DDouble", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DDouble), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DDouble___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DDouble___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DDouble___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DDouble___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DDouble_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DDouble___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp index 33f534e9860..03e6417a316 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp @@ -159,43 +159,44 @@ static PyGetSetDef BPy_UnaryFunction1DEdgeNature_getseters[] = { /*-----------------------BPy_UnaryFunction1DEdgeNature type definition --------------------------*/ PyTypeObject UnaryFunction1DEdgeNature_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DEdgeNature", /* tp_name */ - sizeof(BPy_UnaryFunction1DEdgeNature), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DEdgeNature___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DEdgeNature___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DEdgeNature___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DEdgeNature___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DEdgeNature_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DEdgeNature___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DEdgeNature", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DEdgeNature), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DEdgeNature___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DEdgeNature___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DEdgeNature___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DEdgeNature___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DEdgeNature_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DEdgeNature___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp index c18bbff53c5..e843313e63f 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp @@ -148,43 +148,44 @@ static PyGetSetDef BPy_UnaryFunction1DFloat_getseters[] = { /*-----------------------BPy_UnaryFunction1DFloat type definition ------------------------------*/ PyTypeObject UnaryFunction1DFloat_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DFloat", /* tp_name */ - sizeof(BPy_UnaryFunction1DFloat), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DFloat___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DFloat___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DFloat___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DFloat___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DFloat_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DFloat___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DFloat", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DFloat), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DFloat___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DFloat___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DFloat___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DFloat___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DFloat_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DFloat___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp index 800a5da1978..a029dec4e29 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp @@ -160,43 +160,44 @@ static PyGetSetDef BPy_UnaryFunction1DUnsigned_getseters[] = { /*-----------------------BPy_UnaryFunction1DUnsigned type definition ----------------------------*/ PyTypeObject UnaryFunction1DUnsigned_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DUnsigned", /* tp_name */ - sizeof(BPy_UnaryFunction1DUnsigned), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DUnsigned___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DUnsigned___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DUnsigned___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DUnsigned___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DUnsigned_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DUnsigned___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DUnsigned", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DUnsigned), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DUnsigned___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DUnsigned___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DUnsigned___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DUnsigned___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DUnsigned_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DUnsigned___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp index bc76a83515b..b2272d0ecbc 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp @@ -163,43 +163,44 @@ static PyGetSetDef BPy_UnaryFunction1DVec2f_getseters[] = { /*-----------------------BPy_UnaryFunction1DVec2f type definition ------------------------------*/ PyTypeObject UnaryFunction1DVec2f_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DVec2f", /* tp_name */ - sizeof(BPy_UnaryFunction1DVec2f), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DVec2f___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DVec2f___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DVec2f___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DVec2f___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DVec2f_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DVec2f___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DVec2f", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DVec2f), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DVec2f___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DVec2f___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DVec2f___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DVec2f___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DVec2f_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DVec2f___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp index 7a5521f7571..59745628a52 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp @@ -156,43 +156,44 @@ static PyGetSetDef BPy_UnaryFunction1DVec3f_getseters[] = { /*-----------------------BPy_UnaryFunction1DVec3f type definition ------------------------------*/ PyTypeObject UnaryFunction1DVec3f_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DVec3f", /* tp_name */ - sizeof(BPy_UnaryFunction1DVec3f), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DVec3f___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DVec3f___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DVec3f___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DVec3f___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DVec3f_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DVec3f___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DVec3f", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DVec3f), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DVec3f___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DVec3f___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DVec3f___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DVec3f___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DVec3f_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DVec3f___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp index fa15983f0d3..4579fe7682d 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp @@ -185,43 +185,44 @@ static PyGetSetDef BPy_UnaryFunction1DVectorViewShape_getseters[] = { /*-----------------------BPy_UnaryFunction1DVectorViewShape type definition ---------------------*/ PyTypeObject UnaryFunction1DVectorViewShape_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DVectorViewShape", /* tp_name */ - sizeof(BPy_UnaryFunction1DVectorViewShape), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DVectorViewShape___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DVectorViewShape___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DVectorViewShape___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DVectorViewShape___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DVectorViewShape_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DVectorViewShape___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DVectorViewShape", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DVectorViewShape), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DVectorViewShape___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DVectorViewShape___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DVectorViewShape___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DVectorViewShape___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DVectorViewShape_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DVectorViewShape___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp index 7f952f1c991..2b4f1c148fc 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp @@ -169,43 +169,44 @@ static PyGetSetDef BPy_UnaryFunction1DVoid_getseters[] = { /*-----------------------BPy_UnaryFunction1DVoid type definition ------------------------------*/ PyTypeObject UnaryFunction1DVoid_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "UnaryFunction1DVoid", /* tp_name */ - sizeof(BPy_UnaryFunction1DVoid), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)UnaryFunction1DVoid___dealloc__, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - (reprfunc)UnaryFunction1DVoid___repr__, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - (ternaryfunc)UnaryFunction1DVoid___call__, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - UnaryFunction1DVoid___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - BPy_UnaryFunction1DVoid_getseters, /* tp_getset */ - &UnaryFunction1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)UnaryFunction1DVoid___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "UnaryFunction1DVoid", + /*tp_basicsize*/ sizeof(BPy_UnaryFunction1DVoid), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)UnaryFunction1DVoid___dealloc__, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ (reprfunc)UnaryFunction1DVoid___repr__, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ (ternaryfunc)UnaryFunction1DVoid___call__, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ UnaryFunction1DVoid___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ BPy_UnaryFunction1DVoid_getseters, + /*tp_base*/ &UnaryFunction1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)UnaryFunction1DVoid___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp index ca51824acf0..901a309f9be 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Nature_EdgeNature/BPy_CurveNatureF1D.cpp @@ -64,43 +64,44 @@ static int CurveNatureF1D___init__(BPy_CurveNatureF1D *self, PyObject *args, PyO /*-----------------------BPy_CurveNatureF1D type definition ------------------------------*/ PyTypeObject CurveNatureF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "CurveNatureF1D", /* tp_name */ - sizeof(BPy_CurveNatureF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - CurveNatureF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DEdgeNature_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)CurveNatureF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "CurveNatureF1D", + /*tp_basicsize*/ sizeof(BPy_CurveNatureF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ CurveNatureF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DEdgeNature_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)CurveNatureF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp index 3da7d8fa0a2..aa0e6be7b27 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Normal2DF1D.cpp @@ -58,43 +58,44 @@ static int Normal2DF1D___init__(BPy_Normal2DF1D *self, PyObject *args, PyObject /*-----------------------BPy_Normal2DF1D type definition ------------------------------*/ PyTypeObject Normal2DF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Normal2DF1D", /* tp_name */ - sizeof(BPy_Normal2DF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Normal2DF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVec2f_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Normal2DF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Normal2DF1D", + /*tp_basicsize*/ sizeof(BPy_Normal2DF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Normal2DF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVec2f_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Normal2DF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp index 64613c1aa09..0a9b7aa506b 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec2f/BPy_Orientation2DF1D.cpp @@ -58,43 +58,44 @@ static int Orientation2DF1D___init__(BPy_Orientation2DF1D *self, PyObject *args, /*-----------------------BPy_Orientation2DF1D type definition ------------------------------*/ PyTypeObject Orientation2DF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Orientation2DF1D", /* tp_name */ - sizeof(BPy_Orientation2DF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Orientation2DF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVec2f_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Orientation2DF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Orientation2DF1D", + /*tp_basicsize*/ sizeof(BPy_Orientation2DF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Orientation2DF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVec2f_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Orientation2DF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp index f840bf928bf..09b421768a7 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_Vec3f/BPy_Orientation3DF1D.cpp @@ -58,43 +58,44 @@ static int Orientation3DF1D___init__(BPy_Orientation3DF1D *self, PyObject *args, /*-----------------------BPy_Orientation3DF1D type definition ------------------------------*/ PyTypeObject Orientation3DF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Orientation3DF1D", /* tp_name */ - sizeof(BPy_Orientation3DF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Orientation3DF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVec3f_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Orientation3DF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Orientation3DF1D", + /*tp_basicsize*/ sizeof(BPy_Orientation3DF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Orientation3DF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVec3f_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Orientation3DF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp index 704fdc14d5b..0e1817b7aaa 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_Curvature2DAngleF1D.cpp @@ -59,43 +59,44 @@ static int Curvature2DAngleF1D___init__(BPy_Curvature2DAngleF1D *self, /*-----------------------BPy_Curvature2DAngleF1D type definition ------------------------------*/ PyTypeObject Curvature2DAngleF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "Curvature2DAngleF1D", /* tp_name */ - sizeof(BPy_Curvature2DAngleF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - Curvature2DAngleF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Curvature2DAngleF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "Curvature2DAngleF1D", + /*tp_basicsize*/ sizeof(BPy_Curvature2DAngleF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ Curvature2DAngleF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)Curvature2DAngleF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp index cfc75a6a60c..34c222cae28 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp @@ -72,43 +72,44 @@ static int DensityF1D___init__(BPy_DensityF1D *self, PyObject *args, PyObject *k /*-----------------------BPy_DensityF1D type definition ------------------------------*/ PyTypeObject DensityF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "DensityF1D", /* tp_name */ - sizeof(BPy_DensityF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - DensityF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)DensityF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "DensityF1D", + /*tp_basicsize*/ sizeof(BPy_DensityF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ DensityF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)DensityF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp index d5e6e51fb7f..42ab6926557 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp @@ -76,43 +76,44 @@ static int GetCompleteViewMapDensityF1D___init__(BPy_GetCompleteViewMapDensityF1 /*-----------------------BPy_GetCompleteViewMapDensityF1D type definition -----------------------*/ PyTypeObject GetCompleteViewMapDensityF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetCompleteViewMapDensityF1D", /* tp_name */ - sizeof(BPy_GetCompleteViewMapDensityF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetCompleteViewMapDensityF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetCompleteViewMapDensityF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetCompleteViewMapDensityF1D", + /*tp_basicsize*/ sizeof(BPy_GetCompleteViewMapDensityF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetCompleteViewMapDensityF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetCompleteViewMapDensityF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp index d1479f27935..dcd5d2189bf 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp @@ -85,43 +85,44 @@ static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDen /*-----------------------BPy_GetDirectionalViewMapDensityF1D type definition --------------------*/ PyTypeObject GetDirectionalViewMapDensityF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetDirectionalViewMapDensityF1D", /* tp_name */ - sizeof(BPy_GetDirectionalViewMapDensityF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetDirectionalViewMapDensityF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetDirectionalViewMapDensityF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetDirectionalViewMapDensityF1D", + /*tp_basicsize*/ sizeof(BPy_GetDirectionalViewMapDensityF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetDirectionalViewMapDensityF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetDirectionalViewMapDensityF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp index 2a1749f69dc..4c3a95098af 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedXF1D.cpp @@ -58,43 +58,44 @@ static int GetProjectedXF1D___init__(BPy_GetProjectedXF1D *self, PyObject *args, /*-----------------------BPy_GetProjectedXF1D type definition ------------------------------*/ PyTypeObject GetProjectedXF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetProjectedXF1D", /* tp_name */ - sizeof(BPy_GetProjectedXF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetProjectedXF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetProjectedXF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetProjectedXF1D", + /*tp_basicsize*/ sizeof(BPy_GetProjectedXF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetProjectedXF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetProjectedXF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp index 9960702ccdb..840d7c12920 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedYF1D.cpp @@ -58,43 +58,44 @@ static int GetProjectedYF1D___init__(BPy_GetProjectedYF1D *self, PyObject *args, /*-----------------------BPy_GetProjectedYF1D type definition ------------------------------*/ PyTypeObject GetProjectedYF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetProjectedYF1D", /* tp_name */ - sizeof(BPy_GetProjectedYF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetProjectedYF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetProjectedYF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetProjectedYF1D", + /*tp_basicsize*/ sizeof(BPy_GetProjectedYF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetProjectedYF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetProjectedYF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp index d5b02bb7666..dd2d8577d37 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetProjectedZF1D.cpp @@ -58,43 +58,44 @@ static int GetProjectedZF1D___init__(BPy_GetProjectedZF1D *self, PyObject *args, /*-----------------------BPy_GetProjectedZF1D type definition ------------------------------*/ PyTypeObject GetProjectedZF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetProjectedZF1D", /* tp_name */ - sizeof(BPy_GetProjectedZF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetProjectedZF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetProjectedZF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetProjectedZF1D", + /*tp_basicsize*/ sizeof(BPy_GetProjectedZF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetProjectedZF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetProjectedZF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp index 6a133751d8a..ad1a65f9f81 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp @@ -73,43 +73,44 @@ static int GetSteerableViewMapDensityF1D___init__(BPy_GetSteerableViewMapDensity /*-----------------------BPy_GetSteerableViewMapDensityF1D type definition ----------------------*/ PyTypeObject GetSteerableViewMapDensityF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetSteerableViewMapDensityF1D", /* tp_name */ - sizeof(BPy_GetSteerableViewMapDensityF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetSteerableViewMapDensityF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetSteerableViewMapDensityF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetSteerableViewMapDensityF1D", + /*tp_basicsize*/ sizeof(BPy_GetSteerableViewMapDensityF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetSteerableViewMapDensityF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetSteerableViewMapDensityF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp index 0ce50a9d29c..90912e32747 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp @@ -73,43 +73,44 @@ static int GetViewMapGradientNormF1D___init__(BPy_GetViewMapGradientNormF1D *sel /*-----------------------BPy_GetViewMapGradientNormF1D type definition --------------------------*/ PyTypeObject GetViewMapGradientNormF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetViewMapGradientNormF1D", /* tp_name */ - sizeof(BPy_GetViewMapGradientNormF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetViewMapGradientNormF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetViewMapGradientNormF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetViewMapGradientNormF1D", + /*tp_basicsize*/ sizeof(BPy_GetViewMapGradientNormF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetViewMapGradientNormF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetViewMapGradientNormF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp index b9213b7af82..d56d297e9dc 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetXF1D.cpp @@ -58,43 +58,44 @@ static int GetXF1D___init__(BPy_GetXF1D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_GetXF1D type definition ------------------------------*/ PyTypeObject GetXF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetXF1D", /* tp_name */ - sizeof(BPy_GetXF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetXF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetXF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetXF1D", + /*tp_basicsize*/ sizeof(BPy_GetXF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetXF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetXF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp index 2e1a7139796..eeff432e50e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetYF1D.cpp @@ -57,43 +57,44 @@ static int GetYF1D___init__(BPy_GetYF1D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_GetYF1D type definition ------------------------------*/ PyTypeObject GetYF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetYF1D", /* tp_name */ - sizeof(BPy_GetYF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetYF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetYF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetYF1D", + /*tp_basicsize*/ sizeof(BPy_GetYF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetYF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetYF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp index a7d468f4afd..1a1e72e03ec 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetZF1D.cpp @@ -58,43 +58,44 @@ static int GetZF1D___init__(BPy_GetZF1D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_GetZF1D type definition ------------------------------*/ PyTypeObject GetZF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetZF1D", /* tp_name */ - sizeof(BPy_GetZF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetZF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetZF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetZF1D", + /*tp_basicsize*/ sizeof(BPy_GetZF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetZF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetZF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp index 6ae5500b15f..df77dd26b38 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp @@ -68,43 +68,44 @@ static int LocalAverageDepthF1D___init__(BPy_LocalAverageDepthF1D *self, /*-----------------------BPy_LocalAverageDepthF1D type definition ------------------------------*/ PyTypeObject LocalAverageDepthF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "LocalAverageDepthF1D", /* tp_name */ - sizeof(BPy_LocalAverageDepthF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - LocalAverageDepthF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)LocalAverageDepthF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "LocalAverageDepthF1D", + /*tp_basicsize*/ sizeof(BPy_LocalAverageDepthF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ LocalAverageDepthF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)LocalAverageDepthF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp index ed510c25aba..4da68e657b5 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_ZDiscontinuityF1D.cpp @@ -62,43 +62,44 @@ static int ZDiscontinuityF1D___init__(BPy_ZDiscontinuityF1D *self, PyObject *arg /*-----------------------BPy_ZDiscontinuityF1D type definition ------------------------------*/ PyTypeObject ZDiscontinuityF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ZDiscontinuityF1D", /* tp_name */ - sizeof(BPy_ZDiscontinuityF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ZDiscontinuityF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DDouble_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ZDiscontinuityF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ZDiscontinuityF1D", + /*tp_basicsize*/ sizeof(BPy_ZDiscontinuityF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ZDiscontinuityF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DDouble_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ZDiscontinuityF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp index 7dc3daa2911..3318482b20d 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_unsigned_int/BPy_QuantitativeInvisibilityF1D.cpp @@ -64,43 +64,44 @@ static int QuantitativeInvisibilityF1D___init__(BPy_QuantitativeInvisibilityF1D /*-----------------------BPy_QuantitativeInvisibilityF1D type definition ------------------------*/ PyTypeObject QuantitativeInvisibilityF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "QuantitativeInvisibilityF1D", /* tp_name */ - sizeof(BPy_QuantitativeInvisibilityF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - QuantitativeInvisibilityF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DUnsigned_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)QuantitativeInvisibilityF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "QuantitativeInvisibilityF1D", + /*tp_basicsize*/ sizeof(BPy_QuantitativeInvisibilityF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ QuantitativeInvisibilityF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DUnsigned_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)QuantitativeInvisibilityF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.cpp index c765e521eb5..014a8decea1 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludeeF1D.cpp @@ -51,43 +51,44 @@ static int GetOccludeeF1D___init__(BPy_GetOccludeeF1D *self, PyObject *args, PyO /*-----------------------BPy_GetOccludeeF1D type definition ------------------------------*/ PyTypeObject GetOccludeeF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetOccludeeF1D", /* tp_name */ - sizeof(BPy_GetOccludeeF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetOccludeeF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVectorViewShape_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetOccludeeF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetOccludeeF1D", + /*tp_basicsize*/ sizeof(BPy_GetOccludeeF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetOccludeeF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVectorViewShape_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetOccludeeF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.cpp index 02284d145f0..4423fd788fa 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetOccludersF1D.cpp @@ -51,43 +51,44 @@ static int GetOccludersF1D___init__(BPy_GetOccludersF1D *self, PyObject *args, P /*-----------------------BPy_GetOccludersF1D type definition ------------------------------*/ PyTypeObject GetOccludersF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetOccludersF1D", /* tp_name */ - sizeof(BPy_GetOccludersF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetOccludersF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVectorViewShape_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetOccludersF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetOccludersF1D", + /*tp_basicsize*/ sizeof(BPy_GetOccludersF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetOccludersF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVectorViewShape_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetOccludersF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.cpp index 039b7631711..34dad93df0c 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_vector_ViewShape/BPy_GetShapeF1D.cpp @@ -51,43 +51,44 @@ static int GetShapeF1D___init__(BPy_GetShapeF1D *self, PyObject *args, PyObject /*-----------------------BPy_GetShapeF1D type definition ------------------------------*/ PyTypeObject GetShapeF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "GetShapeF1D", /* tp_name */ - sizeof(BPy_GetShapeF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GetShapeF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVectorViewShape_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GetShapeF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "GetShapeF1D", + /*tp_basicsize*/ sizeof(BPy_GetShapeF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ GetShapeF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVectorViewShape_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)GetShapeF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.cpp index 0f752a56b43..529f604f989 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_ChainingTimeStampF1D.cpp @@ -51,43 +51,44 @@ static int ChainingTimeStampF1D___init__(BPy_ChainingTimeStampF1D *self, /*-----------------------BPy_ChainingTimeStampF1D type definition ------------------------------*/ PyTypeObject ChainingTimeStampF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ChainingTimeStampF1D", /* tp_name */ - sizeof(BPy_ChainingTimeStampF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ChainingTimeStampF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVoid_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ChainingTimeStampF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ChainingTimeStampF1D", + /*tp_basicsize*/ sizeof(BPy_ChainingTimeStampF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ChainingTimeStampF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVoid_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ChainingTimeStampF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.cpp index 5477e3e246b..99549b2c754 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_IncrementChainingTimeStampF1D.cpp @@ -51,43 +51,44 @@ static int IncrementChainingTimeStampF1D___init__(BPy_IncrementChainingTimeStamp /*-----------------------BPy_IncrementChainingTimeStampF1D type definition ----------------------*/ PyTypeObject IncrementChainingTimeStampF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "IncrementChainingTimeStampF1D", /* tp_name */ - sizeof(BPy_IncrementChainingTimeStampF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - IncrementChainingTimeStampF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVoid_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)IncrementChainingTimeStampF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "IncrementChainingTimeStampF1D", + /*tp_basicsize*/ sizeof(BPy_IncrementChainingTimeStampF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ IncrementChainingTimeStampF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVoid_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)IncrementChainingTimeStampF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.cpp index 6f5253c4e83..d812d274bfe 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_void/BPy_TimeStampF1D.cpp @@ -49,43 +49,44 @@ static int TimeStampF1D___init__(BPy_TimeStampF1D *self, PyObject *args, PyObjec /*-----------------------BPy_TimeStampF1D type definition ------------------------------*/ PyTypeObject TimeStampF1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "TimeStampF1D", /* tp_name */ - sizeof(BPy_TimeStampF1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TimeStampF1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction1DVoid_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TimeStampF1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "TimeStampF1D", + /*tp_basicsize*/ sizeof(BPy_TimeStampF1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ TimeStampF1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryFunction1DVoid_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)TimeStampF1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.cpp index d86c7216d03..c55f570743b 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_FalseUP0D.cpp @@ -42,43 +42,44 @@ static int FalseUP0D___init__(BPy_FalseUP0D *self, PyObject *args, PyObject *kwd /*-----------------------BPy_FalseUP0D type definition ------------------------------*/ PyTypeObject FalseUP0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "FalseUP0D", /* tp_name */ - sizeof(BPy_FalseUP0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FalseUP0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FalseUP0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "FalseUP0D", + /*tp_basicsize*/ sizeof(BPy_FalseUP0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FalseUP0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FalseUP0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.cpp index 76f8ae01769..0af4d7f35eb 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate0D/BPy_TrueUP0D.cpp @@ -42,43 +42,43 @@ static int TrueUP0D___init__(BPy_TrueUP0D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_TrueUP0D type definition ------------------------------*/ PyTypeObject TrueUP0D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "TrueUP0D", /* tp_name */ - sizeof(BPy_TrueUP0D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TrueUP0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate0D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TrueUP0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + /*tp_name*/ PyVarObject_HEAD_INIT(nullptr, 0) "TrueUP0D", + /*tp_basicsize*/ sizeof(BPy_TrueUP0D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ TrueUP0D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate0D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)TrueUP0D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.cpp index 81b7f3990b1..ffea29804e7 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ContourUP1D.cpp @@ -43,43 +43,44 @@ static int ContourUP1D___init__(BPy_ContourUP1D *self, PyObject *args, PyObject /*-----------------------BPy_ContourUP1D type definition ------------------------------*/ PyTypeObject ContourUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ContourUP1D", /* tp_name */ - sizeof(BPy_ContourUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ContourUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ContourUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ContourUP1D", + /*tp_basicsize*/ sizeof(BPy_ContourUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ContourUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ContourUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.cpp index e376acd2d84..c133c742c0c 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_DensityLowerThanUP1D.cpp @@ -59,43 +59,44 @@ static int DensityLowerThanUP1D___init__(BPy_DensityLowerThanUP1D *self, /*-----------------------BPy_DensityLowerThanUP1D type definition ------------------------------*/ PyTypeObject DensityLowerThanUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "DensityLowerThanUP1D", /* tp_name */ - sizeof(BPy_DensityLowerThanUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - DensityLowerThanUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)DensityLowerThanUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "DensityLowerThanUP1D", + /*tp_basicsize*/ sizeof(BPy_DensityLowerThanUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ DensityLowerThanUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)DensityLowerThanUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.cpp index 99c688985f5..13a74bd2f41 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToChainingTimeStampUP1D.cpp @@ -56,43 +56,44 @@ static int EqualToChainingTimeStampUP1D___init__(BPy_EqualToChainingTimeStampUP1 /*-----------------------BPy_EqualToChainingTimeStampUP1D type definition -----------------------*/ PyTypeObject EqualToChainingTimeStampUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "EqualToChainingTimeStampUP1D", /* tp_name */ - sizeof(BPy_EqualToChainingTimeStampUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - EqualToChainingTimeStampUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)EqualToChainingTimeStampUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "EqualToChainingTimeStampUP1D", + /*tp_basicsize*/ sizeof(BPy_EqualToChainingTimeStampUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ EqualToChainingTimeStampUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)EqualToChainingTimeStampUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.cpp index 48365507d1a..ac4cd389fd4 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_EqualToTimeStampUP1D.cpp @@ -55,43 +55,44 @@ static int EqualToTimeStampUP1D___init__(BPy_EqualToTimeStampUP1D *self, /*-----------------------BPy_EqualToTimeStampUP1D type definition ------------------------------*/ PyTypeObject EqualToTimeStampUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "EqualToTimeStampUP1D", /* tp_name */ - sizeof(BPy_EqualToTimeStampUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - EqualToTimeStampUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)EqualToTimeStampUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "EqualToTimeStampUP1D", + /*tp_basicsize*/ sizeof(BPy_EqualToTimeStampUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ EqualToTimeStampUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)EqualToTimeStampUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.cpp index ab8153e6fea..7c1b8685771 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ExternalContourUP1D.cpp @@ -47,43 +47,44 @@ static int ExternalContourUP1D___init__(BPy_ExternalContourUP1D *self, /*-----------------------BPy_ExternalContourUP1D type definition ------------------------------*/ PyTypeObject ExternalContourUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ExternalContourUP1D", /* tp_name */ - sizeof(BPy_ExternalContourUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ExternalContourUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ExternalContourUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ExternalContourUP1D", + /*tp_basicsize*/ sizeof(BPy_ExternalContourUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ExternalContourUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ExternalContourUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.cpp index 4d1730040d7..506c724023c 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_FalseUP1D.cpp @@ -42,43 +42,44 @@ static int FalseUP1D___init__(BPy_FalseUP1D *self, PyObject *args, PyObject *kwd /*-----------------------BPy_FalseUP1D type definition ------------------------------*/ PyTypeObject FalseUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "FalseUP1D", /* tp_name */ - sizeof(BPy_FalseUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - FalseUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)FalseUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "FalseUP1D", + /*tp_basicsize*/ sizeof(BPy_FalseUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ FalseUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)FalseUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.cpp index e17c7705420..c834aa81445 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_QuantitativeInvisibilityUP1D.cpp @@ -58,43 +58,44 @@ static int QuantitativeInvisibilityUP1D___init__(BPy_QuantitativeInvisibilityUP1 /*-----------------------BPy_QuantitativeInvisibilityUP1D type definition -----------------------*/ PyTypeObject QuantitativeInvisibilityUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "QuantitativeInvisibilityUP1D", /* tp_name */ - sizeof(BPy_QuantitativeInvisibilityUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - QuantitativeInvisibilityUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)QuantitativeInvisibilityUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "QuantitativeInvisibilityUP1D", + /*tp_basicsize*/ sizeof(BPy_QuantitativeInvisibilityUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ QuantitativeInvisibilityUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)QuantitativeInvisibilityUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.cpp index b410ee14831..f7307a81540 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_ShapeUP1D.cpp @@ -56,43 +56,44 @@ static int ShapeUP1D___init__(BPy_ShapeUP1D *self, PyObject *args, PyObject *kwd /*-----------------------BPy_ShapeUP1D type definition ------------------------------*/ PyTypeObject ShapeUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "ShapeUP1D", /* tp_name */ - sizeof(BPy_ShapeUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ShapeUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ShapeUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "ShapeUP1D", + /*tp_basicsize*/ sizeof(BPy_ShapeUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ ShapeUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)ShapeUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.cpp index 03c7f364b55..704bb5e9608 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_TrueUP1D.cpp @@ -42,43 +42,44 @@ static int TrueUP1D___init__(BPy_TrueUP1D *self, PyObject *args, PyObject *kwds) /*-----------------------BPy_TrueUP1D type definition ------------------------------*/ PyTypeObject TrueUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "TrueUP1D", /* tp_name */ - sizeof(BPy_TrueUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TrueUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TrueUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "TrueUP1D", + /*tp_basicsize*/ sizeof(BPy_TrueUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ TrueUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)TrueUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_WithinImageBoundaryUP1D.cpp b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_WithinImageBoundaryUP1D.cpp index eea3a1cacc4..da1e07162d1 100644 --- a/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_WithinImageBoundaryUP1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryPredicate1D/BPy_WithinImageBoundaryUP1D.cpp @@ -55,43 +55,44 @@ static int WithinImageBoundaryUP1D___init__(BPy_WithinImageBoundaryUP1D *self, /*-----------------------BPy_TrueUP1D type definition ------------------------------*/ PyTypeObject WithinImageBoundaryUP1D_Type = { - PyVarObject_HEAD_INIT(nullptr, 0) "WithinImageBoundaryUP1D", /* tp_name */ - sizeof(BPy_WithinImageBoundaryUP1D), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - WithinImageBoundaryUP1D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryPredicate1D_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)WithinImageBoundaryUP1D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + PyVarObject_HEAD_INIT(nullptr, 0) + /*tp_name*/ "WithinImageBoundaryUP1D", + /*tp_basicsize*/ sizeof(BPy_WithinImageBoundaryUP1D), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ nullptr, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ nullptr, + /*tp_setattr*/ nullptr, + /*tp_as_async*/ nullptr, + /*tp_repr*/ nullptr, + /*tp_as_number*/ nullptr, + /*tp_as_sequence*/ nullptr, + /*tp_as_mapping*/ nullptr, + /*tp_hash*/ nullptr, + /*tp_call*/ nullptr, + /*tp_str*/ nullptr, + /*tp_getattro*/ nullptr, + /*tp_setattro*/ nullptr, + /*tp_as_buffer*/ nullptr, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ WithinImageBoundaryUP1D___doc__, + /*tp_traverse*/ nullptr, + /*tp_clear*/ nullptr, + /*tp_richcompare*/ nullptr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ nullptr, + /*tp_iternext*/ nullptr, + /*tp_methods*/ nullptr, + /*tp_members*/ nullptr, + /*tp_getset*/ nullptr, + /*tp_base*/ &UnaryPredicate1D_Type, + /*tp_dict*/ nullptr, + /*tp_descr_get*/ nullptr, + /*tp_descr_set*/ nullptr, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)WithinImageBoundaryUP1D___init__, + /*tp_alloc*/ nullptr, + /*tp_new*/ nullptr, }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c index 80517979f30..6f44cc68a19 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c @@ -154,7 +154,7 @@ static bool bake_strokes(Object *ob, typedef struct LineartBakeJob { wmWindowManager *wm; void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; /* C or ob must have one != NULL. */ @@ -218,8 +218,8 @@ static void lineart_gpencil_guard_modifiers(LineartBakeJob *bj) } static void lineart_gpencil_bake_startjob(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { LineartBakeJob *bj = (LineartBakeJob *)customdata; @@ -337,7 +337,7 @@ static int lineart_gpencil_bake_common(bContext *C, } float pseduo_progress; - short pseduo_do_update; + bool pseduo_do_update; lineart_gpencil_bake_startjob(bj, NULL, &pseduo_do_update, &pseduo_progress); BLI_linklist_free(bj->objects, NULL); diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 5c76dfe52df..a05bc51fcea 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -358,14 +358,14 @@ struct IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, * Will rebuild all used indices and proxies at once. */ void IMB_anim_index_rebuild(struct IndexBuildContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); /** * Finish rebuilding proxies/time-codes and free temporary contexts used. */ -void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop); +void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, bool stop); /** * Return the length (in frames) of the given \a anim. diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 63836690ee4..d824b87f493 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -931,7 +931,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, return (IndexBuildContext *)context; } -static void index_rebuild_ffmpeg_finish(FFmpegIndexBuilderContext *context, int stop) +static void index_rebuild_ffmpeg_finish(FFmpegIndexBuilderContext *context, const bool stop) { int i; @@ -1012,8 +1012,8 @@ static void index_rebuild_ffmpeg_proc_decoded_frame(FFmpegIndexBuilderContext *c } static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { AVFrame *in_frame = av_frame_alloc(); @@ -1303,7 +1303,7 @@ static IndexBuildContext *index_fallback_create_context(struct anim *anim, return (IndexBuildContext *)context; } -static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, int stop) +static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, const bool stop) { struct anim *anim = context->anim; char filepath[FILE_MAX]; @@ -1330,8 +1330,8 @@ static void index_rebuild_fallback_finish(FallbackIndexBuilderContext *context, } static void index_rebuild_fallback(FallbackIndexBuilderContext *context, - const short *stop, - short *do_update, + const bool *stop, + bool *do_update, float *progress) { int count = IMB_anim_get_duration(context->anim, IMB_TC_NONE); @@ -1470,9 +1470,9 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, void IMB_anim_index_rebuild(struct IndexBuildContext *context, /* NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, + bool *stop, /* NOLINTNEXTLINE: readability-non-const-parameter. */ - short *do_update, + bool *do_update, /* NOLINTNEXTLINE: readability-non-const-parameter. */ float *progress) { @@ -1494,7 +1494,7 @@ void IMB_anim_index_rebuild(struct IndexBuildContext *context, UNUSED_VARS(stop, do_update, progress); } -void IMB_anim_index_rebuild_finish(IndexBuildContext *context, short stop) +void IMB_anim_index_rebuild_finish(IndexBuildContext *context, const bool stop) { switch (context->anim_type) { #ifdef WITH_FFMPEG diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index 546bc9d49cc..1ac4eacc997 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -72,8 +72,8 @@ static void report_job_duration(const ExportJobData *data) static void export_startjob(void *customdata, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ExportJobData *data = static_cast<ExportJobData *>(customdata); @@ -230,7 +230,7 @@ bool ABC_export(Scene *scene, } else { /* Fake a job context, so that we don't need NULL pointer checks while exporting. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; blender::io::alembic::export_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index b92ce5b4cfb..f6c11f6a684 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -427,8 +427,8 @@ struct ImportJobData { ArchiveReader *archive; std::vector<AbcObjectReader *> readers; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; char error_code; @@ -446,7 +446,7 @@ static void report_job_duration(const ImportJobData *data) std::cout << '\n'; } -static void import_startjob(void *user_data, short *stop, short *do_update, float *progress) +static void import_startjob(void *user_data, bool *stop, bool *do_update, float *progress) { SCOPE_TIMER("Alembic import, objects reading and creation"); @@ -715,7 +715,7 @@ bool ABC_import(bContext *C, } else { /* Fake a job context, so that we don't need NULL pointer checks while importing. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; import_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp index 6d7593afb8b..1a28adf50a5 100644 --- a/source/blender/io/collada/MeshImporter.cpp +++ b/source/blender/io/collada/MeshImporter.cpp @@ -564,7 +564,7 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len) /* set default flags */ medge = &edges[mesh->totedge]; for (int i = 0; i < len; i++, medge++) { - medge->flag = ME_EDGEDRAW | ME_EDGERENDER; + medge->flag = ME_EDGEDRAW; } mesh->totedge = totedge; diff --git a/source/blender/io/usd/intern/usd_capi_export.cc b/source/blender/io/usd/intern/usd_capi_export.cc index 3977daaca4a..bf25c03fb7a 100644 --- a/source/blender/io/usd/intern/usd_capi_export.cc +++ b/source/blender/io/usd/intern/usd_capi_export.cc @@ -57,8 +57,8 @@ static void report_job_duration(const ExportJobData *data) static void export_startjob(void *customdata, /* Cannot be const, this function implements wm_jobs_start_callback. * NOLINTNEXTLINE: readability-non-const-parameter. */ - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { ExportJobData *data = static_cast<ExportJobData *>(customdata); @@ -205,7 +205,7 @@ bool USD_export(bContext *C, } else { /* Fake a job context, so that we don't need NULL pointer checks while exporting. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; blender::io::usd::export_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc index b8cc43beeb9..680e9c758d3 100644 --- a/source/blender/io/usd/intern/usd_capi_import.cc +++ b/source/blender/io/usd/intern/usd_capi_import.cc @@ -126,8 +126,8 @@ struct ImportJobData { USDStageReader *archive; - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; char error_code; @@ -144,7 +144,7 @@ static void report_job_duration(const ImportJobData *data) std::cout << '\n'; } -static void import_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void import_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { ImportJobData *data = static_cast<ImportJobData *>(customdata); @@ -430,7 +430,7 @@ bool USD_import(struct bContext *C, } else { /* Fake a job context, so that we don't need NULL pointer checks while importing. */ - short stop = 0, do_update = 0; + bool stop = false, do_update = false; float progress = 0.0f; import_startjob(job, &stop, &do_update, &progress); diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc index 5c81cf7abca..5289a8c750a 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc @@ -7,8 +7,9 @@ #include <algorithm> #include <cstdio> +#include "BKE_attribute.hh" #include "BKE_blender_version.h" -#include "BKE_geometry_set.hh" +#include "BKE_mesh.h" #include "BLI_color.hh" #include "BLI_enumerable_thread_specific.hh" @@ -416,15 +417,12 @@ void OBJWriter::write_edges_indices(FormatHandler &fh, const OBJMesh &obj_mesh_data) const { /* NOTE: ensure_mesh_edges should be called before. */ - const int tot_edges = obj_mesh_data.tot_edges(); - for (int edge_index = 0; edge_index < tot_edges; edge_index++) { - const std::optional<std::array<int, 2>> vertex_indices = - obj_mesh_data.calc_loose_edge_vert_indices(edge_index); - if (!vertex_indices) { - continue; + const Span<MEdge> edges = obj_mesh_data.get_mesh()->edges(); + for (const int i : edges.index_range()) { + const MEdge &edge = edges[i]; + if (edge.flag & ME_LOOSEEDGE) { + fh.write_obj_edge(edge.v1 + offsets.vertex_offset + 1, edge.v2 + offsets.vertex_offset + 1); } - fh.write_obj_edge((*vertex_indices)[0] + offsets.vertex_offset + 1, - (*vertex_indices)[1] + offsets.vertex_offset + 1); } } diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc index f5a94b1fc8a..a95f917869b 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc @@ -183,7 +183,6 @@ void OBJMesh::ensure_mesh_normals() const void OBJMesh::ensure_mesh_edges() const { - BKE_mesh_calc_edges(export_mesh_eval_, true, false); BKE_mesh_calc_edges_loose(export_mesh_eval_); } @@ -507,13 +506,4 @@ const char *OBJMesh::get_poly_deform_group_name(const int16_t def_group_index) c return vertex_group.name; } -std::optional<std::array<int, 2>> OBJMesh::calc_loose_edge_vert_indices(const int edge_index) const -{ - const Span<MEdge> edges = export_mesh_eval_->edges(); - const MEdge &edge = edges[edge_index]; - if (edge.flag & ME_LOOSEEDGE) { - return std::array<int, 2>{int(edge.v1), int(edge.v2)}; - } - return std::nullopt; -} } // namespace blender::io::obj diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh index ec98468e2de..89ee6f4dea2 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh @@ -216,11 +216,6 @@ class OBJMesh : NonCopyable { const char *get_poly_deform_group_name(int16_t def_group_index) const; /** - * Calculate vertex indices of an edge's corners if it is a loose edge. - */ - std::optional<std::array<int, 2>> calc_loose_edge_vert_indices(int edge_index) const; - - /** * Calculate the order in which the polygons should be written into the file (sorted by material * index). */ diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc index 33ece88d3d4..56ad7fd4563 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc @@ -254,7 +254,6 @@ void MeshFromGeometry::create_edges(Mesh *mesh) dst_edge.v1 = mesh_geometry_.global_to_local_vertices_.lookup_default(src_edge.v1, 0); dst_edge.v2 = mesh_geometry_.global_to_local_vertices_.lookup_default(src_edge.v2, 0); BLI_assert(dst_edge.v1 < total_verts && dst_edge.v2 < total_verts); - dst_edge.flag = ME_LOOSEEDGE; } /* Set argument `update` to true so that existing, explicitly imported edges can be merged diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h index 8b889e17762..72357ea6734 100644 --- a/source/blender/makesdna/DNA_brush_enums.h +++ b/source/blender/makesdna/DNA_brush_enums.h @@ -315,12 +315,6 @@ typedef enum eGP_Sculpt_Mode_Flag { GP_SCULPT_FLAGMODE_APPLY_THICKNESS = (1 << 2), /* apply brush to uv data */ GP_SCULPT_FLAGMODE_APPLY_UV = (1 << 3), - /* Stroke Auto-Masking for sculpt. */ - GP_SCULPT_FLAGMODE_AUTOMASK_STROKE = (1 << 4), - /* Layer Auto-Masking for sculpt. */ - GP_SCULPT_FLAGMODE_AUTOMASK_LAYER = (1 << 5), - /* Material Auto-Masking for sculpt. */ - GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL = (1 << 6), } eGP_Sculpt_Mode_Flag; typedef enum eAutomasking_flag { diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index a1781265278..f1c2dcaae68 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -73,7 +73,6 @@ enum { ME_SEAM = (1 << 2), /** Deprecated hide status. Now stored in ".hide_edge" attribute. */ /* ME_HIDE = (1 << 4), */ - ME_EDGERENDER = (1 << 5), ME_LOOSEEDGE = (1 << 7), ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */ }; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 0b7c17d44bb..3161238dc2e 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -613,7 +613,7 @@ typedef struct bNodeTree { void (*progress)(void *, float progress); /** \warning may be called by different threads */ void (*stats_draw)(void *, const char *str); - int (*test_break)(void *); + bool (*test_break)(void *); void (*update_draw)(void *); void *tbh, *prh, *sdh, *udh; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 28359038be5..8d02b274c65 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1155,6 +1155,16 @@ typedef enum eGP_Sculpt_SettingsFlag { GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 1), /** Scale thickness. */ GP_SCULPT_SETT_FLAG_SCALE_THICKNESS = (1 << 3), + /* Stroke Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE = (1 << 4), + /* Stroke Layer Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE = (1 << 5), + /* Stroke Material Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE = (1 << 6), + /* Active Layer Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE = (1 << 7), + /* Active Material Auto-Masking for sculpt. */ + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE = (1 << 8), } eGP_Sculpt_SettingsFlag; /** #GP_Sculpt_Settings.gpencil_selectmode_sculpt */ diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 5ba31070e1d..ce51b52de39 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1919,26 +1919,6 @@ static void rna_def_gpencil_options(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna( - prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_AUTOMASK_STROKE); - RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Mask strokes below brush cursor"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - - prop = RNA_def_property(srna, "use_automasking_layer", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_AUTOMASK_LAYER); - RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Mask strokes using active layer"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - - prop = RNA_def_property(srna, "use_automasking_material", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna( - prop, NULL, "sculpt_mode_flag", GP_SCULPT_FLAGMODE_AUTOMASK_MATERIAL); - RNA_def_property_ui_text(prop, "Auto-Masking Material", "Mask strokes using active material"); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - /* Material */ prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 252d2e657b5..1616684cb6a 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -142,7 +142,6 @@ static void rna_Material_texpaint_begin(CollectionPropertyIterator *iter, Pointe static void rna_Material_active_paint_texture_index_update(bContext *C, PointerRNA *ptr) { Main *bmain = CTX_data_main(C); - bScreen *screen; Material *ma = (Material *)ptr->owner_id; if (ma->use_nodes && ma->nodetree) { @@ -157,25 +156,7 @@ static void rna_Material_active_paint_texture_index_update(bContext *C, PointerR TexPaintSlot *slot = &ma->texpaintslot[ma->paint_active_slot]; Image *image = slot->ima; if (image) { - for (screen = bmain->screens.first; screen; screen = screen->id.next) { - wmWindow *win = ED_screen_window_find(screen, bmain->wm.first); - if (win == NULL) { - continue; - } - - ScrArea *area; - for (area = screen->areabase.first; area; area = area->next) { - SpaceLink *sl; - for (sl = area->spacedata.first; sl; sl = sl->next) { - if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)sl; - if (!sima->pin) { - ED_space_image_set(bmain, sima, image, true); - } - } - } - } - } + ED_space_image_sync(bmain, image, false); } /* For compatibility reasons with vertex paint we activate the color attribute. */ diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 440309849ab..c5e7c6a6e91 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -537,24 +537,9 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) ViewLayer *view_layer = CTX_data_view_layer(C); BKE_view_layer_synced_ensure(scene, view_layer); Object *ob = BKE_view_layer_active_object_get(view_layer); - bScreen *screen; Image *ima = scene->toolsettings->imapaint.canvas; - for (screen = bmain->screens.first; screen; screen = screen->id.next) { - ScrArea *area; - for (area = screen->areabase.first; area; area = area->next) { - SpaceLink *slink; - for (slink = area->spacedata.first; slink; slink = slink->next) { - if (slink->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)slink; - - if (!sima->pin) { - ED_space_image_set(bmain, sima, ima, true); - } - } - } - } - } + ED_space_image_sync(bmain, ima, false); if (ob && ob->type == OB_MESH) { ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); @@ -1653,6 +1638,36 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + prop = RNA_def_property(srna, "use_automasking_stroke", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE); + RNA_def_property_ui_text(prop, "Auto-Masking Strokes", "Affect only strokes below the cursor"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + + prop = RNA_def_property(srna, "use_automasking_layer_stroke", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE); + RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only strokes below the cursor"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + + prop = RNA_def_property(srna, "use_automasking_material_stroke", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE); + RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only strokes below the cursor"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + + prop = RNA_def_property(srna, "use_automasking_layer_active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE); + RNA_def_property_ui_text(prop, "Auto-Masking Layer", "Affect only the Active Layer"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + + prop = RNA_def_property(srna, "use_automasking_material_active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE); + RNA_def_property_ui_text(prop, "Auto-Masking Material", "Affect only the Active Material"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + /* custom falloff curve */ prop = RNA_def_property(srna, "multiframe_falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cur_falloff"); diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index 7fabd5c65fa..659a1625079 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -607,7 +607,7 @@ static void add_interpolated_polys_to_new_mesh(const Mesh &src_mesh, cut_edge.v1 = dst_loops[mp_dst.loopstart].v; cut_edge.v2 = cut_dst_loop.v; BLI_assert(cut_edge.v1 != cut_edge.v2); - cut_edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + cut_edge.flag = ME_EDGEDRAW; edge_index++; /* Only handle one of the cuts per iteration. */ diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index afd7f5a2e48..4ba274dbd8a 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -814,7 +814,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* add the new edge */ med_new->v1 = varray_stride + j; med_new->v2 = med_new->v1 - totvert; - med_new->flag = ME_EDGEDRAW | ME_EDGERENDER; + med_new->flag = ME_EDGEDRAW; if (!BLI_BITMAP_TEST(vert_tag, j)) { med_new->flag |= ME_LOOSEEDGE; } @@ -835,7 +835,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * for (i = 0; i < totvert; i++) { med_new->v1 = i; med_new->v2 = varray_stride + i; - med_new->flag = ME_EDGEDRAW | ME_EDGERENDER; + med_new->flag = ME_EDGEDRAW; if (!BLI_BITMAP_TEST(vert_tag, i)) { med_new->flag |= ME_LOOSEEDGE; } diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.c b/source/blender/modifiers/intern/MOD_solidify_extrude.c index a662d729f52..08e9569bd95 100644 --- a/source/blender/modifiers/intern/MOD_solidify_extrude.c +++ b/source/blender/modifiers/intern/MOD_solidify_extrude.c @@ -1045,7 +1045,7 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex for (i = 0; i < rimVerts; i++, ed++) { ed->v1 = new_vert_arr[i]; ed->v2 = (do_shell ? new_vert_arr[i] : i) + verts_num; - ed->flag |= ME_EDGEDRAW | ME_EDGERENDER; + ed->flag |= ME_EDGEDRAW; if (orig_ed) { *orig_ed = ORIGINDEX_NONE; diff --git a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c index 5948fefa8b3..9d0b5c30b5e 100644 --- a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c +++ b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c @@ -2042,7 +2042,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, BLI_assert(v2 != MOD_SOLIDIFY_EMPTY_TAG); medge[insert].v1 = v1; medge[insert].v2 = v2; - medge[insert].flag = orig_medge[(*l)->old_edge].flag | ME_EDGEDRAW | ME_EDGERENDER; + medge[insert].flag = orig_medge[(*l)->old_edge].flag | ME_EDGEDRAW; if (result_edge_crease) { result_edge_crease[insert] = orig_edge_crease ? orig_edge_crease[(*l)->old_edge] : 0.0f; @@ -2206,8 +2206,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, } medge[edge_index].v1 = last_g->new_vert; medge[edge_index].v2 = g->new_vert; - medge[edge_index].flag = ME_EDGEDRAW | ME_EDGERENDER | - ((last_flag | flag) & (ME_SEAM | ME_SHARP)); + medge[edge_index].flag = ME_EDGEDRAW | ((last_flag | flag) & (ME_SEAM | ME_SHARP)); if (result_edge_crease) { result_edge_crease[edge_index] = max_ff(mv_crease, min_ff(last_max_crease, max_crease)); @@ -2240,7 +2239,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, last_g->open_face_edge = edge_index; medge[edge_index].v1 = last_g->new_vert; medge[edge_index].v2 = first_g->new_vert; - medge[edge_index].flag = ME_EDGEDRAW | ME_EDGERENDER | + medge[edge_index].flag = ME_EDGEDRAW | ((last_flag | first_flag) & (ME_SEAM | ME_SHARP)); if (result_edge_crease) { result_edge_crease[edge_index] = max_ff(mv_crease, diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c index e8280bc9c97..5bae6090758 100644 --- a/source/blender/modifiers/intern/MOD_triangulate.c +++ b/source/blender/modifiers/intern/MOD_triangulate.c @@ -86,7 +86,7 @@ static Mesh *triangulate_mesh(Mesh *mesh, /* force drawing of all edges (seems to be omitted in CDDM_from_bmesh) */ for (i = 0; i < edges_num; i++, me++) { - me->flag |= ME_EDGEDRAW | ME_EDGERENDER; + me->flag |= ME_EDGEDRAW; } return result; diff --git a/source/blender/nodes/composite/CMakeLists.txt b/source/blender/nodes/composite/CMakeLists.txt index 4255a2dde21..8bcc2a393d3 100644 --- a/source/blender/nodes/composite/CMakeLists.txt +++ b/source/blender/nodes/composite/CMakeLists.txt @@ -19,6 +19,7 @@ set(INC ../../windowmanager ../../compositor/realtime_compositor ../../compositor/realtime_compositor/algorithms + ../../compositor/realtime_compositor/cached_resources ../../../../intern/guardedalloc # dna_type_offsets.h diff --git a/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc b/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc index e2f4e80270e..dffdc4a9408 100644 --- a/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc +++ b/source/blender/nodes/composite/nodes/node_composite_alpha_over.cc @@ -108,7 +108,7 @@ void register_node_type_cmp_alphaover() cmp_node_type_base(&ntype, CMP_NODE_ALPHAOVER, "Alpha Over", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::cmp_node_alphaover_declare; ntype.draw_buttons = file_ns::node_composit_buts_alphaover; - node_type_init(&ntype, file_ns::node_alphaover_init); + ntype.initfunc = file_ns::node_alphaover_init; node_type_storage( &ntype, "NodeTwoFloats", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc b/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc index 25fefd33199..8c77df08211 100644 --- a/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc +++ b/source/blender/nodes/composite/nodes/node_composite_antialiasing.cc @@ -74,7 +74,7 @@ void register_node_type_cmp_antialiasing() ntype.draw_buttons = file_ns::node_composit_buts_antialiasing; ntype.flag |= NODE_PREVIEW; node_type_size(&ntype, 170, 140, 200); - node_type_init(&ntype, file_ns::node_composit_init_antialiasing); + ntype.initfunc = file_ns::node_composit_init_antialiasing; node_type_storage( &ntype, "NodeAntiAliasingData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc index af7581d845f..65990677ae3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc @@ -119,7 +119,7 @@ void register_node_type_cmp_bilateralblur() cmp_node_type_base(&ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_bilateralblur_declare; ntype.draw_buttons = file_ns::node_composit_buts_bilateralblur; - node_type_init(&ntype, file_ns::node_composit_init_bilateralblur); + ntype.initfunc = file_ns::node_composit_init_bilateralblur; node_type_storage( &ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.cc b/source/blender/nodes/composite/nodes/node_composite_blur.cc index a9372bdcfb7..6eacc685c7e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_blur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_blur.cc @@ -5,11 +5,7 @@ * \ingroup cmpnodes */ -#include <cstdint> - -#include "BLI_array.hh" #include "BLI_assert.h" -#include "BLI_index_range.hh" #include "BLI_math_base.hh" #include "BLI_math_vec_types.hh" #include "BLI_math_vector.hh" @@ -19,12 +15,13 @@ #include "UI_interface.h" #include "UI_resources.h" -#include "RE_pipeline.h" - +#include "GPU_shader.h" #include "GPU_state.h" #include "GPU_texture.h" #include "COM_node_operation.hh" +#include "COM_symmetric_blur_weights.hh" +#include "COM_symmetric_separable_blur_weights.hh" #include "COM_utilities.hh" #include "node_composite_util.hh" @@ -92,192 +89,7 @@ static void node_composit_buts_blur(uiLayout *layout, bContext * /*C*/, PointerR using namespace blender::realtime_compositor; -/* A helper class that computes and caches a 1D GPU texture containing the weights of the separable - * filter of the given type and radius. The filter is assumed to be symmetric, because the filter - * functions are all even functions. Consequently, only the positive half of the filter is computed - * and the shader takes that into consideration. */ -class SymmetricSeparableBlurWeights { - private: - float radius_ = 1.0f; - int type_ = R_FILTER_GAUSS; - GPUTexture *texture_ = nullptr; - - public: - ~SymmetricSeparableBlurWeights() - { - if (texture_) { - GPU_texture_free(texture_); - } - } - - /* Check if a texture containing the weights was already computed for the given filter type and - * radius. If such texture exists, do nothing, otherwise, free the already computed texture and - * recompute it with the given filter type and radius. */ - void update(float radius, int type) - { - if (texture_ && type == type_ && radius == radius_) { - return; - } - - if (texture_) { - GPU_texture_free(texture_); - } - - /* The size of filter is double the radius plus 1, but since the filter is symmetric, we only - * compute half of it and no doubling happens. We add 1 to make sure the filter size is always - * odd and there is a center weight. */ - const int size = math::ceil(radius) + 1; - Array<float> weights(size); - - float sum = 0.0f; - - /* First, compute the center weight. */ - const float center_weight = RE_filter_value(type, 0.0f); - weights[0] = center_weight; - sum += center_weight; - - /* Second, compute the other weights in the positive direction, making sure to add double the - * weight to the sum of weights because the filter is symmetric and we only loop over half of - * it. Skip the center weight already computed by dropping the front index. */ - const float scale = radius > 0.0f ? 1.0f / radius : 0.0f; - for (const int i : weights.index_range().drop_front(1)) { - const float weight = RE_filter_value(type, i * scale); - weights[i] = weight; - sum += weight * 2.0f; - } - - /* Finally, normalize the weights. */ - for (const int i : weights.index_range()) { - weights[i] /= sum; - } - - texture_ = GPU_texture_create_1d("Weights", size, 1, GPU_R16F, weights.data()); - - type_ = type; - radius_ = radius; - } - - void bind_as_texture(GPUShader *shader, const char *texture_name) - { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); - GPU_texture_bind(texture_, texture_image_unit); - } - - void unbind_as_texture() - { - GPU_texture_unbind(texture_); - } -}; - -/* A helper class that computes and caches a 2D GPU texture containing the weights of the filter of - * the given type and radius. The filter is assumed to be symmetric, because the filter functions - * are evaluated on the normalized distance to the center. Consequently, only the upper right - * quadrant are computed and the shader takes that into consideration. */ -class SymmetricBlurWeights { - private: - int type_ = R_FILTER_GAUSS; - float2 radius_ = float2(1.0f); - GPUTexture *texture_ = nullptr; - - public: - ~SymmetricBlurWeights() - { - if (texture_) { - GPU_texture_free(texture_); - } - } - - /* Check if a texture containing the weights was already computed for the given filter type and - * radius. If such texture exists, do nothing, otherwise, free the already computed texture and - * recompute it with the given filter type and radius. */ - void update(float2 radius, int type) - { - if (texture_ && type == type_ && radius == radius_) { - return; - } - - if (texture_) { - GPU_texture_free(texture_); - } - - /* The full size of filter is double the radius plus 1, but since the filter is symmetric, we - * only compute a single quadrant of it and so no doubling happens. We add 1 to make sure the - * filter size is always odd and there is a center weight. */ - const float2 scale = math::safe_divide(float2(1.0f), radius); - const int2 size = int2(math::ceil(radius)) + int2(1); - Array<float> weights(size.x * size.y); - - float sum = 0.0f; - - /* First, compute the center weight. */ - const float center_weight = RE_filter_value(type, 0.0f); - weights[0] = center_weight; - sum += center_weight; - - /* Then, compute the weights along the positive x axis, making sure to add double the weight to - * the sum of weights because the filter is symmetric and we only loop over the positive half - * of the x axis. Skip the center weight already computed by dropping the front index. */ - for (const int x : IndexRange(size.x).drop_front(1)) { - const float weight = RE_filter_value(type, x * scale.x); - weights[x] = weight; - sum += weight * 2.0f; - } - - /* Then, compute the weights along the positive y axis, making sure to add double the weight to - * the sum of weights because the filter is symmetric and we only loop over the positive half - * of the y axis. Skip the center weight already computed by dropping the front index. */ - for (const int y : IndexRange(size.y).drop_front(1)) { - const float weight = RE_filter_value(type, y * scale.y); - weights[size.x * y] = weight; - sum += weight * 2.0f; - } - - /* Then, compute the other weights in the upper right quadrant, making sure to add quadruple - * the weight to the sum of weights because the filter is symmetric and we only loop over one - * quadrant of it. Skip the weights along the y and x axis already computed by dropping the - * front index. */ - for (const int y : IndexRange(size.y).drop_front(1)) { - for (const int x : IndexRange(size.x).drop_front(1)) { - const float weight = RE_filter_value(type, math::length(float2(x, y) * scale)); - weights[size.x * y + x] = weight; - sum += weight * 4.0f; - } - } - - /* Finally, normalize the weights. */ - for (const int y : IndexRange(size.y)) { - for (const int x : IndexRange(size.x)) { - weights[size.x * y + x] /= sum; - } - } - - texture_ = GPU_texture_create_2d("Weights", size.x, size.y, 1, GPU_R16F, weights.data()); - - type_ = type; - radius_ = radius; - } - - void bind_as_texture(GPUShader *shader, const char *texture_name) - { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); - GPU_texture_bind(texture_, texture_image_unit); - } - - void unbind_as_texture() - { - GPU_texture_unbind(texture_); - } -}; - class BlurOperation : public NodeOperation { - private: - /* Cached symmetric blur weights. */ - SymmetricBlurWeights blur_weights_; - /* Cached symmetric blur weights for the separable horizontal pass. */ - SymmetricSeparableBlurWeights blur_horizontal_weights_; - /* Cached symmetric blur weights for the separable vertical pass. */ - SymmetricSeparableBlurWeights blur_vertical_weights_; - public: using NodeOperation::NodeOperation; @@ -308,13 +120,16 @@ class BlurOperation : public NodeOperation { const Result &input_image = get_input("Image"); input_image.bind_as_texture(shader, "input_tx"); - blur_weights_.update(compute_blur_radius(), node_storage(bnode()).filtertype); - blur_weights_.bind_as_texture(shader, "weights_tx"); + const float2 blur_radius = compute_blur_radius(); + + const SymmetricBlurWeights &weights = context().cache_manager().get_symmetric_blur_weights( + node_storage(bnode()).filtertype, blur_radius); + weights.bind_as_texture(shader, "weights_tx"); Domain domain = compute_domain(); if (get_extend_bounds()) { /* Add a radius amount of pixels in both sides of the image, hence the multiply by 2. */ - domain.size += int2(math::ceil(compute_blur_radius())) * 2; + domain.size += int2(math::ceil(blur_radius)) * 2; } Result &output_image = get_result("Image"); @@ -326,7 +141,7 @@ class BlurOperation : public NodeOperation { GPU_shader_unbind(); output_image.unbind_as_image(); input_image.unbind_as_texture(); - blur_weights_.unbind_as_texture(); + weights.unbind_as_texture(); } GPUTexture *execute_separable_blur_horizontal_pass() @@ -341,12 +156,16 @@ class BlurOperation : public NodeOperation { const Result &input_image = get_input("Image"); input_image.bind_as_texture(shader, "input_tx"); - blur_horizontal_weights_.update(compute_blur_radius().x, node_storage(bnode()).filtertype); - blur_horizontal_weights_.bind_as_texture(shader, "weights_tx"); + const float2 blur_radius = compute_blur_radius(); + + const SymmetricSeparableBlurWeights &weights = + context().cache_manager().get_symmetric_separable_blur_weights( + node_storage(bnode()).filtertype, blur_radius.x); + weights.bind_as_texture(shader, "weights_tx"); Domain domain = compute_domain(); if (get_extend_bounds()) { - domain.size.x += int(math::ceil(compute_blur_radius().x)) * 2; + domain.size.x += int(math::ceil(blur_radius.x)) * 2; } /* We allocate an output image of a transposed size, that is, with a height equivalent to the @@ -367,7 +186,7 @@ class BlurOperation : public NodeOperation { GPU_shader_unbind(); input_image.unbind_as_texture(); - blur_horizontal_weights_.unbind_as_texture(); + weights.unbind_as_texture(); GPU_texture_image_unbind(horizontal_pass_result); return horizontal_pass_result; @@ -386,8 +205,12 @@ class BlurOperation : public NodeOperation { const int texture_image_unit = GPU_shader_get_texture_binding(shader, "input_tx"); GPU_texture_bind(horizontal_pass_result, texture_image_unit); - blur_vertical_weights_.update(compute_blur_radius().y, node_storage(bnode()).filtertype); - blur_vertical_weights_.bind_as_texture(shader, "weights_tx"); + const float2 blur_radius = compute_blur_radius(); + + const SymmetricSeparableBlurWeights &weights = + context().cache_manager().get_symmetric_separable_blur_weights( + node_storage(bnode()).filtertype, blur_radius.y); + weights.bind_as_texture(shader, "weights_tx"); Domain domain = compute_domain(); if (get_extend_bounds()) { @@ -405,7 +228,7 @@ class BlurOperation : public NodeOperation { GPU_shader_unbind(); output_image.unbind_as_image(); - blur_vertical_weights_.unbind_as_texture(); + weights.unbind_as_texture(); GPU_texture_unbind(horizontal_pass_result); } @@ -501,7 +324,7 @@ void register_node_type_cmp_blur() ntype.declare = file_ns::cmp_node_blur_declare; ntype.draw_buttons = file_ns::node_composit_buts_blur; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_blur); + ntype.initfunc = file_ns::node_composit_init_blur; node_type_storage( &ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_bokehblur.cc b/source/blender/nodes/composite/nodes/node_composite_bokehblur.cc index a581d87a463..f09bf1f5afd 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bokehblur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_bokehblur.cc @@ -215,7 +215,7 @@ void register_node_type_cmp_bokehblur() cmp_node_type_base(&ntype, CMP_NODE_BOKEHBLUR, "Bokeh Blur", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_bokehblur_declare; ntype.draw_buttons = file_ns::node_composit_buts_bokehblur; - node_type_init(&ntype, file_ns::node_composit_init_bokehblur); + ntype.initfunc = file_ns::node_composit_init_bokehblur; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc b/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc index eb35b933d1b..8b817d3a677 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc +++ b/source/blender/nodes/composite/nodes/node_composite_bokehimage.cc @@ -122,7 +122,7 @@ void register_node_type_cmp_bokehimage() ntype.declare = file_ns::cmp_node_bokehimage_declare; ntype.draw_buttons = file_ns::node_composit_buts_bokehimage; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_bokehimage); + ntype.initfunc = file_ns::node_composit_init_bokehimage; node_type_storage( &ntype, "NodeBokehImage", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_boxmask.cc b/source/blender/nodes/composite/nodes/node_composite_boxmask.cc index 668dc9d92de..17b5d64de91 100644 --- a/source/blender/nodes/composite/nodes/node_composite_boxmask.cc +++ b/source/blender/nodes/composite/nodes/node_composite_boxmask.cc @@ -157,7 +157,7 @@ void register_node_type_cmp_boxmask() cmp_node_type_base(&ntype, CMP_NODE_MASK_BOX, "Box Mask", NODE_CLASS_MATTE); ntype.declare = file_ns::cmp_node_boxmask_declare; ntype.draw_buttons = file_ns::node_composit_buts_boxmask; - node_type_init(&ntype, file_ns::node_composit_init_boxmask); + ntype.initfunc = file_ns::node_composit_init_boxmask; node_type_storage(&ntype, "NodeBoxMask", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_brightness.cc b/source/blender/nodes/composite/nodes/node_composite_brightness.cc index 6b9fef75524..08794914e91 100644 --- a/source/blender/nodes/composite/nodes/node_composite_brightness.cc +++ b/source/blender/nodes/composite/nodes/node_composite_brightness.cc @@ -81,7 +81,7 @@ void register_node_type_cmp_brightcontrast() cmp_node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::cmp_node_brightcontrast_declare; ntype.draw_buttons = file_ns::node_composit_buts_brightcontrast; - node_type_init(&ntype, file_ns::node_composit_init_brightcontrast); + ntype.initfunc = file_ns::node_composit_init_brightcontrast; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc b/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc index 2fd2d6c8f71..be02f1ecd00 100644 --- a/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_channel_matte.cc @@ -182,7 +182,7 @@ void register_node_type_cmp_channel_matte() ntype.declare = file_ns::cmp_node_channel_matte_declare; ntype.draw_buttons = file_ns::node_composit_buts_channel_matte; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_channel_matte); + ntype.initfunc = file_ns::node_composit_init_channel_matte; node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc index e2ef96ea95e..4e035fcf5e0 100644 --- a/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_chroma_matte.cc @@ -121,7 +121,7 @@ void register_node_type_cmp_chroma_matte() ntype.declare = file_ns::cmp_node_chroma_matte_declare; ntype.draw_buttons = file_ns::node_composit_buts_chroma_matte; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_chroma_matte); + ntype.initfunc = file_ns::node_composit_init_chroma_matte; node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_color_matte.cc b/source/blender/nodes/composite/nodes/node_composite_color_matte.cc index 2a20a4d995f..9233f61205d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_color_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_color_matte.cc @@ -119,7 +119,7 @@ void register_node_type_cmp_color_matte() ntype.declare = file_ns::cmp_node_color_matte_declare; ntype.draw_buttons = file_ns::node_composit_buts_color_matte; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_color_matte); + ntype.initfunc = file_ns::node_composit_init_color_matte; node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc index ba829da83ed..cd129d53d6b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_color_spill.cc +++ b/source/blender/nodes/composite/nodes/node_composite_color_spill.cc @@ -196,7 +196,7 @@ void register_node_type_cmp_color_spill() cmp_node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE); ntype.declare = file_ns::cmp_node_color_spill_declare; ntype.draw_buttons = file_ns::node_composit_buts_color_spill; - node_type_init(&ntype, file_ns::node_composit_init_color_spill); + ntype.initfunc = file_ns::node_composit_init_color_spill; node_type_storage( &ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc index 3300896bfdf..aade1b639ab 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc +++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc @@ -210,7 +210,7 @@ void register_node_type_cmp_colorbalance() ntype.draw_buttons = file_ns::node_composit_buts_colorbalance; ntype.draw_buttons_ex = file_ns::node_composit_buts_colorbalance_ex; node_type_size(&ntype, 400, 200, 400); - node_type_init(&ntype, file_ns::node_composit_init_colorbalance); + ntype.initfunc = file_ns::node_composit_init_colorbalance; node_type_storage( &ntype, "NodeColorBalance", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc index c6051a42df6..5ff190ac2e4 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc +++ b/source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc @@ -353,7 +353,7 @@ void register_node_type_cmp_colorcorrection() ntype.draw_buttons = file_ns::node_composit_buts_colorcorrection; ntype.draw_buttons_ex = file_ns::node_composit_buts_colorcorrection_ex; node_type_size(&ntype, 400, 200, 600); - node_type_init(&ntype, file_ns::node_composit_init_colorcorrection); + ntype.initfunc = file_ns::node_composit_init_colorcorrection; node_type_storage( &ntype, "NodeColorCorrection", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_common.cc b/source/blender/nodes/composite/nodes/node_composite_common.cc index 8dd88d098c4..cd119684a79 100644 --- a/source/blender/nodes/composite/nodes/node_composite_common.cc +++ b/source/blender/nodes/composite/nodes/node_composite_common.cc @@ -32,7 +32,7 @@ void register_node_type_cmp_group() node_type_size(&ntype, 140, 60, 400); ntype.labelfunc = node_group_label; - node_type_group_update(&ntype, node_group_update); + ntype.group_update_func = node_group_update; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/composite/nodes/node_composite_convert_color_space.cc b/source/blender/nodes/composite/nodes/node_composite_convert_color_space.cc index 3e521144b8d..24928acedd9 100644 --- a/source/blender/nodes/composite/nodes/node_composite_convert_color_space.cc +++ b/source/blender/nodes/composite/nodes/node_composite_convert_color_space.cc @@ -78,7 +78,7 @@ void register_node_type_cmp_convert_color_space(void) ntype.declare = file_ns::CMP_NODE_CONVERT_COLOR_SPACE_declare; ntype.draw_buttons = file_ns::node_composit_buts_convert_colorspace; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_composit_init_convert_colorspace); + ntype.initfunc = file_ns::node_composit_init_convert_colorspace; node_type_storage( &ntype, "NodeConvertColorSpace", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_crop.cc b/source/blender/nodes/composite/nodes/node_composite_crop.cc index 96a5443921b..4539d2af92d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_crop.cc +++ b/source/blender/nodes/composite/nodes/node_composite_crop.cc @@ -230,7 +230,7 @@ void register_node_type_cmp_crop() cmp_node_type_base(&ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT); ntype.declare = file_ns::cmp_node_crop_declare; ntype.draw_buttons = file_ns::node_composit_buts_crop; - node_type_init(&ntype, file_ns::node_composit_init_crop); + ntype.initfunc = file_ns::node_composit_init_crop; node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc index fa3b14ae015..e95a306976c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc @@ -331,7 +331,7 @@ void register_node_type_cmp_cryptomatte() node_type_socket_templates( &ntype, file_ns::cmp_node_cryptomatte_in, file_ns::cmp_node_cryptomatte_out); node_type_size(&ntype, 240, 100, 700); - node_type_init(&ntype, file_ns::node_init_cryptomatte); + ntype.initfunc = file_ns::node_init_cryptomatte; ntype.initfunc_api = file_ns::node_init_api_cryptomatte; ntype.poll = file_ns::node_poll_cryptomatte; node_type_storage( @@ -418,7 +418,7 @@ void register_node_type_cmp_cryptomatte_legacy() cmp_node_type_base( &ntype, CMP_NODE_CRYPTOMATTE_LEGACY, "Cryptomatte (Legacy)", NODE_CLASS_MATTE); node_type_socket_templates(&ntype, nullptr, file_ns::cmp_node_cryptomatte_out); - node_type_init(&ntype, legacy_file_ns::node_init_cryptomatte_legacy); + ntype.initfunc = legacy_file_ns::node_init_cryptomatte_legacy; node_type_storage( &ntype, "NodeCryptomatte", file_ns::node_free_cryptomatte, file_ns::node_copy_cryptomatte); ntype.gather_link_search_ops = nullptr; diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.cc b/source/blender/nodes/composite/nodes/node_composite_curves.cc index b631f75e879..5799c6c1a09 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.cc +++ b/source/blender/nodes/composite/nodes/node_composite_curves.cc @@ -100,7 +100,7 @@ void register_node_type_cmp_curve_time() cmp_node_type_base(&ntype, CMP_NODE_TIME, "Time Curve", NODE_CLASS_INPUT); ntype.declare = file_ns::cmp_node_time_declare; node_type_size(&ntype, 200, 140, 320); - node_type_init(&ntype, file_ns::node_composit_init_curves_time); + ntype.initfunc = file_ns::node_composit_init_curves_time; node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); ntype.get_compositor_operation = file_ns::get_compositor_operation; @@ -195,7 +195,7 @@ void register_node_type_cmp_curve_vec() ntype.declare = file_ns::cmp_node_curve_vec_declare; ntype.draw_buttons = file_ns::node_buts_curvevec; node_type_size(&ntype, 200, 140, 320); - node_type_init(&ntype, file_ns::node_composit_init_curve_vec); + ntype.initfunc = file_ns::node_composit_init_curve_vec; node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; @@ -332,7 +332,7 @@ void register_node_type_cmp_curve_rgb() cmp_node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::cmp_node_rgbcurves_declare; node_type_size(&ntype, 200, 140, 320); - node_type_init(&ntype, file_ns::node_composit_init_curve_rgb); + ntype.initfunc = file_ns::node_composit_init_curve_rgb; node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.cc b/source/blender/nodes/composite/nodes/node_composite_defocus.cc index 197e02bebad..584cca87740 100644 --- a/source/blender/nodes/composite/nodes/node_composite_defocus.cc +++ b/source/blender/nodes/composite/nodes/node_composite_defocus.cc @@ -111,7 +111,7 @@ void register_node_type_cmp_defocus() cmp_node_type_base(&ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_defocus_declare; ntype.draw_buttons = file_ns::node_composit_buts_defocus; - node_type_init(&ntype, file_ns::node_composit_init_defocus); + ntype.initfunc = file_ns::node_composit_init_defocus; node_type_storage(&ntype, "NodeDefocus", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_denoise.cc b/source/blender/nodes/composite/nodes/node_composite_denoise.cc index 821b3c23a7b..9ae02dab505 100644 --- a/source/blender/nodes/composite/nodes/node_composite_denoise.cc +++ b/source/blender/nodes/composite/nodes/node_composite_denoise.cc @@ -82,7 +82,7 @@ void register_node_type_cmp_denoise() cmp_node_type_base(&ntype, CMP_NODE_DENOISE, "Denoise", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_denoise_declare; ntype.draw_buttons = file_ns::node_composit_buts_denoise; - node_type_init(&ntype, file_ns::node_composit_init_denonise); + ntype.initfunc = file_ns::node_composit_init_denonise; node_type_storage(&ntype, "NodeDenoise", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_despeckle.cc b/source/blender/nodes/composite/nodes/node_composite_despeckle.cc index 1e15f9709fe..28ef022459b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_despeckle.cc +++ b/source/blender/nodes/composite/nodes/node_composite_despeckle.cc @@ -115,7 +115,7 @@ void register_node_type_cmp_despeckle() ntype.declare = file_ns::cmp_node_despeckle_declare; ntype.draw_buttons = file_ns::node_composit_buts_despeckle; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_despeckle); + ntype.initfunc = file_ns::node_composit_init_despeckle; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc b/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc index cde537f7d4c..c3fb0885c4d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_diff_matte.cc @@ -101,7 +101,7 @@ void register_node_type_cmp_diff_matte() ntype.declare = file_ns::cmp_node_diff_matte_declare; ntype.draw_buttons = file_ns::node_composit_buts_diff_matte; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_diff_matte); + ntype.initfunc = file_ns::node_composit_init_diff_matte; node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.cc b/source/blender/nodes/composite/nodes/node_composite_dilate.cc index d659c46721d..cc4e09d4d0d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_dilate.cc +++ b/source/blender/nodes/composite/nodes/node_composite_dilate.cc @@ -5,25 +5,20 @@ * \ingroup cmpnodes */ -#include <cmath> - -#include "BLI_array.hh" #include "BLI_assert.h" #include "BLI_math_base.hh" - -#include "DNA_scene_types.h" +#include "BLI_math_vec_types.hh" #include "RNA_access.h" #include "UI_interface.h" #include "UI_resources.h" -#include "RE_pipeline.h" - #include "GPU_shader.h" #include "GPU_state.h" #include "GPU_texture.h" +#include "COM_morphological_distance_feather_weights.hh" #include "COM_node_operation.hh" #include "COM_utilities.hh" @@ -64,161 +59,7 @@ static void node_composit_buts_dilateerode(uiLayout *layout, bContext * /*C*/, P using namespace blender::realtime_compositor; -/* Computes a falloff that is equal to 1 at an input of zero and decrease to zero at an input of 1, - * with the rate of decrease depending on the falloff type. */ -static float compute_distance_falloff(float x, int falloff_type) -{ - x = 1.0f - x; - - switch (falloff_type) { - case PROP_SMOOTH: - return 3.0f * x * x - 2.0f * x * x * x; - case PROP_SPHERE: - return std::sqrt(2.0f * x - x * x); - case PROP_ROOT: - return std::sqrt(x); - case PROP_SHARP: - return x * x; - case PROP_INVSQUARE: - return x * (2.0f - x); - case PROP_LIN: - return x; - default: - BLI_assert_unreachable(); - return x; - } -} - -/* A helper class that computes and caches 1D GPU textures containing the weights of the separable - * Gaussian filter of the given radius as well as an inverse distance falloff of the given type and - * radius. The weights and falloffs are symmetric, because the Gaussian and falloff functions are - * all even functions. Consequently, only the positive half of the filter is computed and the - * shader takes that into consideration. */ -class SymmetricSeparableMorphologicalDistanceFeatherWeights { - private: - int radius_ = 1; - int falloff_type_ = PROP_SMOOTH; - GPUTexture *weights_texture_ = nullptr; - GPUTexture *distance_falloffs_texture_ = nullptr; - - public: - ~SymmetricSeparableMorphologicalDistanceFeatherWeights() - { - if (weights_texture_) { - GPU_texture_free(weights_texture_); - } - - if (distance_falloffs_texture_) { - GPU_texture_free(distance_falloffs_texture_); - } - } - - /* Check if textures containing the weights and distance falloffs were already computed for the - * given distance falloff type and radius. If such textures exists, do nothing, otherwise, free - * the already computed textures and recompute it with the given distance falloff type and - * radius. */ - void update(int radius, int falloff_type) - { - if (weights_texture_ && distance_falloffs_texture_ && falloff_type == falloff_type_ && - radius == radius_) { - return; - } - - radius_ = radius; - falloff_type_ = falloff_type; - - compute_weights(); - compute_distance_falloffs(); - } - - void compute_weights() - { - if (weights_texture_) { - GPU_texture_free(weights_texture_); - } - - /* The size of filter is double the radius plus 1, but since the filter is symmetric, we only - * compute half of it and no doubling happens. We add 1 to make sure the filter size is always - * odd and there is a center weight. */ - const int size = radius_ + 1; - Array<float> weights(size); - - float sum = 0.0f; - - /* First, compute the center weight. */ - const float center_weight = RE_filter_value(R_FILTER_GAUSS, 0.0f); - weights[0] = center_weight; - sum += center_weight; - - /* Second, compute the other weights in the positive direction, making sure to add double the - * weight to the sum of weights because the filter is symmetric and we only loop over half of - * it. Skip the center weight already computed by dropping the front index. */ - const float scale = radius_ > 0.0f ? 1.0f / radius_ : 0.0f; - for (const int i : weights.index_range().drop_front(1)) { - const float weight = RE_filter_value(R_FILTER_GAUSS, i * scale); - weights[i] = weight; - sum += weight * 2.0f; - } - - /* Finally, normalize the weights. */ - for (const int i : weights.index_range()) { - weights[i] /= sum; - } - - weights_texture_ = GPU_texture_create_1d("Weights", size, 1, GPU_R16F, weights.data()); - } - - void compute_distance_falloffs() - { - if (distance_falloffs_texture_) { - GPU_texture_free(distance_falloffs_texture_); - } - - /* The size of the distance falloffs is double the radius plus 1, but since the falloffs are - * symmetric, we only compute half of them and no doubling happens. We add 1 to make sure the - * falloffs size is always odd and there is a center falloff. */ - const int size = radius_ + 1; - Array<float> falloffs(size); - - /* Compute the distance falloffs in the positive direction only, because the falloffs are - * symmetric. */ - const float scale = radius_ > 0.0f ? 1.0f / radius_ : 0.0f; - for (const int i : falloffs.index_range()) { - falloffs[i] = compute_distance_falloff(i * scale, falloff_type_); - } - - distance_falloffs_texture_ = GPU_texture_create_1d( - "Distance Factors", size, 1, GPU_R16F, falloffs.data()); - } - - void bind_weights_as_texture(GPUShader *shader, const char *texture_name) - { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); - GPU_texture_bind(weights_texture_, texture_image_unit); - } - - void unbind_weights_as_texture() - { - GPU_texture_unbind(weights_texture_); - } - - void bind_distance_falloffs_as_texture(GPUShader *shader, const char *texture_name) - { - const int texture_image_unit = GPU_shader_get_texture_binding(shader, texture_name); - GPU_texture_bind(distance_falloffs_texture_, texture_image_unit); - } - - void unbind_distance_falloffs_as_texture() - { - GPU_texture_unbind(distance_falloffs_texture_); - } -}; - class DilateErodeOperation : public NodeOperation { - private: - /* Cached symmetric blur weights and distance falloffs for the distance feature method. */ - SymmetricSeparableMorphologicalDistanceFeatherWeights distance_feather_weights_; - public: using NodeOperation::NodeOperation; @@ -414,9 +255,11 @@ class DilateErodeOperation : public NodeOperation { const Result &input_image = get_input("Mask"); input_image.bind_as_texture(shader, "input_tx"); - distance_feather_weights_.update(math::abs(get_distance()), node_storage(bnode()).falloff); - distance_feather_weights_.bind_weights_as_texture(shader, "weights_tx"); - distance_feather_weights_.bind_distance_falloffs_as_texture(shader, "falloffs_tx"); + const MorphologicalDistanceFeatherWeights &weights = + context().cache_manager().get_morphological_distance_feather_weights( + node_storage(bnode()).falloff, math::abs(get_distance())); + weights.bind_weights_as_texture(shader, "weights_tx"); + weights.bind_distance_falloffs_as_texture(shader, "falloffs_tx"); /* We allocate an output image of a transposed size, that is, with a height equivalent to the * width of the input and vice versa. This is done as a performance optimization. The shader @@ -437,8 +280,8 @@ class DilateErodeOperation : public NodeOperation { GPU_shader_unbind(); input_image.unbind_as_texture(); - distance_feather_weights_.unbind_weights_as_texture(); - distance_feather_weights_.unbind_distance_falloffs_as_texture(); + weights.unbind_weights_as_texture(); + weights.unbind_distance_falloffs_as_texture(); GPU_texture_image_unbind(horizontal_pass_result); return horizontal_pass_result; @@ -453,9 +296,11 @@ class DilateErodeOperation : public NodeOperation { const int texture_image_unit = GPU_shader_get_texture_binding(shader, "input_tx"); GPU_texture_bind(horizontal_pass_result, texture_image_unit); - distance_feather_weights_.update(math::abs(get_distance()), node_storage(bnode()).falloff); - distance_feather_weights_.bind_weights_as_texture(shader, "weights_tx"); - distance_feather_weights_.bind_distance_falloffs_as_texture(shader, "falloffs_tx"); + const MorphologicalDistanceFeatherWeights &weights = + context().cache_manager().get_morphological_distance_feather_weights( + node_storage(bnode()).falloff, math::abs(get_distance())); + weights.bind_weights_as_texture(shader, "weights_tx"); + weights.bind_distance_falloffs_as_texture(shader, "falloffs_tx"); const Domain domain = compute_domain(); Result &output_image = get_result("Mask"); @@ -468,8 +313,8 @@ class DilateErodeOperation : public NodeOperation { GPU_shader_unbind(); output_image.unbind_as_image(); - distance_feather_weights_.unbind_weights_as_texture(); - distance_feather_weights_.unbind_distance_falloffs_as_texture(); + weights.unbind_weights_as_texture(); + weights.unbind_distance_falloffs_as_texture(); GPU_texture_unbind(horizontal_pass_result); } @@ -535,7 +380,7 @@ void register_node_type_cmp_dilateerode() cmp_node_type_base(&ntype, CMP_NODE_DILATEERODE, "Dilate/Erode", NODE_CLASS_OP_FILTER); ntype.draw_buttons = file_ns::node_composit_buts_dilateerode; ntype.declare = file_ns::cmp_node_dilate_declare; - node_type_init(&ntype, file_ns::node_composit_init_dilateerode); + ntype.initfunc = file_ns::node_composit_init_dilateerode; node_type_storage( &ntype, "NodeDilateErode", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc b/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc index a5a253c2cca..452c83ef1b5 100644 --- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.cc @@ -199,7 +199,7 @@ void register_node_type_cmp_dblur() cmp_node_type_base(&ntype, CMP_NODE_DBLUR, "Directional Blur", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_directional_blur_declare; ntype.draw_buttons = file_ns::node_composit_buts_dblur; - node_type_init(&ntype, file_ns::node_composit_init_dblur); + ntype.initfunc = file_ns::node_composit_init_dblur; node_type_storage( &ntype, "NodeDBlurData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc b/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc index 87b66810fe3..16f79f4e730 100644 --- a/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_distance_matte.cc @@ -123,7 +123,7 @@ void register_node_type_cmp_distance_matte() ntype.declare = file_ns::cmp_node_distance_matte_declare; ntype.draw_buttons = file_ns::node_composit_buts_distance_matte; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_distance_matte); + ntype.initfunc = file_ns::node_composit_init_distance_matte; node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc b/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc index 120b4d0d976..f06b64f10b5 100644 --- a/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc +++ b/source/blender/nodes/composite/nodes/node_composite_ellipsemask.cc @@ -156,7 +156,7 @@ void register_node_type_cmp_ellipsemask() ntype.declare = file_ns::cmp_node_ellipsemask_declare; ntype.draw_buttons = file_ns::node_composit_buts_ellipsemask; node_type_size(&ntype, 260, 110, 320); - node_type_init(&ntype, file_ns::node_composit_init_ellipsemask); + ntype.initfunc = file_ns::node_composit_init_ellipsemask; node_type_storage( &ntype, "NodeEllipseMask", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.cc b/source/blender/nodes/composite/nodes/node_composite_glare.cc index 60d149a32b9..4352f519e4c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_glare.cc +++ b/source/blender/nodes/composite/nodes/node_composite_glare.cc @@ -105,7 +105,7 @@ void register_node_type_cmp_glare() cmp_node_type_base(&ntype, CMP_NODE_GLARE, "Glare", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_glare_declare; ntype.draw_buttons = file_ns::node_composit_buts_glare; - node_type_init(&ntype, file_ns::node_composit_init_glare); + ntype.initfunc = file_ns::node_composit_init_glare; node_type_storage(&ntype, "NodeGlare", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc b/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc index a365929138c..2e09e44eddc 100644 --- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc +++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.cc @@ -106,7 +106,7 @@ void register_node_type_cmp_huecorrect() cmp_node_type_base(&ntype, CMP_NODE_HUECORRECT, "Hue Correct", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::cmp_node_huecorrect_declare; node_type_size(&ntype, 320, 140, 500); - node_type_init(&ntype, file_ns::node_composit_init_huecorrect); + ntype.initfunc = file_ns::node_composit_init_huecorrect; node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_image.cc b/source/blender/nodes/composite/nodes/node_composite_image.cc index 9efedf744ec..322f1eecf91 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.cc +++ b/source/blender/nodes/composite/nodes/node_composite_image.cc @@ -660,10 +660,10 @@ void register_node_type_cmp_image() static bNodeType ntype; cmp_node_type_base(&ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT); - node_type_init(&ntype, file_ns::node_composit_init_image); + ntype.initfunc = file_ns::node_composit_init_image; node_type_storage( &ntype, "ImageUser", file_ns::node_composit_free_image, file_ns::node_composit_copy_image); - node_type_update(&ntype, file_ns::cmp_node_image_update); + ntype.updatefunc = file_ns::cmp_node_image_update; ntype.get_compositor_operation = file_ns::get_compositor_operation; ntype.labelfunc = node_image_label; ntype.flag |= NODE_PREVIEW; @@ -879,8 +879,8 @@ void register_node_type_cmp_rlayers() ntype.flag |= NODE_PREVIEW; node_type_storage( &ntype, nullptr, file_ns::node_composit_free_rlayers, file_ns::node_composit_copy_rlayers); - node_type_update(&ntype, file_ns::cmp_node_rlayers_update); - node_type_init(&ntype, node_cmp_rlayers_outputs); + ntype.updatefunc = file_ns::cmp_node_rlayers_update; + ntype.initfunc = node_cmp_rlayers_outputs; node_type_size_preset(&ntype, NODE_SIZE_LARGE); nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.cc b/source/blender/nodes/composite/nodes/node_composite_invert.cc index bbb2808c4ea..c8787ebb01b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_invert.cc +++ b/source/blender/nodes/composite/nodes/node_composite_invert.cc @@ -96,7 +96,7 @@ void register_node_type_cmp_invert() cmp_node_type_base(&ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::cmp_node_invert_declare; ntype.draw_buttons = file_ns::node_composit_buts_invert; - node_type_init(&ntype, file_ns::node_composit_init_invert); + ntype.initfunc = file_ns::node_composit_init_invert; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_keying.cc b/source/blender/nodes/composite/nodes/node_composite_keying.cc index 4b61e06a232..b2add06c541 100644 --- a/source/blender/nodes/composite/nodes/node_composite_keying.cc +++ b/source/blender/nodes/composite/nodes/node_composite_keying.cc @@ -95,7 +95,7 @@ void register_node_type_cmp_keying() cmp_node_type_base(&ntype, CMP_NODE_KEYING, "Keying", NODE_CLASS_MATTE); ntype.declare = file_ns::cmp_node_keying_declare; ntype.draw_buttons = file_ns::node_composit_buts_keying; - node_type_init(&ntype, file_ns::node_composit_init_keying); + ntype.initfunc = file_ns::node_composit_init_keying; node_type_storage( &ntype, "NodeKeyingData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_lensdist.cc b/source/blender/nodes/composite/nodes/node_composite_lensdist.cc index 1cf482ff6ff..e11ed0fbfb6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_lensdist.cc +++ b/source/blender/nodes/composite/nodes/node_composite_lensdist.cc @@ -250,7 +250,7 @@ void register_node_type_cmp_lensdist() cmp_node_type_base(&ntype, CMP_NODE_LENSDIST, "Lens Distortion", NODE_CLASS_DISTORT); ntype.declare = file_ns::cmp_node_lensdist_declare; ntype.draw_buttons = file_ns::node_composit_buts_lensdist; - node_type_init(&ntype, file_ns::node_composit_init_lensdist); + ntype.initfunc = file_ns::node_composit_init_lensdist; node_type_storage( &ntype, "NodeLensDist", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.cc b/source/blender/nodes/composite/nodes/node_composite_levels.cc index 4c901372b9f..29212c7a76f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_levels.cc +++ b/source/blender/nodes/composite/nodes/node_composite_levels.cc @@ -201,7 +201,7 @@ void register_node_type_cmp_view_levels() ntype.declare = file_ns::cmp_node_levels_declare; ntype.draw_buttons = file_ns::node_composit_buts_view_levels; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_view_levels); + ntype.initfunc = file_ns::node_composit_init_view_levels; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_luma_matte.cc b/source/blender/nodes/composite/nodes/node_composite_luma_matte.cc index 8426efb0f1f..325f5dbd870 100644 --- a/source/blender/nodes/composite/nodes/node_composite_luma_matte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_luma_matte.cc @@ -104,7 +104,7 @@ void register_node_type_cmp_luma_matte() ntype.declare = file_ns::cmp_node_luma_matte_declare; ntype.draw_buttons = file_ns::node_composit_buts_luma_matte; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_luma_matte); + ntype.initfunc = file_ns::node_composit_init_luma_matte; node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_map_value.cc b/source/blender/nodes/composite/nodes/node_composite_map_value.cc index eacc003378a..ea80e7b03a8 100644 --- a/source/blender/nodes/composite/nodes/node_composite_map_value.cc +++ b/source/blender/nodes/composite/nodes/node_composite_map_value.cc @@ -116,7 +116,7 @@ void register_node_type_cmp_map_value() cmp_node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::cmp_node_map_value_declare; ntype.draw_buttons = file_ns::node_composit_buts_map_value; - node_type_init(&ntype, file_ns::node_composit_init_map_value); + ntype.initfunc = file_ns::node_composit_init_map_value; node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_mask.cc b/source/blender/nodes/composite/nodes/node_composite_mask.cc index 5dfcc9a9ecf..895ef62a82d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mask.cc +++ b/source/blender/nodes/composite/nodes/node_composite_mask.cc @@ -104,7 +104,7 @@ void register_node_type_cmp_mask() cmp_node_type_base(&ntype, CMP_NODE_MASK, "Mask", NODE_CLASS_INPUT); ntype.declare = file_ns::cmp_node_mask_declare; ntype.draw_buttons = file_ns::node_composit_buts_mask; - node_type_init(&ntype, file_ns::node_composit_init_mask); + ntype.initfunc = file_ns::node_composit_init_mask; ntype.labelfunc = file_ns::node_mask_label; ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_math.cc b/source/blender/nodes/composite/nodes/node_composite_math.cc index 4baf057913e..e1dda06a41e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_math.cc +++ b/source/blender/nodes/composite/nodes/node_composite_math.cc @@ -96,7 +96,7 @@ void register_node_type_cmp_math() cmp_node_type_base(&ntype, CMP_NODE_MATH, "Math", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_math_declare; ntype.labelfunc = node_math_label; - node_type_update(&ntype, node_math_update); + ntype.updatefunc = node_math_update; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_output_file.cc b/source/blender/nodes/composite/nodes/node_composite_output_file.cc index f27dec91b1c..f64e448842d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_output_file.cc +++ b/source/blender/nodes/composite/nodes/node_composite_output_file.cc @@ -470,7 +470,7 @@ void register_node_type_cmp_output_file() ntype.flag |= NODE_PREVIEW; node_type_storage( &ntype, "NodeImageMultiFile", file_ns::free_output_file, file_ns::copy_output_file); - node_type_update(&ntype, file_ns::update_output_file); + ntype.updatefunc = file_ns::update_output_file; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.cc b/source/blender/nodes/composite/nodes/node_composite_rotate.cc index 5f3df3abd35..4cc1166b373 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rotate.cc +++ b/source/blender/nodes/composite/nodes/node_composite_rotate.cc @@ -95,7 +95,7 @@ void register_node_type_cmp_rotate() cmp_node_type_base(&ntype, CMP_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT); ntype.declare = file_ns::cmp_node_rotate_declare; ntype.draw_buttons = file_ns::node_composit_buts_rotate; - node_type_init(&ntype, file_ns::node_composit_init_rotate); + ntype.initfunc = file_ns::node_composit_init_rotate; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_scale.cc b/source/blender/nodes/composite/nodes/node_composite_scale.cc index c524d7b8da9..a4e28326d9d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_scale.cc +++ b/source/blender/nodes/composite/nodes/node_composite_scale.cc @@ -221,7 +221,7 @@ void register_node_type_cmp_scale() cmp_node_type_base(&ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT); ntype.declare = file_ns::cmp_node_scale_declare; ntype.draw_buttons = file_ns::node_composit_buts_scale; - node_type_update(&ntype, file_ns::node_composite_update_scale); + ntype.updatefunc = file_ns::node_composite_update_scale; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcomb_color.cc b/source/blender/nodes/composite/nodes/node_composite_sepcomb_color.cc index d3f8530ae8b..118ab6ccdf8 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcomb_color.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sepcomb_color.cc @@ -137,10 +137,10 @@ void register_node_type_cmp_separate_color() cmp_node_type_base(&ntype, CMP_NODE_SEPARATE_COLOR, "Separate Color", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_separate_color_declare; - node_type_init(&ntype, node_cmp_combsep_color_init); + ntype.initfunc = node_cmp_combsep_color_init; node_type_storage( &ntype, "NodeCMPCombSepColor", node_free_standard_storage, node_copy_standard_storage); - node_type_update(&ntype, file_ns::cmp_node_separate_color_update); + ntype.updatefunc = file_ns::cmp_node_separate_color_update; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; nodeRegisterType(&ntype); @@ -243,10 +243,10 @@ void register_node_type_cmp_combine_color() cmp_node_type_base(&ntype, CMP_NODE_COMBINE_COLOR, "Combine Color", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_combine_color_declare; - node_type_init(&ntype, node_cmp_combsep_color_init); + ntype.initfunc = node_cmp_combsep_color_init; node_type_storage( &ntype, "NodeCMPCombSepColor", node_free_standard_storage, node_copy_standard_storage); - node_type_update(&ntype, file_ns::cmp_node_combine_color_update); + ntype.updatefunc = file_ns::cmp_node_combine_color_update; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc b/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc index 82fc37a18f6..7c1461b4f6e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sepcomb_ycca.cc @@ -84,7 +84,7 @@ void register_node_type_cmp_sepycca() cmp_node_type_base( &ntype, CMP_NODE_SEPYCCA_LEGACY, "Separate YCbCrA (Legacy)", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_sepycca_declare; - node_type_init(&ntype, file_ns::node_composit_init_mode_sepycca); + ntype.initfunc = file_ns::node_composit_init_mode_sepycca; ntype.gather_link_search_ops = nullptr; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; @@ -172,7 +172,7 @@ void register_node_type_cmp_combycca() cmp_node_type_base( &ntype, CMP_NODE_COMBYCCA_LEGACY, "Combine YCbCrA (Legacy)", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_combycca_declare; - node_type_init(&ntype, file_ns::node_composit_init_mode_combycca); + ntype.initfunc = file_ns::node_composit_init_mode_combycca; ntype.gather_link_search_ops = nullptr; ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_setalpha.cc b/source/blender/nodes/composite/nodes/node_composite_setalpha.cc index 725ae6e3fcb..99c4dae4a92 100644 --- a/source/blender/nodes/composite/nodes/node_composite_setalpha.cc +++ b/source/blender/nodes/composite/nodes/node_composite_setalpha.cc @@ -81,7 +81,7 @@ void register_node_type_cmp_setalpha() cmp_node_type_base(&ntype, CMP_NODE_SETALPHA, "Set Alpha", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_setalpha_declare; ntype.draw_buttons = file_ns::node_composit_buts_set_alpha; - node_type_init(&ntype, file_ns::node_composit_init_setalpha); + ntype.initfunc = file_ns::node_composit_init_setalpha; node_type_storage( &ntype, "NodeSetAlpha", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc b/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc index f25d33033a2..b4e698f5096 100644 --- a/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc +++ b/source/blender/nodes/composite/nodes/node_composite_split_viewer.cc @@ -125,7 +125,7 @@ void register_node_type_cmp_splitviewer() ntype.declare = file_ns::cmp_node_split_viewer_declare; ntype.draw_buttons = file_ns::node_composit_buts_splitviewer; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_splitviewer); + ntype.initfunc = file_ns::node_composit_init_splitviewer; node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_sunbeams.cc b/source/blender/nodes/composite/nodes/node_composite_sunbeams.cc index d2ee9f567f2..798e60e9482 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sunbeams.cc +++ b/source/blender/nodes/composite/nodes/node_composite_sunbeams.cc @@ -68,7 +68,7 @@ void register_node_type_cmp_sunbeams() cmp_node_type_base(&ntype, CMP_NODE_SUNBEAMS, "Sun Beams", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_sunbeams_declare; ntype.draw_buttons = file_ns::node_composit_buts_sunbeams; - node_type_init(&ntype, file_ns::init); + ntype.initfunc = file_ns::init; node_type_storage( &ntype, "NodeSunBeams", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_switchview.cc b/source/blender/nodes/composite/nodes/node_composite_switchview.cc index 9b21ecab335..9974e55cc1a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_switchview.cc +++ b/source/blender/nodes/composite/nodes/node_composite_switchview.cc @@ -173,7 +173,7 @@ void register_node_type_cmp_switch_view() node_type_socket_templates(&ntype, nullptr, file_ns::cmp_node_switch_view_out); ntype.draw_buttons_ex = file_ns::node_composit_buts_switch_view_ex; ntype.initfunc_api = file_ns::init_switch_view; - node_type_update(&ntype, file_ns::cmp_node_switch_view_update); + ntype.updatefunc = file_ns::cmp_node_switch_view_update; ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.cc b/source/blender/nodes/composite/nodes/node_composite_tonemap.cc index d26a01bb3c9..febbb9ddec5 100644 --- a/source/blender/nodes/composite/nodes/node_composite_tonemap.cc +++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.cc @@ -332,7 +332,7 @@ void register_node_type_cmp_tonemap() cmp_node_type_base(&ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::cmp_node_tonemap_declare; ntype.draw_buttons = file_ns::node_composit_buts_tonemap; - node_type_init(&ntype, file_ns::node_composit_init_tonemap); + ntype.initfunc = file_ns::node_composit_init_tonemap; node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_translate.cc b/source/blender/nodes/composite/nodes/node_composite_translate.cc index c8f9f8ee666..154be2d428a 100644 --- a/source/blender/nodes/composite/nodes/node_composite_translate.cc +++ b/source/blender/nodes/composite/nodes/node_composite_translate.cc @@ -110,7 +110,7 @@ void register_node_type_cmp_translate() cmp_node_type_base(&ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT); ntype.declare = file_ns::cmp_node_translate_declare; ntype.draw_buttons = file_ns::node_composit_buts_translate; - node_type_init(&ntype, file_ns::node_composit_init_translate); + ntype.initfunc = file_ns::node_composit_init_translate; node_type_storage( &ntype, "NodeTranslateData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_val_to_rgb.cc b/source/blender/nodes/composite/nodes/node_composite_val_to_rgb.cc index 2870b07f207..d083051e9d2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_val_to_rgb.cc +++ b/source/blender/nodes/composite/nodes/node_composite_val_to_rgb.cc @@ -134,7 +134,7 @@ void register_node_type_cmp_valtorgb() cmp_node_type_base(&ntype, CMP_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTER); ntype.declare = file_ns::cmp_node_valtorgb_declare; node_type_size(&ntype, 240, 200, 320); - node_type_init(&ntype, file_ns::node_composit_init_valtorgb); + ntype.initfunc = file_ns::node_composit_init_valtorgb; node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node; diff --git a/source/blender/nodes/composite/nodes/node_composite_vec_blur.cc b/source/blender/nodes/composite/nodes/node_composite_vec_blur.cc index 6d43647020f..6a44fcb1650 100644 --- a/source/blender/nodes/composite/nodes/node_composite_vec_blur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_vec_blur.cc @@ -81,7 +81,7 @@ void register_node_type_cmp_vecblur() cmp_node_type_base(&ntype, CMP_NODE_VECBLUR, "Vector Blur", NODE_CLASS_OP_FILTER); ntype.declare = file_ns::cmp_node_vec_blur_declare; ntype.draw_buttons = file_ns::node_composit_buts_vecblur; - node_type_init(&ntype, file_ns::node_composit_init_vecblur); + ntype.initfunc = file_ns::node_composit_init_vecblur; node_type_storage( &ntype, "NodeBlurData", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.cc b/source/blender/nodes/composite/nodes/node_composite_viewer.cc index c83674fa9c1..682b0626ccd 100644 --- a/source/blender/nodes/composite/nodes/node_composite_viewer.cc +++ b/source/blender/nodes/composite/nodes/node_composite_viewer.cc @@ -196,7 +196,7 @@ void register_node_type_cmp_viewer() ntype.draw_buttons = file_ns::node_composit_buts_viewer; ntype.draw_buttons_ex = file_ns::node_composit_buts_viewer_ex; ntype.flag |= NODE_PREVIEW; - node_type_init(&ntype, file_ns::node_composit_init_viewer); + ntype.initfunc = file_ns::node_composit_init_viewer; node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); ntype.get_compositor_operation = file_ns::get_compositor_operation; diff --git a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc index 7fc7829186a..3027a81807b 100644 --- a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc +++ b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc @@ -131,7 +131,7 @@ void register_node_type_fn_boolean_math() fn_node_type_base(&ntype, FN_NODE_BOOLEAN_MATH, "Boolean Math", NODE_CLASS_CONVERTER); ntype.declare = file_ns::fn_node_boolean_math_declare; ntype.labelfunc = file_ns::node_boolean_math_label; - node_type_update(&ntype, file_ns::node_boolean_math_update); + ntype.updatefunc = file_ns::node_boolean_math_update; ntype.build_multi_function = file_ns::fn_node_boolean_math_build_multi_function; ntype.draw_buttons = file_ns::fn_node_boolean_math_layout; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; diff --git a/source/blender/nodes/function/nodes/node_fn_combine_color.cc b/source/blender/nodes/function/nodes/node_fn_combine_color.cc index fddf606dfc9..c5dd5dfff1a 100644 --- a/source/blender/nodes/function/nodes/node_fn_combine_color.cc +++ b/source/blender/nodes/function/nodes/node_fn_combine_color.cc @@ -97,8 +97,8 @@ void register_node_type_fn_combine_color(void) fn_node_type_base(&ntype, FN_NODE_COMBINE_COLOR, "Combine Color", NODE_CLASS_CONVERTER); ntype.declare = blender::nodes::fn_node_combine_color_declare; - node_type_update(&ntype, blender::nodes::fn_node_combine_color_update); - node_type_init(&ntype, blender::nodes::fn_node_combine_color_init); + ntype.updatefunc = blender::nodes::fn_node_combine_color_update; + ntype.initfunc = blender::nodes::fn_node_combine_color_init; node_type_storage( &ntype, "NodeCombSepColor", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = blender::nodes::fn_node_combine_color_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc index 4dd8d0c6ba4..c0eb3e9ffd5 100644 --- a/source/blender/nodes/function/nodes/node_fn_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_compare.cc @@ -582,8 +582,8 @@ void register_node_type_fn_compare() fn_node_type_base(&ntype, FN_NODE_COMPARE, "Compare", NODE_CLASS_CONVERTER); ntype.declare = file_ns::fn_node_compare_declare; ntype.labelfunc = file_ns::node_compare_label; - node_type_update(&ntype, file_ns::node_compare_update); - node_type_init(&ntype, file_ns::node_compare_init); + ntype.updatefunc = file_ns::node_compare_update; + ntype.initfunc = file_ns::node_compare_init; node_type_storage( &ntype, "NodeFunctionCompare", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = file_ns::fn_node_compare_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_input_bool.cc b/source/blender/nodes/function/nodes/node_fn_input_bool.cc index c68de06a91b..62e0358b0ae 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_bool.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_bool.cc @@ -43,7 +43,7 @@ void register_node_type_fn_input_bool() fn_node_type_base(&ntype, FN_NODE_INPUT_BOOL, "Boolean", 0); ntype.declare = file_ns::fn_node_input_bool_declare; - node_type_init(&ntype, file_ns::fn_node_input_bool_init); + ntype.initfunc = file_ns::fn_node_input_bool_init; node_type_storage( &ntype, "NodeInputBool", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = file_ns::fn_node_input_bool_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_input_color.cc b/source/blender/nodes/function/nodes/node_fn_input_color.cc index 9a66066189a..af4c340efe7 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_color.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_color.cc @@ -46,7 +46,7 @@ void register_node_type_fn_input_color() fn_node_type_base(&ntype, FN_NODE_INPUT_COLOR, "Color", NODE_CLASS_INPUT); ntype.declare = file_ns::fn_node_input_color_declare; - node_type_init(&ntype, file_ns::fn_node_input_color_init); + ntype.initfunc = file_ns::fn_node_input_color_init; node_type_storage( &ntype, "NodeInputColor", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = file_ns::fn_node_input_color_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_input_int.cc b/source/blender/nodes/function/nodes/node_fn_input_int.cc index 5285c242d88..c339d2a348e 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_int.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_int.cc @@ -43,7 +43,7 @@ void register_node_type_fn_input_int() fn_node_type_base(&ntype, FN_NODE_INPUT_INT, "Integer", 0); ntype.declare = file_ns::fn_node_input_int_declare; - node_type_init(&ntype, file_ns::fn_node_input_int_init); + ntype.initfunc = file_ns::fn_node_input_int_init; node_type_storage( &ntype, "NodeInputInt", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = file_ns::fn_node_input_int_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_input_string.cc b/source/blender/nodes/function/nodes/node_fn_input_string.cc index a7172d9fcf9..9da17ef9a67 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_string.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_string.cc @@ -65,7 +65,7 @@ void register_node_type_fn_input_string() fn_node_type_base(&ntype, FN_NODE_INPUT_STRING, "String", NODE_CLASS_INPUT); ntype.declare = file_ns::fn_node_input_string_declare; - node_type_init(&ntype, file_ns::fn_node_input_string_init); + ntype.initfunc = file_ns::fn_node_input_string_init; node_type_storage( &ntype, "NodeInputString", file_ns::fn_node_input_string_free, file_ns::fn_node_string_copy); ntype.build_multi_function = file_ns::fn_node_input_string_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_input_vector.cc b/source/blender/nodes/function/nodes/node_fn_input_vector.cc index 49c8a6284e0..f6feda4cad0 100644 --- a/source/blender/nodes/function/nodes/node_fn_input_vector.cc +++ b/source/blender/nodes/function/nodes/node_fn_input_vector.cc @@ -44,7 +44,7 @@ void register_node_type_fn_input_vector() fn_node_type_base(&ntype, FN_NODE_INPUT_VECTOR, "Vector", 0); ntype.declare = file_ns::fn_node_input_vector_declare; - node_type_init(&ntype, file_ns::fn_node_input_vector_init); + ntype.initfunc = file_ns::fn_node_input_vector_init; node_type_storage( &ntype, "NodeInputVector", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = file_ns::fn_node_input_vector_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_random_value.cc b/source/blender/nodes/function/nodes/node_fn_random_value.cc index 9f842e81071..c923e6e7d16 100644 --- a/source/blender/nodes/function/nodes/node_fn_random_value.cc +++ b/source/blender/nodes/function/nodes/node_fn_random_value.cc @@ -218,8 +218,8 @@ void register_node_type_fn_random_value() static bNodeType ntype; fn_node_type_base(&ntype, FN_NODE_RANDOM_VALUE, "Random Value", NODE_CLASS_CONVERTER); - node_type_init(&ntype, file_ns::fn_node_random_value_init); - node_type_update(&ntype, file_ns::fn_node_random_value_update); + ntype.initfunc = file_ns::fn_node_random_value_init; + ntype.updatefunc = file_ns::fn_node_random_value_update; ntype.draw_buttons = file_ns::fn_node_random_value_layout; ntype.declare = file_ns::fn_node_random_value_declare; ntype.build_multi_function = file_ns::fn_node_random_value_build_multi_function; diff --git a/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc b/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc index 813d0a265f7..19afadb7a33 100644 --- a/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc +++ b/source/blender/nodes/function/nodes/node_fn_rotate_euler.cc @@ -132,7 +132,7 @@ void register_node_type_fn_rotate_euler() fn_node_type_base(&ntype, FN_NODE_ROTATE_EULER, "Rotate Euler", NODE_CLASS_CONVERTER); ntype.declare = file_ns::fn_node_rotate_euler_declare; ntype.draw_buttons = file_ns::fn_node_rotate_euler_layout; - node_type_update(&ntype, file_ns::fn_node_rotate_euler_update); + ntype.updatefunc = file_ns::fn_node_rotate_euler_update; ntype.build_multi_function = file_ns::fn_node_rotate_euler_build_multi_function; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/function/nodes/node_fn_separate_color.cc b/source/blender/nodes/function/nodes/node_fn_separate_color.cc index 19753f93b5c..e3efb76d155 100644 --- a/source/blender/nodes/function/nodes/node_fn_separate_color.cc +++ b/source/blender/nodes/function/nodes/node_fn_separate_color.cc @@ -213,8 +213,8 @@ void register_node_type_fn_separate_color(void) fn_node_type_base(&ntype, FN_NODE_SEPARATE_COLOR, "Separate Color", NODE_CLASS_CONVERTER); ntype.declare = blender::nodes::fn_node_separate_color_declare; - node_type_update(&ntype, blender::nodes::fn_node_separate_color_update); - node_type_init(&ntype, blender::nodes::fn_node_separate_color_init); + ntype.updatefunc = blender::nodes::fn_node_separate_color_update; + ntype.initfunc = blender::nodes::fn_node_separate_color_init; node_type_storage( &ntype, "NodeCombSepColor", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = blender::nodes::fn_node_separate_color_build_multi_function; diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index 9af445090e9..33a58cada1b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -425,8 +425,8 @@ void register_node_type_geo_accumulate_field() geo_node_type_base(&ntype, GEO_NODE_ACCUMULATE_FIELD, "Accumulate Field", NODE_CLASS_CONVERTER); ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.draw_buttons = file_ns::node_layout; ntype.declare = file_ns::node_declare; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc index 1aea129bd53..1a0cb14f451 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_capture.cc @@ -241,8 +241,8 @@ void register_node_type_geo_attribute_capture() "NodeGeometryAttributeCapture", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc index af55ef3f7ed..d31366f9c93 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc @@ -132,7 +132,7 @@ void register_node_type_geo_attribute_domain_size() ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_layout; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.updatefunc = file_ns::node_update; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index 3023c7bd751..e381133af30 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -396,8 +396,8 @@ void register_node_type_geo_attribute_statistic() &ntype, GEO_NODE_ATTRIBUTE_STATISTIC, "Attribute Statistic", NODE_CLASS_ATTRIBUTE); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; diff --git a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc index 094aab65653..61780ee25bb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc @@ -191,7 +191,7 @@ void register_node_type_geo_boolean() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_layout; ntype.updatefunc = file_ns::node_update; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.geometry_node_execute = file_ns::node_geo_exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc b/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc index 1129e954360..6c41dbbe34c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_collection_info.cc @@ -150,7 +150,7 @@ void register_node_type_geo_collection_info() geo_node_type_base(&ntype, GEO_NODE_COLLECTION_INFO, "Collection Info", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_node_init); + ntype.initfunc = file_ns::node_node_init; node_type_storage(&ntype, "NodeGeometryCollectionInfo", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_common.cc b/source/blender/nodes/geometry/nodes/node_geo_common.cc index 531d37c3a89..90fb7e10570 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_common.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_common.cc @@ -23,7 +23,7 @@ void register_node_type_geo_group() node_type_size(&ntype, 140, 60, 400); ntype.labelfunc = node_group_label; - node_type_group_update(&ntype, node_group_update); + ntype.group_update_func = node_group_update; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc b/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc index 038309785fb..278d7c4bd24 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc @@ -87,7 +87,7 @@ static Mesh *hull_from_bullet(const Mesh *mesh, Span<float3> coords) MEdge &edge = edges[edge_index]; edge.v1 = v_from; edge.v2 = v_to; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; /* Write edge index into both loops that have it. */ int reverse_index = plConvexHullGetReversedLoopIndex(hull, i); @@ -101,7 +101,7 @@ static Mesh *hull_from_bullet(const Mesh *mesh, Span<float3> coords) MEdge &edge = edges[0]; edge.v1 = 0; edge.v2 = 1; - edge.flag |= ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE; + edge.flag |= ME_EDGEDRAW | ME_LOOSEEDGE; edge_index++; } BLI_assert(edge_index == edges_num); diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc index 6eaa40bff03..a14661b4a50 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_fill.cc @@ -90,7 +90,7 @@ static Mesh *cdt_to_mesh(const meshintersect::CDT_result<double> &result) for (const int i : IndexRange(result.edge.size())) { edges[i].v1 = result.edge[i].first; edges[i].v2 = result.edge[i].second; - edges[i].flag = ME_EDGEDRAW | ME_EDGERENDER; + edges[i].flag = ME_EDGEDRAW; } int i_loop = 0; for (const int i : IndexRange(result.face.size())) { @@ -155,7 +155,7 @@ void register_node_type_geo_curve_fill() geo_node_type_base(&ntype, GEO_NODE_FILL_CURVE, "Fill Curve", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage( &ntype, "NodeGeometryCurveFill", node_free_standard_storage, node_copy_standard_storage); ntype.declare = file_ns::node_declare; diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc index 2b24b6cbf42..7a6fa799013 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_fillet.cc @@ -121,8 +121,8 @@ void register_node_type_geo_curve_fillet() node_type_storage( &ntype, "NodeGeometryCurveFillet", node_free_standard_storage, node_copy_standard_storage); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.geometry_node_execute = file_ns::node_geo_exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc index 252f66c308f..9f0d40bb0d7 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc @@ -138,7 +138,7 @@ void register_node_type_geo_curve_handle_type_selection() &ntype, GEO_NODE_CURVE_HANDLE_TYPE_SELECTION, "Handle Type Selection", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryCurveSelectHandles", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_arc.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_arc.cc index cc32c8f5efc..e0148730710 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_arc.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_arc.cc @@ -359,8 +359,8 @@ void register_node_type_geo_curve_primitive_arc() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_CURVE_PRIMITIVE_ARC, "Arc", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage(&ntype, "NodeGeometryCurvePrimitiveArc", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc index b407ac47dc9..59c17365261 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc @@ -119,7 +119,7 @@ void register_node_type_geo_curve_primitive_bezier_segment() static bNodeType ntype; geo_node_type_base( &ntype, GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT, "Bezier Segment", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryCurvePrimitiveBezierSegment", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc index 35fdd6754cc..75f2116b237 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_circle.cc @@ -217,8 +217,8 @@ void register_node_type_geo_curve_primitive_circle() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_CURVE_PRIMITIVE_CIRCLE, "Curve Circle", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage(&ntype, "NodeGeometryCurvePrimitiveCircle", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_line.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_line.cc index 6b402a67450..d4ce1923178 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_line.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_line.cc @@ -119,8 +119,8 @@ void register_node_type_geo_curve_primitive_line() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_CURVE_PRIMITIVE_LINE, "Curve Line", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage(&ntype, "NodeGeometryCurvePrimitiveLine", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc index 44c2a078cb6..d4e37a98372 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc @@ -274,8 +274,8 @@ void register_node_type_geo_curve_primitive_quadrilateral() ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; - node_type_update(&ntype, file_ns::node_update); - node_type_init(&ntype, file_ns::node_init); + ntype.updatefunc = file_ns::node_update; + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryCurvePrimitiveQuad", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc index 8b6a7064362..23a71af448d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc @@ -123,8 +123,8 @@ void register_node_type_geo_curve_resample() ntype.draw_buttons = file_ns::node_layout; node_type_storage( &ntype, "NodeGeometryCurveResample", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.geometry_node_execute = file_ns::node_geo_exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc index 3170d0aecac..bb31d9c1a57 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc @@ -62,7 +62,7 @@ static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_curves", 0, nullptr, ICON_NONE); } -static void node_type_init(bNodeTree * /*tree*/, bNode *node) +static void node_init(bNodeTree * /*tree*/, bNode *node) { NodeGeometryCurveSample *data = MEM_cnew<NodeGeometryCurveSample>(__func__); data->mode = GEO_NODE_CURVE_SAMPLE_FACTOR; @@ -570,8 +570,8 @@ void register_node_type_geo_curve_sample() geo_node_type_base(&ntype, GEO_NODE_SAMPLE_CURVE, "Sample Curve", NODE_CLASS_GEOMETRY); ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_type_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage( &ntype, "NodeGeometryCurveSample", node_free_standard_storage, node_copy_standard_storage); ntype.draw_buttons = file_ns::node_layout; diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handle_type.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handle_type.cc index d37af6e5fe8..46377329fb4 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handle_type.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handle_type.cc @@ -120,7 +120,7 @@ void register_node_type_geo_curve_set_handle_type() &ntype, GEO_NODE_CURVE_SET_HANDLE_TYPE, "Set Handle Type", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryCurveSetHandles", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc index 9ac6516ee7b..4b8251aadd3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc @@ -87,7 +87,7 @@ void register_node_type_geo_curve_spline_type() geo_node_type_base(&ntype, GEO_NODE_CURVE_SPLINE_TYPE, "Set Spline Type", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryCurveSplineType", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc index e9eaa00b02d..268c927f782 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc @@ -216,7 +216,7 @@ void register_node_type_geo_curve_to_points() ntype.draw_buttons = file_ns::node_layout; node_type_storage( &ntype, "NodeGeometryCurveToPoints", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc index 15c89d78276..3ec71877b7c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc @@ -202,8 +202,8 @@ void register_node_type_geo_curve_trim() ntype.declare = file_ns::node_declare; node_type_storage( &ntype, "NodeGeometryCurveTrim", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc index 3e48a9fd923..8ed97f2019f 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc @@ -1202,7 +1202,7 @@ void register_node_type_geo_delete_geometry() node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_distribute_points_in_volume.cc b/source/blender/nodes/geometry/nodes/node_geo_distribute_points_in_volume.cc index 95173bd23a5..f2e66e03d26 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_distribute_points_in_volume.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_distribute_points_in_volume.cc @@ -278,8 +278,8 @@ void register_node_type_geo_distribute_points_in_volume() "NodeGeometryDistributePointsInVolume", node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, blender::nodes::node_distribute_points_in_volume_init); - node_type_update(&ntype, blender::nodes::node_distribute_points_in_volume_update); + ntype.initfunc = blender::nodes::node_distribute_points_in_volume_init; + ntype.updatefunc = blender::nodes::node_distribute_points_in_volume_update; node_type_size(&ntype, 170, 100, 320); ntype.declare = blender::nodes::geo_node_distribute_points_in_volume_declare; ntype.geometry_node_execute = blender::nodes::geo_node_distribute_points_in_volume_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc b/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc index c2cc70296ed..7c9501608a3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_distribute_points_on_faces.cc @@ -563,7 +563,7 @@ void register_node_type_geo_distribute_points_on_faces() GEO_NODE_DISTRIBUTE_POINTS_ON_FACES, "Distribute Points on Faces", NODE_CLASS_GEOMETRY); - node_type_update(&ntype, file_ns::node_point_distribute_points_on_faces_update); + ntype.updatefunc = file_ns::node_point_distribute_points_on_faces_update; node_type_size(&ntype, 170, 100, 320); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc index 486f900aca5..f048ec11f77 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc @@ -1149,7 +1149,7 @@ void register_node_type_geo_duplicate_elements() node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.draw_buttons = file_ns::node_layout; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.declare = file_ns::node_declare; diff --git a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc index 151ba3e59cc..0062abba909 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc @@ -154,7 +154,7 @@ static MEdge new_edge(const int v1, const int v2) MEdge edge; edge.v1 = v1; edge.v2 = v2; - edge.flag = (ME_EDGEDRAW | ME_EDGERENDER); + edge.flag = ME_EDGEDRAW; return edge; } @@ -1380,8 +1380,8 @@ void register_node_type_geo_extrude_mesh() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_EXTRUDE_MESH, "Extrude Mesh", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.geometry_node_execute = file_ns::node_geo_exec; node_type_storage( &ntype, "NodeGeometryExtrudeMesh", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc b/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc index f39337d3fc3..0d339620047 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc @@ -402,7 +402,7 @@ void register_node_type_geo_image_texture() geo_node_type_base(&ntype, GEO_NODE_IMAGE_TEXTURE, "Image Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_layout; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage( &ntype, "NodeGeometryImageTexture", node_free_standard_storage, node_copy_standard_storage); node_type_size_preset(&ntype, NODE_SIZE_LARGE); diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc index 1063a022e9d..9d1f90ba0f3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc @@ -126,7 +126,7 @@ void register_node_type_geo_input_named_attribute() ntype.draw_buttons = file_ns::node_layout; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; ntype.updatefunc = file_ns::node_update; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryInputNamedAttribute", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc b/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc index ce8b078f195..8ab8c4afaa9 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc @@ -132,7 +132,7 @@ void register_node_type_geo_merge_by_distance() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_MERGE_BY_DISTANCE, "Merge by Distance", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometryMergeByDistance", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc index 31a3e967905..14f38efbd42 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc @@ -127,7 +127,7 @@ static Mesh *create_circle_mesh(const float radius, /* Create outer edges. */ const short edge_flag = (fill_type == GEO_NODE_MESH_CIRCLE_FILL_NONE) ? ME_LOOSEEDGE : - (ME_EDGEDRAW | ME_EDGERENDER); /* NGON or TRIANGLE_FAN */ + ME_EDGEDRAW; /* NGON or TRIANGLE_FAN */ for (const int i : IndexRange(verts_num)) { MEdge &edge = edges[i]; edge.v1 = i; @@ -141,7 +141,7 @@ static Mesh *create_circle_mesh(const float radius, MEdge &edge = edges[verts_num + i]; edge.v1 = verts_num; edge.v2 = i; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } @@ -205,7 +205,7 @@ void register_node_type_geo_mesh_primitive_circle() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_MESH_PRIMITIVE_CIRCLE, "Mesh Circle", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage( &ntype, "NodeGeometryMeshCircle", node_free_standard_storage, node_copy_standard_storage); ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc index 4a9264b8464..dca91d2dc61 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc @@ -329,7 +329,7 @@ static void calculate_cone_edges(const MutableSpan<MEdge> &edges, const ConeConf MEdge &edge = edges[edge_index++]; edge.v1 = config.first_vert; edge.v2 = config.first_ring_verts_start + i; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } @@ -342,7 +342,7 @@ static void calculate_cone_edges(const MutableSpan<MEdge> &edges, const ConeConf MEdge &edge = edges[edge_index++]; edge.v1 = this_ring_vert_start + j; edge.v2 = this_ring_vert_start + ((j + 1) % config.circle_segments); - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } if (i == config.tot_edge_rings - 1) { /* There is one fewer ring of connecting edges. */ @@ -353,7 +353,7 @@ static void calculate_cone_edges(const MutableSpan<MEdge> &edges, const ConeConf MEdge &edge = edges[edge_index++]; edge.v1 = this_ring_vert_start + j; edge.v2 = next_ring_vert_start + j; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } @@ -363,7 +363,7 @@ static void calculate_cone_edges(const MutableSpan<MEdge> &edges, const ConeConf MEdge &edge = edges[edge_index++]; edge.v1 = config.last_ring_verts_start + i; edge.v2 = config.last_vert; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } } @@ -854,8 +854,8 @@ void register_node_type_geo_mesh_primitive_cone() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_MESH_PRIMITIVE_CONE, "Cone", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage( &ntype, "NodeGeometryMeshCone", node_free_standard_storage, node_copy_standard_storage); ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc index f192b385b1b..b02b1fbae27 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc @@ -154,8 +154,8 @@ void register_node_type_geo_mesh_primitive_cylinder() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_MESH_PRIMITIVE_CYLINDER, "Cylinder", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage( &ntype, "NodeGeometryMeshCylinder", node_free_standard_storage, node_copy_standard_storage); ntype.declare = file_ns::node_declare; diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc index 6f0b8283b72..e8ee057ee5c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_grid.cc @@ -76,8 +76,7 @@ Mesh *create_grid_mesh(const int verts_x, const int y_edges_start = 0; const int x_edges_start = verts_x * edges_y; - const short edge_flag = (edges_x == 0 || edges_y == 0) ? ME_LOOSEEDGE : - ME_EDGEDRAW | ME_EDGERENDER; + const short edge_flag = (edges_x == 0 || edges_y == 0) ? ME_LOOSEEDGE : ME_EDGEDRAW; /* Build the horizontal edges in the X direction. */ threading::parallel_for(IndexRange(verts_x), 512, [&](IndexRange x_range) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc index 7faa7e23274..51a4f36507e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc @@ -214,8 +214,8 @@ void register_node_type_geo_mesh_primitive_line() geo_node_type_base(&ntype, GEO_NODE_MESH_PRIMITIVE_LINE, "Mesh Line", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage( &ntype, "NodeGeometryMeshLine", node_free_standard_storage, node_copy_standard_storage); ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc index 4b43693f0f6..cfa1c477b28 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc @@ -116,7 +116,7 @@ BLI_NOINLINE static void calculate_sphere_edge_indices(MutableSpan<MEdge> edges, MEdge &edge = edges[edge_index++]; edge.v1 = 0; edge.v2 = first_vert_ring_index_start + segment; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } int ring_vert_index_start = 1; @@ -128,7 +128,7 @@ BLI_NOINLINE static void calculate_sphere_edge_indices(MutableSpan<MEdge> edges, MEdge &edge = edges[edge_index++]; edge.v1 = ring_vert_index_start + segment; edge.v2 = ring_vert_index_start + ((segment + 1) % segments); - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } /* Add the edges connecting to the next ring. */ @@ -137,7 +137,7 @@ BLI_NOINLINE static void calculate_sphere_edge_indices(MutableSpan<MEdge> edges, MEdge &edge = edges[edge_index++]; edge.v1 = ring_vert_index_start + segment; edge.v2 = next_ring_vert_index_start + segment; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } ring_vert_index_start += segments; @@ -150,7 +150,7 @@ BLI_NOINLINE static void calculate_sphere_edge_indices(MutableSpan<MEdge> edges, MEdge &edge = edges[edge_index++]; edge.v1 = last_vert_index; edge.v2 = last_vert_ring_start + segment; - edge.flag = ME_EDGEDRAW | ME_EDGERENDER; + edge.flag = ME_EDGEDRAW; } } diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc index d97a0e72060..d47e0c0f101 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_points.cc @@ -163,7 +163,7 @@ void register_node_type_geo_mesh_to_points() geo_node_type_base(&ntype, GEO_NODE_MESH_TO_POINTS, "Mesh to Points", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.draw_buttons = file_ns::node_layout; node_type_storage( &ntype, "NodeGeometryMeshToPoints", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc index 8885903f828..cf4d058cd31 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_to_volume.cc @@ -174,8 +174,8 @@ void register_node_type_geo_mesh_to_volume() geo_node_type_base(&ntype, GEO_NODE_MESH_TO_VOLUME, "Mesh to Volume", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; node_type_size(&ntype, 200, 120, 700); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; node_type_storage( diff --git a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc index 83a2ddb1629..f1a9987e721 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc @@ -106,7 +106,7 @@ void register_node_type_geo_object_info() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_OBJECT_INFO, "Object Info", NODE_CLASS_INPUT); - node_type_init(&ntype, file_ns::node_node_init); + ntype.initfunc = file_ns::node_node_init; node_type_storage( &ntype, "NodeGeometryObjectInfo", node_free_standard_storage, node_copy_standard_storage); ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc index 45f6820f2e5..d0b7f6a455f 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc @@ -258,8 +258,8 @@ void register_node_type_geo_points_to_volume() node_free_standard_storage, node_copy_standard_storage); node_type_size(&ntype, 170, 120, 700); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; diff --git a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc index 21f4449baee..92a409f9db6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_proximity.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_proximity.cc @@ -228,7 +228,7 @@ void register_node_type_geo_proximity() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_PROXIMITY, "Geometry Proximity", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::geo_proximity_init); + ntype.initfunc = file_ns::geo_proximity_init; node_type_storage( &ntype, "NodeGeometryProximity", node_free_standard_storage, node_copy_standard_storage); ntype.declare = file_ns::node_declare; diff --git a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc index d248bc539b1..b3dbc9ee866 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc @@ -435,8 +435,8 @@ void register_node_type_geo_raycast() geo_node_type_base(&ntype, GEO_NODE_RAYCAST, "Raycast", NODE_CLASS_GEOMETRY); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage( &ntype, "NodeGeometryRaycast", node_free_standard_storage, node_copy_standard_storage); ntype.declare = file_ns::node_declare; diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc index 4d2db059798..22c18504985 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_index.cc @@ -325,8 +325,8 @@ void register_node_type_geo_sample_index() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_SAMPLE_INDEX, "Sample Index", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.declare = file_ns::node_declare; node_type_storage( &ntype, "NodeGeometrySampleIndex", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc index 8c5dad3a1c5..7028b013dc6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest.cc @@ -334,7 +334,7 @@ void register_node_type_geo_sample_nearest() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_SAMPLE_NEAREST, "Sample Nearest", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc index 95bf7199d63..503f6264191 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_nearest_surface.cc @@ -267,8 +267,8 @@ void register_node_type_geo_sample_nearest_surface() geo_node_type_base( &ntype, GEO_NODE_SAMPLE_NEAREST_SURFACE, "Sample Nearest Surface", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc index 2e8446ba559..0a6dd569395 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_sample_uv_surface.cc @@ -284,8 +284,8 @@ void register_node_type_geo_sample_uv_surface() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_SAMPLE_UV_SURFACE, "Sample UV Surface", NODE_CLASS_GEOMETRY); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; diff --git a/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc index 44d12466d9e..d4da5dda647 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_separate_geometry.cc @@ -87,7 +87,7 @@ void register_node_type_geo_separate_geometry() node_free_standard_storage, node_copy_standard_storage); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc index c143203337a..48be899bec9 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc @@ -174,7 +174,7 @@ void register_node_type_geo_set_curve_handles() ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.declare = file_ns::node_declare; ntype.minwidth = 100.0f; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage(&ntype, "NodeGeometrySetCurveHandlePositions", node_free_standard_storage, diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc b/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc index e2169966f5a..287c5920134 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_curve_normal.cc @@ -66,7 +66,7 @@ void register_node_type_geo_set_curve_normal() geo_node_type_base(&ntype, GEO_NODE_SET_CURVE_NORMAL, "Set Curve Normal", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.draw_buttons = file_ns::node_layout; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc index 3c85fd459e1..b71dba98daa 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc @@ -192,7 +192,7 @@ void register_node_type_geo_store_named_attribute() node_free_standard_storage, node_copy_standard_storage); node_type_size(&ntype, 140, 100, 700); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; ntype.updatefunc = file_ns::node_update; ntype.declare = file_ns::node_declare; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; diff --git a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc index 769a63f58cf..405c2761711 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc @@ -405,8 +405,8 @@ void register_node_type_geo_string_to_curves() geo_node_type_base(&ntype, GEO_NODE_STRING_TO_CURVES, "String to Curves", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_size(&ntype, 190, 120, 700); node_type_storage(&ntype, "NodeGeometryStringToCurves", diff --git a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc index 2e6ad02bfd5..7b4608d32a5 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_subdivision_surface.cc @@ -191,7 +191,7 @@ void register_node_type_geo_subdivision_surface() ntype.declare = file_ns::node_declare; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_storage(&ntype, "NodeGeometrySubdivisionSurface", diff --git a/source/blender/nodes/geometry/nodes/node_geo_switch.cc b/source/blender/nodes/geometry/nodes/node_geo_switch.cc index 36be68f1a22..bd3ac271817 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_switch.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_switch.cc @@ -290,8 +290,8 @@ void register_node_type_geo_switch() geo_node_type_base(&ntype, GEO_NODE_SWITCH, "Switch", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; node_type_storage(&ntype, "NodeSwitch", node_free_standard_storage, node_copy_standard_storage); ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.geometry_node_execute_supports_laziness = true; diff --git a/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc b/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc index cedc1ef845b..5cb78b3abe8 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_triangulate.cc @@ -100,7 +100,7 @@ void register_node_type_geo_triangulate() geo_node_type_base(&ntype, GEO_NODE_TRIANGULATE, "Triangulate", NODE_CLASS_GEOMETRY); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::geo_triangulate_init); + ntype.initfunc = file_ns::geo_triangulate_init; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/geometry/nodes/node_geo_uv_unwrap.cc b/source/blender/nodes/geometry/nodes/node_geo_uv_unwrap.cc index e45ce6b42b4..eff3b969250 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_uv_unwrap.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_uv_unwrap.cc @@ -189,7 +189,7 @@ void register_node_type_geo_uv_unwrap() static bNodeType ntype; geo_node_type_base(&ntype, GEO_NODE_UV_UNWRAP, "UV Unwrap", NODE_CLASS_CONVERTER); - node_type_init(&ntype, file_ns::node_init); + ntype.initfunc = file_ns::node_init; node_type_storage( &ntype, "NodeGeometryUVUnwrap", node_free_standard_storage, node_copy_standard_storage); ntype.declare = file_ns::node_declare; diff --git a/source/blender/nodes/geometry/nodes/node_geo_viewer.cc b/source/blender/nodes/geometry/nodes/node_geo_viewer.cc index e9050f9e6a1..53a8cd79f52 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_viewer.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_viewer.cc @@ -135,8 +135,8 @@ void register_node_type_geo_viewer() geo_node_type_base(&ntype, GEO_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT); node_type_storage( &ntype, "NodeGeometryViewer", node_free_standard_storage, node_copy_standard_storage); - node_type_update(&ntype, file_ns::node_update); - node_type_init(&ntype, file_ns::node_init); + ntype.updatefunc = file_ns::node_update; + ntype.initfunc = file_ns::node_init; ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_layout; ntype.draw_buttons_ex = file_ns::node_layout_ex; diff --git a/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc index 88e7718ed3c..c076a6c08f3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc @@ -215,8 +215,8 @@ void register_node_type_geo_volume_to_mesh() node_type_storage( &ntype, "NodeGeometryVolumeToMesh", node_free_standard_storage, node_copy_standard_storage); node_type_size(&ntype, 170, 120, 700); - node_type_init(&ntype, file_ns::node_init); - node_type_update(&ntype, file_ns::node_update); + ntype.initfunc = file_ns::node_init; + ntype.updatefunc = file_ns::node_update; ntype.geometry_node_execute = file_ns::node_geo_exec; ntype.draw_buttons = file_ns::node_layout; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc index d7cc0b6065a..975bf0c01ca 100644 --- a/source/blender/nodes/intern/node_common.cc +++ b/source/blender/nodes/intern/node_common.cc @@ -22,6 +22,7 @@ #include "BLT_translation.h" #include "BKE_node.h" +#include "BKE_node_runtime.hh" #include "BKE_node_tree_update.h" #include "RNA_types.h" @@ -86,8 +87,6 @@ bool nodeGroupPoll(const bNodeTree *nodetree, const bNodeTree *grouptree, const char **r_disabled_hint) { - bool valid = true; - /* unspecified node group, generally allowed * (if anything, should be avoided on operator level) */ @@ -106,11 +105,10 @@ bool nodeGroupPoll(const bNodeTree *nodetree, if (node->typeinfo->poll_instance && !node->typeinfo->poll_instance( const_cast<bNode *>(node), const_cast<bNodeTree *>(nodetree), r_disabled_hint)) { - valid = false; - break; + return false; } } - return valid; + return true; } static void add_new_socket_from_interface(bNodeTree &node_tree, @@ -255,7 +253,7 @@ void register_node_type_frame() ntype->free_self = (void (*)(bNodeType *))MEM_freeN; node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT); - node_type_init(ntype, node_frame_init); + ntype->initfunc = node_frame_init; node_type_storage(ntype, "NodeFrame", node_free_standard_storage, node_copy_standard_storage); node_type_size(ntype, 150, 100, 0); ntype->flag |= NODE_BACKGROUND; @@ -285,7 +283,7 @@ void register_node_type_reroute() ntype->free_self = (void (*)(bNodeType *))MEM_freeN; node_type_base(ntype, NODE_REROUTE, "Reroute", NODE_CLASS_LAYOUT); - node_type_init(ntype, node_reroute_init); + ntype->initfunc = node_reroute_init; nodeRegisterType(ntype); } @@ -381,53 +379,29 @@ void ntree_update_reroute_nodes(bNodeTree *ntree) } } -static bool node_is_connected_to_output_recursive(bNodeTree *ntree, bNode *node) +bool BKE_node_is_connected_to_output(const bNodeTree *ntree, const bNode *node) { - bNodeLink *link; - - /* avoid redundant checks, and infinite loops in case of cyclic node links */ - if (node->done) { - return false; - } - node->done = 1; - - /* main test, done before child loop so it catches output nodes themselves as well */ - if (node->typeinfo->nclass == NODE_CLASS_OUTPUT && node->flag & NODE_DO_OUTPUT) { - return true; + ntree->ensure_topology_cache(); + Stack<const bNode *> nodes_to_check; + for (const bNodeSocket *socket : node->output_sockets()) { + for (const bNodeLink *link : socket->directly_linked_links()) { + nodes_to_check.push(link->tonode); + } } - - /* test all connected nodes, first positive find is sufficient to return true */ - for (link = (bNodeLink *)ntree->links.first; link; link = link->next) { - if (link->fromnode == node) { - if (node_is_connected_to_output_recursive(ntree, link->tonode)) { - return true; + while (!nodes_to_check.is_empty()) { + const bNode *next_node = nodes_to_check.pop(); + for (const bNodeSocket *socket : next_node->output_sockets()) { + for (const bNodeLink *link : socket->directly_linked_links()) { + if (link->tonode->typeinfo->nclass == NODE_CLASS_OUTPUT && + link->tonode->flag & NODE_DO_OUTPUT) { + return true; + } + nodes_to_check.push(link->tonode); } } } - return false; -} - -bool BKE_node_is_connected_to_output(bNodeTree *ntree, bNode *node) -{ - bNode *tnode; - /* clear flags */ - for (tnode = (bNode *)ntree->nodes.first; tnode; tnode = tnode->next) { - tnode->done = 0; - } - - return node_is_connected_to_output_recursive(ntree, node); -} - -void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree) -{ - bNode *node; - - for (node = (bNode *)ntree->nodes.first; node; node = node->next) { - if (node->id == id) { - node->id = nullptr; - } - } + return false; } /** \} */ @@ -460,62 +434,53 @@ bNodeSocket *node_group_input_find_socket(bNode *node, const char *identifier) void node_group_input_update(bNodeTree *ntree, bNode *node) { bNodeSocket *extsock = (bNodeSocket *)node->outputs.last; - bNodeLink *link, *linknext, *exposelink; /* Adding a tree socket and verifying will remove the extension socket! * This list caches the existing links from the extension socket - * so they can be recreated after verification. - */ - ListBase tmplinks; + * so they can be recreated after verification. */ + Vector<bNodeLink> temp_links; /* find links from the extension socket and store them */ - BLI_listbase_clear(&tmplinks); - for (link = (bNodeLink *)ntree->links.first; link; link = linknext) { - linknext = link->next; + LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) { if (nodeLinkIsHidden(link)) { continue; } if (link->fromsock == extsock) { - bNodeLink *tlink = MEM_cnew<bNodeLink>("temporary link"); - *tlink = *link; - BLI_addtail(&tmplinks, tlink); - + temp_links.append(*link); nodeRemLink(ntree, link); } } /* find valid link to expose */ - exposelink = nullptr; - for (link = (bNodeLink *)tmplinks.first; link; link = link->next) { + bNodeLink *exposelink = nullptr; + for (bNodeLink &link : temp_links) { /* XXX Multiple sockets can be connected to the extension socket at once, * in that case the arbitrary first link determines name and type. * This could be improved by choosing the "best" type among all links, * whatever that means. */ - if (!is_group_extension_socket(link->tonode, link->tosock)) { - exposelink = link; + if (!is_group_extension_socket(link.tonode, link.tosock)) { + exposelink = &link; break; } } if (exposelink) { - bNodeSocket *gsock, *newsock; - - gsock = ntreeAddSocketInterfaceFromSocket(ntree, exposelink->tonode, exposelink->tosock); + bNodeSocket *gsock = ntreeAddSocketInterfaceFromSocket( + ntree, exposelink->tonode, exposelink->tosock); node_group_input_update(ntree, node); - newsock = node_group_input_find_socket(node, gsock->identifier); + bNodeSocket *newsock = node_group_input_find_socket(node, gsock->identifier); /* redirect links from the extension socket */ - for (link = (bNodeLink *)tmplinks.first; link; link = link->next) { - bNodeLink *newlink = nodeAddLink(ntree, node, newsock, link->tonode, link->tosock); + for (bNodeLink &link : temp_links) { + bNodeLink *newlink = nodeAddLink(ntree, node, newsock, link.tonode, link.tosock); if (newlink->tosock->flag & SOCK_MULTI_INPUT) { - newlink->multi_input_socket_index = link->multi_input_socket_index; + newlink->multi_input_socket_index = link.multi_input_socket_index; } } } - BLI_freelistN(&tmplinks); group_verify_socket_list(*ntree, *node, ntree->inputs, node->outputs, SOCK_OUT, true); } @@ -527,8 +492,8 @@ void register_node_type_group_input() node_type_base(ntype, NODE_GROUP_INPUT, "Group Input", NODE_CLASS_INTERFACE); node_type_size(ntype, 140, 80, 400); - node_type_init(ntype, node_group_input_init); - node_type_update(ntype, node_group_input_update); + ntype->initfunc = node_group_input_init; + ntype->updatefunc = node_group_input_update; nodeRegisterType(ntype); } @@ -552,60 +517,51 @@ bNodeSocket *node_group_output_find_socket(bNode *node, const char *identifier) void node_group_output_update(bNodeTree *ntree, bNode *node) { bNodeSocket *extsock = (bNodeSocket *)node->inputs.last; - bNodeLink *link, *linknext, *exposelink; /* Adding a tree socket and verifying will remove the extension socket! * This list caches the existing links to the extension socket - * so they can be recreated after verification. - */ - ListBase tmplinks; + * so they can be recreated after verification. */ + Vector<bNodeLink> temp_links; /* find links to the extension socket and store them */ - BLI_listbase_clear(&tmplinks); - for (link = (bNodeLink *)ntree->links.first; link; link = linknext) { - linknext = link->next; + LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) { if (nodeLinkIsHidden(link)) { continue; } if (link->tosock == extsock) { - bNodeLink *tlink = MEM_cnew<bNodeLink>("temporary link"); - *tlink = *link; - BLI_addtail(&tmplinks, tlink); - + temp_links.append(*link); nodeRemLink(ntree, link); } } /* find valid link to expose */ - exposelink = nullptr; - for (link = (bNodeLink *)tmplinks.first; link; link = link->next) { + bNodeLink *exposelink = nullptr; + for (bNodeLink &link : temp_links) { /* XXX Multiple sockets can be connected to the extension socket at once, * in that case the arbitrary first link determines name and type. * This could be improved by choosing the "best" type among all links, * whatever that means. */ - if (!is_group_extension_socket(link->fromnode, link->fromsock)) { - exposelink = link; + if (!is_group_extension_socket(link.fromnode, link.fromsock)) { + exposelink = &link; break; } } if (exposelink) { - bNodeSocket *gsock, *newsock; - /* XXX what if connecting virtual to virtual socket?? */ - gsock = ntreeAddSocketInterfaceFromSocket(ntree, exposelink->fromnode, exposelink->fromsock); + bNodeSocket *gsock = ntreeAddSocketInterfaceFromSocket( + ntree, exposelink->fromnode, exposelink->fromsock); node_group_output_update(ntree, node); - newsock = node_group_output_find_socket(node, gsock->identifier); + bNodeSocket *newsock = node_group_output_find_socket(node, gsock->identifier); /* redirect links to the extension socket */ - for (link = (bNodeLink *)tmplinks.first; link; link = link->next) { - nodeAddLink(ntree, link->fromnode, link->fromsock, node, newsock); + for (bNodeLink &link : temp_links) { + nodeAddLink(ntree, link.fromnode, link.fromsock, node, newsock); } } - BLI_freelistN(&tmplinks); group_verify_socket_list(*ntree, *node, ntree->outputs, node->inputs, SOCK_IN, true); } @@ -617,8 +573,8 @@ void register_node_type_group_output() node_type_base(ntype, NODE_GROUP_OUTPUT, "Group Output", NODE_CLASS_INTERFACE); node_type_size(ntype, 140, 80, 400); - node_type_init(ntype, node_group_output_init); - node_type_update(ntype, node_group_output_update); + ntype->initfunc = node_group_output_init; + ntype->updatefunc = node_group_output_update; ntype->no_muting = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_add_shader.cc b/source/blender/nodes/shader/nodes/node_shader_add_shader.cc index f7b25225e30..8bdc5b91887 100644 --- a/source/blender/nodes/shader/nodes/node_shader_add_shader.cc +++ b/source/blender/nodes/shader/nodes/node_shader_add_shader.cc @@ -32,7 +32,7 @@ void register_node_type_sh_add_shader() sh_node_type_base(&ntype, SH_NODE_ADD_SHADER, "Add Shader", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_add_shader); + ntype.gpu_fn = file_ns::node_shader_gpu_add_shader; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.cc b/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.cc index 5f30fe0dd30..85c49b47b81 100644 --- a/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.cc +++ b/source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.cc @@ -66,8 +66,8 @@ void register_node_type_sh_ambient_occlusion() sh_node_type_base(&ntype, SH_NODE_AMBIENT_OCCLUSION, "Ambient Occlusion", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_ambient_occlusion; - node_type_init(&ntype, file_ns::node_shader_init_ambient_occlusion); - node_type_gpu(&ntype, file_ns::node_shader_gpu_ambient_occlusion); + ntype.initfunc = file_ns::node_shader_init_ambient_occlusion; + ntype.gpu_fn = file_ns::node_shader_gpu_ambient_occlusion; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.cc b/source/blender/nodes/shader/nodes/node_shader_attribute.cc index 4694599f064..44f5282b688 100644 --- a/source/blender/nodes/shader/nodes/node_shader_attribute.cc +++ b/source/blender/nodes/shader/nodes/node_shader_attribute.cc @@ -86,10 +86,10 @@ void register_node_type_sh_attribute() sh_node_type_base(&ntype, SH_NODE_ATTRIBUTE, "Attribute", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_attribute; - node_type_init(&ntype, file_ns::node_shader_init_attribute); + ntype.initfunc = file_ns::node_shader_init_attribute; node_type_storage( &ntype, "NodeShaderAttribute", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_attribute); + ntype.gpu_fn = file_ns::node_shader_gpu_attribute; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_background.cc b/source/blender/nodes/shader/nodes/node_shader_background.cc index 1e41b66189a..a1e90757157 100644 --- a/source/blender/nodes/shader/nodes/node_shader_background.cc +++ b/source/blender/nodes/shader/nodes/node_shader_background.cc @@ -33,7 +33,7 @@ void register_node_type_sh_background() sh_node_type_base(&ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_background); + ntype.gpu_fn = file_ns::node_shader_gpu_background; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bevel.cc b/source/blender/nodes/shader/nodes/node_shader_bevel.cc index 14356a46125..53ce3876772 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bevel.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bevel.cc @@ -50,8 +50,8 @@ void register_node_type_sh_bevel() sh_node_type_base(&ntype, SH_NODE_BEVEL, "Bevel", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_bevel; - node_type_init(&ntype, file_ns::node_shader_init_bevel); - node_type_gpu(&ntype, file_ns::gpu_shader_bevel); + ntype.initfunc = file_ns::node_shader_init_bevel; + ntype.gpu_fn = file_ns::gpu_shader_bevel; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_blackbody.cc b/source/blender/nodes/shader/nodes/node_shader_blackbody.cc index 23e9a601045..a31653de4b2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_blackbody.cc +++ b/source/blender/nodes/shader/nodes/node_shader_blackbody.cc @@ -42,7 +42,7 @@ void register_node_type_sh_blackbody() sh_node_type_base(&ntype, SH_NODE_BLACKBODY, "Blackbody", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_gpu(&ntype, file_ns::node_shader_gpu_blackbody); + ntype.gpu_fn = file_ns::node_shader_gpu_blackbody; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_brightness.cc b/source/blender/nodes/shader/nodes/node_shader_brightness.cc index 09f0e21208c..0b1930b0434 100644 --- a/source/blender/nodes/shader/nodes/node_shader_brightness.cc +++ b/source/blender/nodes/shader/nodes/node_shader_brightness.cc @@ -32,7 +32,7 @@ void register_node_type_sh_brightcontrast() sh_node_type_base(&ntype, SH_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_brightcontrast); + ntype.gpu_fn = file_ns::gpu_shader_brightcontrast; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.cc index 2071b78fa64..48a7c248ea9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.cc @@ -69,8 +69,8 @@ void register_node_type_sh_bsdf_anisotropic() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_anisotropic; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_anisotropic); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_anisotropic); + ntype.initfunc = file_ns::node_shader_init_anisotropic; + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_anisotropic; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.cc index a4f0e04576f..ba222a1a2c2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.cc @@ -45,7 +45,7 @@ void register_node_type_sh_bsdf_diffuse() sh_node_type_base(&ntype, SH_NODE_BSDF_DIFFUSE, "Diffuse BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_diffuse); + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_diffuse; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.cc index b3c047c3a47..00d2ba4a119 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.cc @@ -57,8 +57,8 @@ void register_node_type_sh_bsdf_glass() sh_node_type_base(&ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_glass); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_glass); + ntype.initfunc = file_ns::node_shader_init_glass; + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_glass; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.cc index 7beecc0ecd4..edccd7314d2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.cc @@ -56,8 +56,8 @@ void register_node_type_sh_bsdf_glossy() sh_node_type_base(&ntype, SH_NODE_BSDF_GLOSSY, "Glossy BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_glossy); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_glossy); + ntype.initfunc = file_ns::node_shader_init_glossy; + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_glossy; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.cc index f8a17e146f4..0498dcd0be5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair.cc @@ -58,7 +58,7 @@ void register_node_type_sh_bsdf_hair() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_hair; node_type_size(&ntype, 150, 60, 200); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_hair); + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_hair; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc index b1022a95783..fd127cfb8ae 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.cc @@ -129,9 +129,9 @@ void register_node_type_sh_bsdf_hair_principled() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_principled_hair; node_type_size_preset(&ntype, NODE_SIZE_LARGE); - node_type_init(&ntype, file_ns::node_shader_init_hair_principled); - node_type_update(&ntype, file_ns::node_shader_update_hair_principled); - node_type_gpu(&ntype, file_ns::node_shader_gpu_hair_principled); + ntype.initfunc = file_ns::node_shader_init_hair_principled; + ntype.updatefunc = file_ns::node_shader_update_hair_principled; + ntype.gpu_fn = file_ns::node_shader_gpu_hair_principled; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc index adf2a9e8a19..82bf852455c 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc @@ -245,9 +245,9 @@ void register_node_type_sh_bsdf_principled() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_principled; node_type_size_preset(&ntype, NODE_SIZE_LARGE); - node_type_init(&ntype, file_ns::node_shader_init_principled); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_principled); - node_type_update(&ntype, file_ns::node_shader_update_principled); + ntype.initfunc = file_ns::node_shader_init_principled; + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_principled; + ntype.updatefunc = file_ns::node_shader_update_principled; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.cc index a7111fd398f..d6ef63015f8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.cc @@ -55,8 +55,8 @@ void register_node_type_sh_bsdf_refraction() sh_node_type_base(&ntype, SH_NODE_BSDF_REFRACTION, "Refraction BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_refraction); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_refraction); + ntype.initfunc = file_ns::node_shader_init_refraction; + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_refraction; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.cc index d0f70eb1c92..ba8e48ce410 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.cc @@ -59,7 +59,7 @@ void register_node_type_sh_bsdf_toon() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_toon; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_toon); + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_toon; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.cc index b8a2bf8043e..fcb3bcdd00a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.cc @@ -39,7 +39,7 @@ void register_node_type_sh_bsdf_translucent() sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_translucent); + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_translucent; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.cc index 8824c744fd3..4eba043ff2b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_transparent.cc @@ -35,7 +35,7 @@ void register_node_type_sh_bsdf_transparent() sh_node_type_base(&ntype, SH_NODE_BSDF_TRANSPARENT, "Transparent BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_transparent); + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_transparent; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.cc b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.cc index c4aaf371e46..67351dd7e19 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.cc @@ -44,7 +44,7 @@ void register_node_type_sh_bsdf_velvet() sh_node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_bsdf_velvet); + ntype.gpu_fn = file_ns::node_shader_gpu_bsdf_velvet; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_bump.cc b/source/blender/nodes/shader/nodes/node_shader_bump.cc index 5447198107b..9439f95d62b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_bump.cc +++ b/source/blender/nodes/shader/nodes/node_shader_bump.cc @@ -78,7 +78,7 @@ void register_node_type_sh_bump() sh_node_type_base(&ntype, SH_NODE_BUMP, "Bump", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_bump; - node_type_gpu(&ntype, file_ns::gpu_shader_bump); + ntype.gpu_fn = file_ns::gpu_shader_bump; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.cc b/source/blender/nodes/shader/nodes/node_shader_camera.cc index 4d99d5ad17f..2752cd31c56 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.cc +++ b/source/blender/nodes/shader/nodes/node_shader_camera.cc @@ -35,7 +35,7 @@ void register_node_type_sh_camera() sh_node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_camera); + ntype.gpu_fn = file_ns::gpu_shader_camera; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_clamp.cc b/source/blender/nodes/shader/nodes/node_shader_clamp.cc index 7680c6f99c4..5b7c216c4c3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_clamp.cc +++ b/source/blender/nodes/shader/nodes/node_shader_clamp.cc @@ -76,8 +76,8 @@ void register_node_type_sh_clamp() sh_fn_node_type_base(&ntype, SH_NODE_CLAMP, "Clamp", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_clamp_declare; ntype.draw_buttons = file_ns::node_shader_buts_clamp; - node_type_init(&ntype, file_ns::node_shader_init_clamp); - node_type_gpu(&ntype, file_ns::gpu_shader_clamp); + ntype.initfunc = file_ns::node_shader_init_clamp; + ntype.gpu_fn = file_ns::gpu_shader_clamp; ntype.build_multi_function = file_ns::sh_node_clamp_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc b/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc index 096884591ab..f5d405c7678 100644 --- a/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc +++ b/source/blender/nodes/shader/nodes/node_shader_color_ramp.cc @@ -140,10 +140,10 @@ void register_node_type_sh_valtorgb() sh_fn_node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_valtorgb_declare; - node_type_init(&ntype, file_ns::node_shader_init_valtorgb); + ntype.initfunc = file_ns::node_shader_init_valtorgb; node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::gpu_shader_valtorgb); + ntype.gpu_fn = file_ns::gpu_shader_valtorgb; ntype.build_multi_function = file_ns::sh_node_valtorgb_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_common.cc b/source/blender/nodes/shader/nodes/node_shader_common.cc index 20d0d11ba86..9d1d788da9d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_common.cc +++ b/source/blender/nodes/shader/nodes/node_shader_common.cc @@ -93,8 +93,8 @@ void register_node_type_sh_group() node_type_size(&ntype, 140, 60, 400); ntype.labelfunc = node_group_label; - node_type_group_update(&ntype, node_group_update); - node_type_gpu(&ntype, gpu_group_execute); + ntype.group_update_func = node_group_update; + ntype.gpu_fn = gpu_group_execute; nodeRegisterType(&ntype); } @@ -109,5 +109,5 @@ void register_node_type_sh_custom_group(bNodeType *ntype) ntype->insert_link = node_insert_link_default; } - node_type_gpu(ntype, gpu_group_execute); + ntype->gpu_fn = gpu_group_execute; } diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.cc b/source/blender/nodes/shader/nodes/node_shader_curves.cc index c4dbc3ce6f1..0945c39ee50 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.cc +++ b/source/blender/nodes/shader/nodes/node_shader_curves.cc @@ -116,10 +116,10 @@ void register_node_type_sh_curve_vec() sh_fn_node_type_base(&ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::sh_node_curve_vec_declare; - node_type_init(&ntype, file_ns::node_shader_init_curve_vec); + ntype.initfunc = file_ns::node_shader_init_curve_vec; node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); - node_type_gpu(&ntype, file_ns::gpu_shader_curve_vec); + ntype.gpu_fn = file_ns::gpu_shader_curve_vec; ntype.build_multi_function = file_ns::sh_node_curve_vec_build_multi_function; nodeRegisterType(&ntype); @@ -263,10 +263,10 @@ void register_node_type_sh_curve_rgb() sh_fn_node_type_base(&ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::sh_node_curve_rgb_declare; - node_type_init(&ntype, file_ns::node_shader_init_curve_rgb); + ntype.initfunc = file_ns::node_shader_init_curve_rgb; node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); - node_type_gpu(&ntype, file_ns::gpu_shader_curve_rgb); + ntype.gpu_fn = file_ns::gpu_shader_curve_rgb; ntype.build_multi_function = file_ns::sh_node_curve_rgb_build_multi_function; nodeRegisterType(&ntype); @@ -383,10 +383,10 @@ void register_node_type_sh_curve_float() sh_fn_node_type_base(&ntype, SH_NODE_CURVE_FLOAT, "Float Curve", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_curve_float_declare; - node_type_init(&ntype, file_ns::node_shader_init_curve_float); + ntype.initfunc = file_ns::node_shader_init_curve_float; node_type_size_preset(&ntype, NODE_SIZE_LARGE); node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); - node_type_gpu(&ntype, file_ns::gpu_shader_curve_float); + ntype.gpu_fn = file_ns::gpu_shader_curve_float; ntype.build_multi_function = file_ns::sh_node_curve_float_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_displacement.cc b/source/blender/nodes/shader/nodes/node_shader_displacement.cc index fd5a6107447..e71e2168701 100644 --- a/source/blender/nodes/shader/nodes/node_shader_displacement.cc +++ b/source/blender/nodes/shader/nodes/node_shader_displacement.cc @@ -54,8 +54,8 @@ void register_node_type_sh_displacement() sh_node_type_base(&ntype, SH_NODE_DISPLACEMENT, "Displacement", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_shader_init_displacement); - node_type_gpu(&ntype, file_ns::gpu_shader_displacement); + ntype.initfunc = file_ns::node_shader_init_displacement; + ntype.gpu_fn = file_ns::gpu_shader_displacement; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_eevee_specular.cc b/source/blender/nodes/shader/nodes/node_shader_eevee_specular.cc index 5a058eec690..c13300bdac4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_eevee_specular.cc +++ b/source/blender/nodes/shader/nodes/node_shader_eevee_specular.cc @@ -80,7 +80,7 @@ void register_node_type_sh_eevee_specular() sh_node_type_base(&ntype, SH_NODE_EEVEE_SPECULAR, "Specular BSDF", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_eevee_specular); + ntype.gpu_fn = file_ns::node_shader_gpu_eevee_specular; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_emission.cc b/source/blender/nodes/shader/nodes/node_shader_emission.cc index 69c6094e92e..df6283f92dc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_emission.cc +++ b/source/blender/nodes/shader/nodes/node_shader_emission.cc @@ -34,7 +34,7 @@ void register_node_type_sh_emission() sh_node_type_base(&ntype, SH_NODE_EMISSION, "Emission", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_emission); + ntype.gpu_fn = file_ns::node_shader_gpu_emission; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_fresnel.cc b/source/blender/nodes/shader/nodes/node_shader_fresnel.cc index abbfc5ad1d5..1e35942476a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_fresnel.cc +++ b/source/blender/nodes/shader/nodes/node_shader_fresnel.cc @@ -36,7 +36,7 @@ void register_node_type_sh_fresnel() sh_node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_fresnel); + ntype.gpu_fn = file_ns::node_shader_gpu_fresnel; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_gamma.cc b/source/blender/nodes/shader/nodes/node_shader_gamma.cc index 80419ed732c..327d9b134cd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_gamma.cc +++ b/source/blender/nodes/shader/nodes/node_shader_gamma.cc @@ -35,7 +35,7 @@ void register_node_type_sh_gamma() sh_node_type_base(&ntype, SH_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_gamma); + ntype.gpu_fn = file_ns::node_shader_gpu_gamma; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.cc b/source/blender/nodes/shader/nodes/node_shader_geometry.cc index e27b5290513..d7d5f4aa91f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.cc +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.cc @@ -68,7 +68,7 @@ void register_node_type_sh_geometry() sh_node_type_base(&ntype, SH_NODE_NEW_GEOMETRY, "Geometry", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_geometry); + ntype.gpu_fn = file_ns::node_shader_gpu_geometry; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_hair_info.cc b/source/blender/nodes/shader/nodes/node_shader_hair_info.cc index 2ae87f7bc51..4511c8a9ae6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hair_info.cc +++ b/source/blender/nodes/shader/nodes/node_shader_hair_info.cc @@ -39,7 +39,7 @@ void register_node_type_sh_hair_info() sh_node_type_base(&ntype, SH_NODE_HAIR_INFO, "Curves Info", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_hair_info); + ntype.gpu_fn = file_ns::node_shader_gpu_hair_info; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_holdout.cc b/source/blender/nodes/shader/nodes/node_shader_holdout.cc index ee754a7afa8..f3f8cef5a2d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_holdout.cc +++ b/source/blender/nodes/shader/nodes/node_shader_holdout.cc @@ -31,7 +31,7 @@ void register_node_type_sh_holdout() sh_node_type_base(&ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_rgb); + ntype.gpu_fn = file_ns::gpu_shader_rgb; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.cc b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.cc index 3e057d3d230..7eb02a3bce2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.cc +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.cc @@ -39,7 +39,7 @@ void register_node_type_sh_hue_sat() sh_node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_gpu(&ntype, file_ns::gpu_shader_hue_sat); + ntype.gpu_fn = file_ns::gpu_shader_hue_sat; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_ies_light.cc b/source/blender/nodes/shader/nodes/node_shader_ies_light.cc index 65655ba2781..dee69eaf391 100644 --- a/source/blender/nodes/shader/nodes/node_shader_ies_light.cc +++ b/source/blender/nodes/shader/nodes/node_shader_ies_light.cc @@ -50,7 +50,7 @@ void register_node_type_sh_tex_ies() sh_node_type_base(&ntype, SH_NODE_TEX_IES, "IES Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_ies; - node_type_init(&ntype, file_ns::node_shader_init_tex_ies); + ntype.initfunc = file_ns::node_shader_init_tex_ies; node_type_storage( &ntype, "NodeShaderTexIES", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_invert.cc b/source/blender/nodes/shader/nodes/node_shader_invert.cc index adcb0508093..ba2774e3b8f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_invert.cc +++ b/source/blender/nodes/shader/nodes/node_shader_invert.cc @@ -35,7 +35,7 @@ void register_node_type_sh_invert() sh_node_type_base(&ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_invert); + ntype.gpu_fn = file_ns::gpu_shader_invert; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_layer_weight.cc b/source/blender/nodes/shader/nodes/node_shader_layer_weight.cc index 5a56ee8bc75..f589f85fc89 100644 --- a/source/blender/nodes/shader/nodes/node_shader_layer_weight.cc +++ b/source/blender/nodes/shader/nodes/node_shader_layer_weight.cc @@ -37,7 +37,7 @@ void register_node_type_sh_layer_weight() sh_node_type_base(&ntype, SH_NODE_LAYER_WEIGHT, "Layer Weight", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_layer_weight); + ntype.gpu_fn = file_ns::node_shader_gpu_layer_weight; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_light_falloff.cc b/source/blender/nodes/shader/nodes/node_shader_light_falloff.cc index 1ee096c052f..fcaf1b31e77 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_falloff.cc +++ b/source/blender/nodes/shader/nodes/node_shader_light_falloff.cc @@ -35,7 +35,7 @@ void register_node_type_sh_light_falloff() sh_node_type_base(&ntype, SH_NODE_LIGHT_FALLOFF, "Light Falloff", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_gpu(&ntype, file_ns::node_shader_gpu_light_falloff); + ntype.gpu_fn = file_ns::node_shader_gpu_light_falloff; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_light_path.cc b/source/blender/nodes/shader/nodes/node_shader_light_path.cc index 268a80af0ab..b04b2a2f022 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_path.cc +++ b/source/blender/nodes/shader/nodes/node_shader_light_path.cc @@ -42,7 +42,7 @@ void register_node_type_sh_light_path() sh_node_type_base(&ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_light_path); + ntype.gpu_fn = file_ns::node_shader_gpu_light_path; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc index e0c1778f764..a906ee40b42 100644 --- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc +++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc @@ -502,11 +502,11 @@ void register_node_type_sh_map_range() ntype.declare = file_ns::sh_node_map_range_declare; ntype.draw_buttons = file_ns::node_shader_buts_map_range; ntype.ui_class = file_ns::node_shader_map_range_ui_class; - node_type_init(&ntype, file_ns::node_shader_init_map_range); + ntype.initfunc = file_ns::node_shader_init_map_range; node_type_storage( &ntype, "NodeMapRange", node_free_standard_storage, node_copy_standard_storage); - node_type_update(&ntype, file_ns::node_shader_update_map_range); - node_type_gpu(&ntype, file_ns::gpu_shader_map_range); + ntype.updatefunc = file_ns::node_shader_update_map_range; + ntype.gpu_fn = file_ns::gpu_shader_map_range; ntype.build_multi_function = file_ns::sh_node_map_range_build_multi_function; ntype.gather_link_search_ops = file_ns::node_map_range_gather_link_searches; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.cc b/source/blender/nodes/shader/nodes/node_shader_mapping.cc index 89cd5af045b..f9cac93544f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.cc @@ -87,8 +87,8 @@ void register_node_type_sh_mapping() sh_node_type_base(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_mapping; - node_type_gpu(&ntype, file_ns::gpu_shader_mapping); - node_type_update(&ntype, file_ns::node_shader_update_mapping); + ntype.gpu_fn = file_ns::gpu_shader_mapping; + ntype.updatefunc = file_ns::node_shader_update_mapping; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc index 3f25da4652d..5fe1bb48cc2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_math.cc @@ -190,8 +190,8 @@ void register_node_type_sh_math() sh_fn_node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_math_declare; ntype.labelfunc = node_math_label; - node_type_gpu(&ntype, file_ns::gpu_shader_math); - node_type_update(&ntype, node_math_update); + ntype.gpu_fn = file_ns::gpu_shader_math; + ntype.updatefunc = node_math_update; ntype.build_multi_function = file_ns::sh_node_math_build_multi_function; ntype.gather_link_search_ops = file_ns::sh_node_math_gather_link_searches; diff --git a/source/blender/nodes/shader/nodes/node_shader_mix.cc b/source/blender/nodes/shader/nodes/node_shader_mix.cc index 878648105d1..bc928ddb49a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mix.cc @@ -456,9 +456,9 @@ void register_node_type_sh_mix() sh_fn_node_type_base(&ntype, SH_NODE_MIX, "Mix", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_mix_declare; ntype.ui_class = file_ns::sh_node_mix_ui_class; - node_type_gpu(&ntype, file_ns::gpu_shader_mix); - node_type_update(&ntype, file_ns::sh_node_mix_update); - node_type_init(&ntype, file_ns::node_mix_init); + ntype.gpu_fn = file_ns::gpu_shader_mix; + ntype.updatefunc = file_ns::sh_node_mix_update; + ntype.initfunc = file_ns::node_mix_init; node_type_storage( &ntype, "NodeShaderMix", node_free_standard_storage, node_copy_standard_storage); ntype.build_multi_function = file_ns::sh_node_mix_build_multi_function; diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc index d1578b48c79..98771098f81 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mix_rgb.cc @@ -153,7 +153,7 @@ void register_node_type_sh_mix_rgb() sh_fn_node_type_base(&ntype, SH_NODE_MIX_RGB_LEGACY, "Mix (Legacy)", NODE_CLASS_OP_COLOR); ntype.declare = file_ns::sh_node_mix_rgb_declare; ntype.labelfunc = node_blend_label; - node_type_gpu(&ntype, file_ns::gpu_shader_mix_rgb); + ntype.gpu_fn = file_ns::gpu_shader_mix_rgb; ntype.build_multi_function = file_ns::sh_node_mix_rgb_build_multi_function; ntype.gather_link_search_ops = nullptr; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_mix_shader.cc b/source/blender/nodes/shader/nodes/node_shader_mix_shader.cc index 27e41406b48..135e3582483 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mix_shader.cc +++ b/source/blender/nodes/shader/nodes/node_shader_mix_shader.cc @@ -33,7 +33,7 @@ void register_node_type_sh_mix_shader() sh_node_type_base(&ntype, SH_NODE_MIX_SHADER, "Mix Shader", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_mix_shader); + ntype.gpu_fn = file_ns::node_shader_gpu_mix_shader; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_normal.cc b/source/blender/nodes/shader/nodes/node_shader_normal.cc index 49c075ac27e..c36744524f4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal.cc +++ b/source/blender/nodes/shader/nodes/node_shader_normal.cc @@ -44,7 +44,7 @@ void register_node_type_sh_normal() sh_node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_normal); + ntype.gpu_fn = file_ns::gpu_shader_normal; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.cc b/source/blender/nodes/shader/nodes/node_shader_normal_map.cc index 99cb5f6f525..4338cfd9457 100644 --- a/source/blender/nodes/shader/nodes/node_shader_normal_map.cc +++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.cc @@ -118,10 +118,10 @@ void register_node_type_sh_normal_map() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_normal_map; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_normal_map); + ntype.initfunc = file_ns::node_shader_init_normal_map; node_type_storage( &ntype, "NodeShaderNormalMap", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::gpu_shader_normal_map); + ntype.gpu_fn = file_ns::gpu_shader_normal_map; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_object_info.cc b/source/blender/nodes/shader/nodes/node_shader_object_info.cc index 210f855b9e0..daa40d8dc63 100644 --- a/source/blender/nodes/shader/nodes/node_shader_object_info.cc +++ b/source/blender/nodes/shader/nodes/node_shader_object_info.cc @@ -37,7 +37,7 @@ void register_node_type_sh_object_info() sh_node_type_base(&ntype, SH_NODE_OBJECT_INFO, "Object Info", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_object_info); + ntype.gpu_fn = file_ns::node_shader_gpu_object_info; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_output_aov.cc b/source/blender/nodes/shader/nodes/node_shader_output_aov.cc index cc95db9d333..b668b5313ba 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_aov.cc +++ b/source/blender/nodes/shader/nodes/node_shader_output_aov.cc @@ -60,10 +60,10 @@ void register_node_type_sh_output_aov() sh_node_type_base(&ntype, SH_NODE_OUTPUT_AOV, "AOV Output", NODE_CLASS_OUTPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_output_aov; - node_type_init(&ntype, file_ns::node_shader_init_output_aov); + ntype.initfunc = file_ns::node_shader_init_output_aov; node_type_storage( &ntype, "NodeShaderOutputAOV", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_output_aov); + ntype.gpu_fn = file_ns::node_shader_gpu_output_aov; ntype.no_muting = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_output_light.cc b/source/blender/nodes/shader/nodes/node_shader_output_light.cc index 6e4483dbbe9..848e6c92e17 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_light.cc +++ b/source/blender/nodes/shader/nodes/node_shader_output_light.cc @@ -37,7 +37,7 @@ void register_node_type_sh_output_light() sh_node_type_base(&ntype, SH_NODE_OUTPUT_LIGHT, "Light Output", NODE_CLASS_OUTPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_output_light); + ntype.gpu_fn = file_ns::node_shader_gpu_output_light; ntype.no_muting = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.cc b/source/blender/nodes/shader/nodes/node_shader_output_material.cc index 857c5eb68df..ff2628a891b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_material.cc +++ b/source/blender/nodes/shader/nodes/node_shader_output_material.cc @@ -53,7 +53,7 @@ void register_node_type_sh_output_material() sh_node_type_base(&ntype, SH_NODE_OUTPUT_MATERIAL, "Material Output", NODE_CLASS_OUTPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_output_material); + ntype.gpu_fn = file_ns::node_shader_gpu_output_material; ntype.no_muting = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_output_world.cc b/source/blender/nodes/shader/nodes/node_shader_output_world.cc index f450e667cd9..2d75faa9e80 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_world.cc +++ b/source/blender/nodes/shader/nodes/node_shader_output_world.cc @@ -40,7 +40,7 @@ void register_node_type_sh_output_world() sh_node_type_base(&ntype, SH_NODE_OUTPUT_WORLD, "World Output", NODE_CLASS_OUTPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_output_world); + ntype.gpu_fn = file_ns::node_shader_gpu_output_world; ntype.no_muting = true; diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.cc b/source/blender/nodes/shader/nodes/node_shader_particle_info.cc index 76a91ab60aa..c86bb5866dd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_particle_info.cc +++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.cc @@ -44,7 +44,7 @@ void register_node_type_sh_particle_info() sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_particle_info); + ntype.gpu_fn = file_ns::gpu_shader_particle_info; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_point_info.cc b/source/blender/nodes/shader/nodes/node_shader_point_info.cc index 05b649490e4..fffa3abad03 100644 --- a/source/blender/nodes/shader/nodes/node_shader_point_info.cc +++ b/source/blender/nodes/shader/nodes/node_shader_point_info.cc @@ -32,7 +32,7 @@ void register_node_type_sh_point_info() sh_node_type_base(&ntype, SH_NODE_POINT_INFO, "Point Info", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_point_info); + ntype.gpu_fn = file_ns::node_shader_gpu_point_info; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_rgb.cc index 1adbbbc48bc..d70df4a8e25 100644 --- a/source/blender/nodes/shader/nodes/node_shader_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_rgb.cc @@ -35,7 +35,7 @@ void register_node_type_sh_rgb() sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_rgb); + ntype.gpu_fn = file_ns::gpu_shader_rgb; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_rgb_to_bw.cc b/source/blender/nodes/shader/nodes/node_shader_rgb_to_bw.cc index 1db3342733b..1e663d1b86f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_rgb_to_bw.cc +++ b/source/blender/nodes/shader/nodes/node_shader_rgb_to_bw.cc @@ -36,7 +36,7 @@ void register_node_type_sh_rgbtobw() sh_node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_rgbtobw_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_rgbtobw); + ntype.gpu_fn = file_ns::gpu_shader_rgbtobw; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_script.cc b/source/blender/nodes/shader/nodes/node_shader_script.cc index 8534ce129b4..213de85cb15 100644 --- a/source/blender/nodes/shader/nodes/node_shader_script.cc +++ b/source/blender/nodes/shader/nodes/node_shader_script.cc @@ -86,7 +86,7 @@ void register_node_type_sh_script() sh_node_type_base(&ntype, SH_NODE_SCRIPT, "Script", NODE_CLASS_SCRIPT); ntype.draw_buttons = file_ns::node_shader_buts_script; ntype.draw_buttons_ex = file_ns::node_shader_buts_script_ex; - node_type_init(&ntype, file_ns::init); + ntype.initfunc = file_ns::init; node_type_storage( &ntype, "NodeShaderScript", file_ns::node_free_script, file_ns::node_copy_script); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_color.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_color.cc index 77ce6f5e4e4..94e5f19b840 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_color.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_color.cc @@ -76,11 +76,11 @@ void register_node_type_sh_sepcolor() sh_node_type_base(&ntype, SH_NODE_SEPARATE_COLOR, "Separate Color", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_sepcolor_declare; - node_type_update(&ntype, file_ns::node_sepcolor_update); - node_type_init(&ntype, node_combsep_color_init); + ntype.updatefunc = file_ns::node_sepcolor_update; + ntype.initfunc = node_combsep_color_init; node_type_storage( &ntype, "NodeCombSepColor", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::gpu_shader_sepcolor); + ntype.gpu_fn = file_ns::gpu_shader_sepcolor; nodeRegisterType(&ntype); } @@ -152,11 +152,11 @@ void register_node_type_sh_combcolor() sh_node_type_base(&ntype, SH_NODE_COMBINE_COLOR, "Combine Color", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_combcolor_declare; - node_type_update(&ntype, file_ns::node_combcolor_update); - node_type_init(&ntype, node_combsep_color_init); + ntype.updatefunc = file_ns::node_combcolor_update; + ntype.initfunc = node_combsep_color_init; node_type_storage( &ntype, "NodeCombSepColor", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::gpu_shader_combcolor); + ntype.gpu_fn = file_ns::gpu_shader_combcolor; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_hsv.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_hsv.cc index b297ead1847..66ff5f82944 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_hsv.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_hsv.cc @@ -38,7 +38,7 @@ void register_node_type_sh_sephsv() sh_node_type_base(&ntype, SH_NODE_SEPHSV_LEGACY, "Separate HSV (Legacy)", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare_sephsv; - node_type_gpu(&ntype, file_ns::gpu_shader_sephsv); + ntype.gpu_fn = file_ns::gpu_shader_sephsv; ntype.gather_link_search_ops = nullptr; nodeRegisterType(&ntype); @@ -75,7 +75,7 @@ void register_node_type_sh_combhsv() sh_node_type_base(&ntype, SH_NODE_COMBHSV_LEGACY, "Combine HSV (Legacy)", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare_combhsv; - node_type_gpu(&ntype, file_ns::gpu_shader_combhsv); + ntype.gpu_fn = file_ns::gpu_shader_combhsv; ntype.gather_link_search_ops = nullptr; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc index c298998cad5..28c4eef823f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_rgb.cc @@ -79,7 +79,7 @@ void register_node_type_sh_seprgb() sh_fn_node_type_base( &ntype, SH_NODE_SEPRGB_LEGACY, "Separate RGB (Legacy)", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_seprgb_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_seprgb); + ntype.gpu_fn = file_ns::gpu_shader_seprgb; ntype.build_multi_function = file_ns::sh_node_seprgb_build_multi_function; ntype.gather_link_search_ops = nullptr; @@ -124,7 +124,7 @@ void register_node_type_sh_combrgb() sh_fn_node_type_base( &ntype, SH_NODE_COMBRGB_LEGACY, "Combine RGB (Legacy)", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_combrgb_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_combrgb); + ntype.gpu_fn = file_ns::gpu_shader_combrgb; ntype.build_multi_function = file_ns::sh_node_combrgb_build_multi_function; ntype.gather_link_search_ops = nullptr; diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc b/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc index 8849824ec0b..131ae16ef1b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc +++ b/source/blender/nodes/shader/nodes/node_shader_sepcomb_xyz.cc @@ -97,7 +97,7 @@ void register_node_type_sh_sepxyz() sh_fn_node_type_base(&ntype, SH_NODE_SEPXYZ, "Separate XYZ", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_sepxyz_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_sepxyz); + ntype.gpu_fn = file_ns::gpu_shader_sepxyz; ntype.build_multi_function = file_ns::sh_node_sepxyz_build_multi_function; nodeRegisterType(&ntype); @@ -142,7 +142,7 @@ void register_node_type_sh_combxyz() sh_fn_node_type_base(&ntype, SH_NODE_COMBXYZ, "Combine XYZ", NODE_CLASS_CONVERTER); ntype.declare = file_ns::sh_node_combxyz_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_combxyz); + ntype.gpu_fn = file_ns::gpu_shader_combxyz; ntype.build_multi_function = file_ns::sh_node_combxyz_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_shader_to_rgb.cc b/source/blender/nodes/shader/nodes/node_shader_shader_to_rgb.cc index 7345e374937..38ae1f979a8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_shader_to_rgb.cc +++ b/source/blender/nodes/shader/nodes/node_shader_shader_to_rgb.cc @@ -34,7 +34,7 @@ void register_node_type_sh_shadertorgb() sh_node_type_base(&ntype, SH_NODE_SHADERTORGB, "Shader to RGB", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_shadertorgb); + ntype.gpu_fn = file_ns::node_shader_gpu_shadertorgb; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.cc b/source/blender/nodes/shader/nodes/node_shader_squeeze.cc index 62e21088791..31965c5e13e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.cc +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.cc @@ -36,7 +36,7 @@ void register_node_type_sh_squeeze() sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_squeeze); + ntype.gpu_fn = file_ns::gpu_shader_squeeze; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.cc b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.cc index 29d42b20a80..bcf859251e3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.cc +++ b/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.cc @@ -87,9 +87,9 @@ void register_node_type_sh_subsurface_scattering() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_subsurface; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_subsurface_scattering); - node_type_gpu(&ntype, file_ns::node_shader_gpu_subsurface_scattering); - node_type_update(&ntype, file_ns::node_shader_update_subsurface_scattering); + ntype.initfunc = file_ns::node_shader_init_subsurface_scattering; + ntype.gpu_fn = file_ns::node_shader_gpu_subsurface_scattering; + ntype.updatefunc = file_ns::node_shader_update_subsurface_scattering; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_tangent.cc b/source/blender/nodes/shader/nodes/node_shader_tangent.cc index c2116c9c0ff..9b09eb09bba 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tangent.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tangent.cc @@ -89,8 +89,8 @@ void register_node_type_sh_tangent() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_tangent; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_tangent); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tangent); + ntype.initfunc = file_ns::node_shader_init_tangent; + ntype.gpu_fn = file_ns::node_shader_gpu_tangent; node_type_storage( &ntype, "NodeShaderTangent", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc b/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc index f6bcedbd19e..aaae1369d79 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.cc @@ -283,10 +283,10 @@ void register_node_type_sh_tex_brick() ntype.declare = file_ns::sh_node_tex_brick_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_brick; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_tex_brick); + ntype.initfunc = file_ns::node_shader_init_tex_brick; node_type_storage( &ntype, "NodeTexBrick", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_brick); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_brick; ntype.build_multi_function = file_ns::sh_node_brick_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc b/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc index c48f79698bb..bef3eb990eb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.cc @@ -111,10 +111,10 @@ void register_node_type_sh_tex_checker() sh_fn_node_type_base(&ntype, SH_NODE_TEX_CHECKER, "Checker Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_checker_declare; - node_type_init(&ntype, file_ns::node_shader_init_tex_checker); + ntype.initfunc = file_ns::node_shader_init_tex_checker; node_type_storage( &ntype, "NodeTexChecker", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_checker); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_checker; ntype.build_multi_function = file_ns::sh_node_tex_checker_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc b/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc index 1edf8c2aa55..a295bda9d07 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.cc @@ -82,7 +82,7 @@ void register_node_type_sh_tex_coord() sh_node_type_base(&ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_coord; - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_coord); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_coord; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc b/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc index a145bce3f6f..60059a8f1c5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc @@ -125,10 +125,10 @@ void register_node_type_sh_tex_environment() sh_node_type_base(&ntype, SH_NODE_TEX_ENVIRONMENT, "Environment Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_shader_init_tex_environment); + ntype.initfunc = file_ns::node_shader_init_tex_environment; node_type_storage( &ntype, "NodeTexEnvironment", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_environment); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_environment; ntype.labelfunc = node_image_label; node_type_size_preset(&ntype, NODE_SIZE_LARGE); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc index 75c469fe665..f7bff442420 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.cc @@ -157,10 +157,10 @@ void register_node_type_sh_tex_gradient() sh_fn_node_type_base(&ntype, SH_NODE_TEX_GRADIENT, "Gradient Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_gradient_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_gradient; - node_type_init(&ntype, file_ns::node_shader_init_tex_gradient); + ntype.initfunc = file_ns::node_shader_init_tex_gradient; node_type_storage( &ntype, "NodeTexGradient", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_gradient); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_gradient; ntype.build_multi_function = file_ns::sh_node_gradient_tex_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.cc b/source/blender/nodes/shader/nodes/node_shader_tex_image.cc index 80398871625..9f4f885fee1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.cc @@ -163,10 +163,10 @@ void register_node_type_sh_tex_image() sh_node_type_base(&ntype, SH_NODE_TEX_IMAGE, "Image Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_image_declare; - node_type_init(&ntype, file_ns::node_shader_init_tex_image); + ntype.initfunc = file_ns::node_shader_init_tex_image; node_type_storage( &ntype, "NodeTexImage", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_image); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_image; ntype.labelfunc = node_image_label; node_type_size_preset(&ntype, NODE_SIZE_LARGE); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc b/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc index b2ba0e52f02..f68f1747b21 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.cc @@ -177,10 +177,10 @@ void register_node_type_sh_tex_magic() sh_fn_node_type_base(&ntype, SH_NODE_TEX_MAGIC, "Magic Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_magic_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_magic; - node_type_init(&ntype, file_ns::node_shader_init_tex_magic); + ntype.initfunc = file_ns::node_shader_init_tex_magic; node_type_storage( &ntype, "NodeTexMagic", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_magic); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_magic; ntype.build_multi_function = file_ns::sh_node_magic_tex_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc index 9a7573fc870..e79b12b78b9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc @@ -535,11 +535,11 @@ void register_node_type_sh_tex_musgrave() ntype.declare = file_ns::sh_node_tex_musgrave_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_musgrave; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_tex_musgrave); + ntype.initfunc = file_ns::node_shader_init_tex_musgrave; node_type_storage( &ntype, "NodeTexMusgrave", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_musgrave); - node_type_update(&ntype, file_ns::node_shader_update_tex_musgrave); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_musgrave; + ntype.updatefunc = file_ns::node_shader_update_tex_musgrave; ntype.build_multi_function = file_ns::sh_node_musgrave_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc index 684c122f7fe..d72e9c3c451 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.cc @@ -249,11 +249,11 @@ void register_node_type_sh_tex_noise() sh_fn_node_type_base(&ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_noise_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_noise; - node_type_init(&ntype, file_ns::node_shader_init_tex_noise); + ntype.initfunc = file_ns::node_shader_init_tex_noise; node_type_storage( &ntype, "NodeTexNoise", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_noise); - node_type_update(&ntype, file_ns::node_shader_update_tex_noise); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_noise; + ntype.updatefunc = file_ns::node_shader_update_tex_noise; ntype.build_multi_function = file_ns::sh_node_noise_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc index 0d10d5a5047..4005265e49a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_pointdensity.cc @@ -103,7 +103,7 @@ void register_node_type_sh_tex_pointdensity() sh_node_type_base(&ntype, SH_NODE_TEX_POINTDENSITY, "Point Density", NODE_CLASS_TEXTURE); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_pointdensity; - node_type_init(&ntype, file_ns::node_shader_init_tex_pointdensity); + ntype.initfunc = file_ns::node_shader_init_tex_pointdensity; node_type_storage(&ntype, "NodeShaderTexPointDensity", file_ns::node_shader_free_tex_pointdensity, diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc index 44df6b2b1a1..faa0c0f0888 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc @@ -308,11 +308,11 @@ void register_node_type_sh_tex_sky() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_sky; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_tex_sky); + ntype.initfunc = file_ns::node_shader_init_tex_sky; node_type_storage(&ntype, "NodeTexSky", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_sky); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_sky; /* Remove vector input for Nishita sky model. */ - node_type_update(&ntype, file_ns::node_shader_update_sky); + ntype.updatefunc = file_ns::node_shader_update_sky; ntype.gather_link_search_ops = file_ns::node_gather_link_searches; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc index 0ef73f0c5ef..f07ef1b6c60 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc @@ -1347,11 +1347,11 @@ void register_node_type_sh_tex_voronoi() sh_fn_node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_voronoi_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_voronoi; - node_type_init(&ntype, file_ns::node_shader_init_tex_voronoi); + ntype.initfunc = file_ns::node_shader_init_tex_voronoi; node_type_storage( &ntype, "NodeTexVoronoi", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_voronoi); - node_type_update(&ntype, file_ns::node_shader_update_tex_voronoi); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_voronoi; + ntype.updatefunc = file_ns::node_shader_update_tex_voronoi; ntype.build_multi_function = file_ns::sh_node_voronoi_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc index 91dbc149f78..f4effe28815 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.cc @@ -224,9 +224,9 @@ void register_node_type_sh_tex_wave() ntype.declare = file_ns::sh_node_tex_wave_declare; ntype.draw_buttons = file_ns::node_shader_buts_tex_wave; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_tex_wave); + ntype.initfunc = file_ns::node_shader_init_tex_wave; node_type_storage(&ntype, "NodeTexWave", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_tex_wave); + ntype.gpu_fn = file_ns::node_shader_gpu_tex_wave; ntype.build_multi_function = file_ns::sh_node_wave_tex_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc b/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc index 9a026567682..58787a9afa3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_white_noise.cc @@ -194,9 +194,9 @@ void register_node_type_sh_tex_white_noise() sh_fn_node_type_base(&ntype, SH_NODE_TEX_WHITE_NOISE, "White Noise Texture", NODE_CLASS_TEXTURE); ntype.declare = file_ns::sh_node_tex_white_noise_declare; ntype.draw_buttons = file_ns::node_shader_buts_white_noise; - node_type_init(&ntype, file_ns::node_shader_init_tex_white_noise); - node_type_gpu(&ntype, file_ns::gpu_shader_tex_white_noise); - node_type_update(&ntype, file_ns::node_shader_update_tex_white_noise); + ntype.initfunc = file_ns::node_shader_init_tex_white_noise; + ntype.gpu_fn = file_ns::gpu_shader_tex_white_noise; + ntype.updatefunc = file_ns::node_shader_update_tex_white_noise; ntype.build_multi_function = file_ns::sh_node_noise_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_uvmap.cc b/source/blender/nodes/shader/nodes/node_shader_uvmap.cc index e9d2b32bfd7..483e06f1192 100644 --- a/source/blender/nodes/shader/nodes/node_shader_uvmap.cc +++ b/source/blender/nodes/shader/nodes/node_shader_uvmap.cc @@ -70,10 +70,10 @@ void register_node_type_sh_uvmap() ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_uvmap; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, file_ns::node_shader_init_uvmap); + ntype.initfunc = file_ns::node_shader_init_uvmap; node_type_storage( &ntype, "NodeShaderUVMap", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_uvmap); + ntype.gpu_fn = file_ns::node_shader_gpu_uvmap; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_value.cc b/source/blender/nodes/shader/nodes/node_shader_value.cc index 0cd1a1f05f8..c190438c417 100644 --- a/source/blender/nodes/shader/nodes/node_shader_value.cc +++ b/source/blender/nodes/shader/nodes/node_shader_value.cc @@ -42,7 +42,7 @@ void register_node_type_sh_value() sh_fn_node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT); ntype.declare = file_ns::sh_node_value_declare; - node_type_gpu(&ntype, file_ns::gpu_shader_value); + ntype.gpu_fn = file_ns::gpu_shader_value; ntype.build_multi_function = file_ns::sh_node_value_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.cc b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.cc index 64484f83320..c9e4f9c8e14 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_displacement.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_displacement.cc @@ -52,8 +52,8 @@ void register_node_type_sh_vector_displacement() sh_node_type_base( &ntype, SH_NODE_VECTOR_DISPLACEMENT, "Vector Displacement", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::node_declare; - node_type_init(&ntype, file_ns::node_shader_init_vector_displacement); - node_type_gpu(&ntype, file_ns::gpu_shader_vector_displacement); + ntype.initfunc = file_ns::node_shader_init_vector_displacement; + ntype.gpu_fn = file_ns::gpu_shader_vector_displacement; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc index 42b84617996..f7cf70aa8e1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc @@ -322,8 +322,8 @@ void register_node_type_sh_vect_math() ntype.declare = file_ns::sh_node_vector_math_declare; ntype.draw_buttons = file_ns::node_shader_buts_vect_math; ntype.labelfunc = node_vector_math_label; - node_type_gpu(&ntype, file_ns::gpu_shader_vector_math); - node_type_update(&ntype, file_ns::node_shader_update_vector_math); + ntype.gpu_fn = file_ns::gpu_shader_vector_math; + ntype.updatefunc = file_ns::node_shader_update_vector_math; ntype.build_multi_function = file_ns::sh_node_vector_math_build_multi_function; ntype.gather_link_search_ops = file_ns::sh_node_vector_math_gather_link_searches; diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc b/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc index 218ed0e54c9..bdf7360873d 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_rotate.cc @@ -212,8 +212,8 @@ void register_node_type_sh_vector_rotate() sh_fn_node_type_base(&ntype, SH_NODE_VECTOR_ROTATE, "Vector Rotate", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::sh_node_vector_rotate_declare; ntype.draw_buttons = file_ns::node_shader_buts_vector_rotate; - node_type_gpu(&ntype, file_ns::gpu_shader_vector_rotate); - node_type_update(&ntype, file_ns::node_shader_update_vector_rotate); + ntype.gpu_fn = file_ns::gpu_shader_vector_rotate; + ntype.updatefunc = file_ns::node_shader_update_vector_rotate; ntype.build_multi_function = file_ns::sh_node_vector_rotate_build_multi_function; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc b/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc index 9037c6208fb..03fb954f088 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc @@ -144,10 +144,10 @@ void register_node_type_sh_vect_transform() sh_node_type_base(&ntype, SH_NODE_VECT_TRANSFORM, "Vector Transform", NODE_CLASS_OP_VECTOR); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_vect_transform; - node_type_init(&ntype, file_ns::node_shader_init_vect_transform); + ntype.initfunc = file_ns::node_shader_init_vect_transform; node_type_storage( &ntype, "NodeShaderVectTransform", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::gpu_shader_vect_transform); + ntype.gpu_fn = file_ns::gpu_shader_vect_transform; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc index 6e2325bddf9..8f7e30b99df 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vertex_color.cc @@ -69,10 +69,10 @@ void register_node_type_sh_vertex_color() sh_node_type_base(&ntype, SH_NODE_VERTEX_COLOR, "Color Attribute", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_vertex_color; - node_type_init(&ntype, file_ns::node_shader_init_vertex_color); + ntype.initfunc = file_ns::node_shader_init_vertex_color; node_type_storage( &ntype, "NodeShaderVertexColor", node_free_standard_storage, node_copy_standard_storage); - node_type_gpu(&ntype, file_ns::node_shader_gpu_vertex_color); + ntype.gpu_fn = file_ns::node_shader_gpu_vertex_color; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_absorption.cc b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.cc index d6a29f537ff..e50331585e3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_absorption.cc +++ b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.cc @@ -33,7 +33,7 @@ void register_node_type_sh_volume_absorption() sh_node_type_base(&ntype, SH_NODE_VOLUME_ABSORPTION, "Volume Absorption", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_volume_absorption); + ntype.gpu_fn = file_ns::node_shader_gpu_volume_absorption; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_info.cc b/source/blender/nodes/shader/nodes/node_shader_volume_info.cc index 9f1feedc336..6a1bc070f68 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_info.cc +++ b/source/blender/nodes/shader/nodes/node_shader_volume_info.cc @@ -49,7 +49,7 @@ void register_node_type_sh_volume_info() sh_node_type_base(&ntype, SH_NODE_VOLUME_INFO, "Volume Info", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_volume_info); + ntype.gpu_fn = file_ns::node_shader_gpu_volume_info; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc b/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc index 2c5811045f0..4ff57042fe4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc +++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc @@ -142,8 +142,8 @@ void register_node_type_sh_volume_principled() sh_node_type_base(&ntype, SH_NODE_VOLUME_PRINCIPLED, "Principled Volume", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_LARGE); - node_type_init(&ntype, file_ns::node_shader_init_volume_principled); - node_type_gpu(&ntype, file_ns::node_shader_gpu_volume_principled); + ntype.initfunc = file_ns::node_shader_init_volume_principled; + ntype.gpu_fn = file_ns::node_shader_gpu_volume_principled; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_scatter.cc b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.cc index 1322a73ac37..b87792eef2e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_scatter.cc +++ b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.cc @@ -38,7 +38,7 @@ void register_node_type_sh_volume_scatter() sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER); ntype.declare = file_ns::node_declare; - node_type_gpu(&ntype, file_ns::node_shader_gpu_volume_scatter); + ntype.gpu_fn = file_ns::node_shader_gpu_volume_scatter; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_wavelength.cc b/source/blender/nodes/shader/nodes/node_shader_wavelength.cc index 43bb4798e3f..6fa495c3ead 100644 --- a/source/blender/nodes/shader/nodes/node_shader_wavelength.cc +++ b/source/blender/nodes/shader/nodes/node_shader_wavelength.cc @@ -41,7 +41,7 @@ void register_node_type_sh_wavelength() sh_node_type_base(&ntype, SH_NODE_WAVELENGTH, "Wavelength", NODE_CLASS_CONVERTER); ntype.declare = file_ns::node_declare; node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_gpu(&ntype, file_ns::node_shader_gpu_wavelength); + ntype.gpu_fn = file_ns::node_shader_gpu_wavelength; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_wireframe.cc b/source/blender/nodes/shader/nodes/node_shader_wireframe.cc index ddabebfeec2..b125e7221a6 100644 --- a/source/blender/nodes/shader/nodes/node_shader_wireframe.cc +++ b/source/blender/nodes/shader/nodes/node_shader_wireframe.cc @@ -47,7 +47,7 @@ void register_node_type_sh_wireframe() sh_node_type_base(&ntype, SH_NODE_WIREFRAME, "Wireframe", NODE_CLASS_INPUT); ntype.declare = file_ns::node_declare; ntype.draw_buttons = file_ns::node_shader_buts_wireframe; - node_type_gpu(&ntype, file_ns::node_shader_gpu_wireframe); + ntype.gpu_fn = file_ns::node_shader_gpu_wireframe; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_at.c b/source/blender/nodes/texture/nodes/node_texture_at.c index 74f279d65c7..e2e635b7d92 100644 --- a/source/blender/nodes/texture/nodes/node_texture_at.c +++ b/source/blender/nodes/texture/nodes/node_texture_at.c @@ -45,7 +45,7 @@ void register_node_type_tex_at(void) tex_node_type_base(&ntype, TEX_NODE_AT, "At", NODE_CLASS_DISTORT); node_type_socket_templates(&ntype, inputs, outputs); node_type_size(&ntype, 140, 100, 320); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index bfd43560c2d..b68bf4fcb8d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -106,8 +106,8 @@ void register_node_type_tex_bricks(void) tex_node_type_base(&ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN); node_type_socket_templates(&ntype, inputs, outputs); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, init); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.initfunc = init; + ntype.exec_fn = exec; ntype.flag |= NODE_PREVIEW; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c index 08f87cb7875..d66eb7e6953 100644 --- a/source/blender/nodes/texture/nodes/node_texture_checker.c +++ b/source/blender/nodes/texture/nodes/node_texture_checker.c @@ -56,7 +56,7 @@ void register_node_type_tex_checker(void) tex_node_type_base(&ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; ntype.flag |= NODE_PREVIEW; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/texture/nodes/node_texture_combine_color.c b/source/blender/nodes/texture/nodes/node_texture_combine_color.c index 459553bc950..e6a8080bb48 100644 --- a/source/blender/nodes/texture/nodes/node_texture_combine_color.c +++ b/source/blender/nodes/texture/nodes/node_texture_combine_color.c @@ -69,8 +69,8 @@ void register_node_type_tex_combine_color(void) tex_node_type_base(&ntype, TEX_NODE_COMBINE_COLOR, "Combine Color", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); - node_type_update(&ntype, update); + ntype.exec_fn = exec; + ntype.updatefunc = update; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_common.c b/source/blender/nodes/texture/nodes/node_texture_common.c index 96345b00a82..8ff4ad61387 100644 --- a/source/blender/nodes/texture/nodes/node_texture_common.c +++ b/source/blender/nodes/texture/nodes/node_texture_common.c @@ -155,8 +155,10 @@ void register_node_type_tex_group(void) node_type_size(&ntype, 140, 60, 400); ntype.labelfunc = node_group_label; - node_type_group_update(&ntype, node_group_update); - node_type_exec(&ntype, group_initexec, group_freeexec, group_execute); + ntype.group_update_func = node_group_update; + ntype.init_exec_fn = group_initexec; + ntype.free_exec_fn = group_freeexec; + ntype.exec_fn = group_execute; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_compose.c b/source/blender/nodes/texture/nodes/node_texture_compose.c index e36bc248ed1..d41566be74c 100644 --- a/source/blender/nodes/texture/nodes/node_texture_compose.c +++ b/source/blender/nodes/texture/nodes/node_texture_compose.c @@ -45,7 +45,7 @@ void register_node_type_tex_compose(void) tex_node_type_base( &ntype, TEX_NODE_COMPOSE_LEGACY, "Combine RGBA (Legacy)", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_coord.c b/source/blender/nodes/texture/nodes/node_texture_coord.c index e74dfd378d9..1babea310f4 100644 --- a/source/blender/nodes/texture/nodes/node_texture_coord.c +++ b/source/blender/nodes/texture/nodes/node_texture_coord.c @@ -35,7 +35,7 @@ void register_node_type_tex_coord(void) tex_node_type_base(&ntype, TEX_NODE_COORD, "Coordinates", NODE_CLASS_INPUT); node_type_socket_templates(&ntype, NULL, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c index dee4531746f..df75847dbe3 100644 --- a/source/blender/nodes/texture/nodes/node_texture_curves.c +++ b/source/blender/nodes/texture/nodes/node_texture_curves.c @@ -52,9 +52,10 @@ void register_node_type_tex_curve_time(void) tex_node_type_base(&ntype, TEX_NODE_CURVE_TIME, "Time", NODE_CLASS_INPUT); node_type_socket_templates(&ntype, NULL, time_outputs); node_type_size_preset(&ntype, NODE_SIZE_LARGE); - node_type_init(&ntype, time_init); + ntype.initfunc = time_init; node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); - node_type_exec(&ntype, node_initexec_curves, NULL, time_exec); + ntype.init_exec_fn = node_initexec_curves; + ntype.exec_fn = time_exec; nodeRegisterType(&ntype); } @@ -101,9 +102,11 @@ void register_node_type_tex_curve_rgb(void) tex_node_type_base(&ntype, TEX_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, rgb_inputs, rgb_outputs); node_type_size_preset(&ntype, NODE_SIZE_LARGE); - node_type_init(&ntype, rgb_init); + ntype.initfunc = rgb_init; node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); - node_type_exec(&ntype, node_initexec_curves, NULL, rgb_exec); + ntype.init_exec_fn = node_initexec_curves ; + ntype.exec_fn =rgb_exec ; + nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_decompose.c b/source/blender/nodes/texture/nodes/node_texture_decompose.c index 2d42fa4602e..ae7e80a6aab 100644 --- a/source/blender/nodes/texture/nodes/node_texture_decompose.c +++ b/source/blender/nodes/texture/nodes/node_texture_decompose.c @@ -64,7 +64,7 @@ void register_node_type_tex_decompose(void) tex_node_type_base(&ntype, TEX_NODE_DECOMPOSE_LEGACY, "Separate RGBA", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_distance.c b/source/blender/nodes/texture/nodes/node_texture_distance.c index e236b6743a6..19918a9896e 100644 --- a/source/blender/nodes/texture/nodes/node_texture_distance.c +++ b/source/blender/nodes/texture/nodes/node_texture_distance.c @@ -46,7 +46,7 @@ void register_node_type_tex_distance(void) tex_node_type_base(&ntype, TEX_NODE_DISTANCE, "Distance", NODE_CLASS_CONVERTER); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c index 989d94953f7..454b58f4665 100644 --- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c +++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c @@ -94,7 +94,7 @@ void register_node_type_tex_hue_sat(void) tex_node_type_base(&ntype, TEX_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c index e94c78b41ea..8b859421762 100644 --- a/source/blender/nodes/texture/nodes/node_texture_image.c +++ b/source/blender/nodes/texture/nodes/node_texture_image.c @@ -94,9 +94,9 @@ void register_node_type_tex_image(void) tex_node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT); node_type_socket_templates(&ntype, NULL, outputs); - node_type_init(&ntype, init); + ntype.initfunc = init; node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; ntype.labelfunc = node_image_label; ntype.flag |= NODE_PREVIEW; diff --git a/source/blender/nodes/texture/nodes/node_texture_invert.c b/source/blender/nodes/texture/nodes/node_texture_invert.c index 6343f5f2caa..526d47bef9c 100644 --- a/source/blender/nodes/texture/nodes/node_texture_invert.c +++ b/source/blender/nodes/texture/nodes/node_texture_invert.c @@ -49,7 +49,7 @@ void register_node_type_tex_invert(void) tex_node_type_base(&ntype, TEX_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c index 5867d6b91e1..505ba51b4d8 100644 --- a/source/blender/nodes/texture/nodes/node_texture_math.c +++ b/source/blender/nodes/texture/nodes/node_texture_math.c @@ -322,8 +322,8 @@ void register_node_type_tex_math(void) tex_node_type_base(&ntype, TEX_NODE_MATH, "Math", NODE_CLASS_CONVERTER); node_type_socket_templates(&ntype, inputs, outputs); ntype.labelfunc = node_math_label; - node_type_exec(&ntype, NULL, NULL, exec); - node_type_update(&ntype, node_math_update); + ntype.exec_fn = exec; + ntype.updatefunc = node_math_update; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c index cd6b54c4cf8..15ca2280fe1 100644 --- a/source/blender/nodes/texture/nodes/node_texture_mixRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_mixRgb.c @@ -56,7 +56,7 @@ void register_node_type_tex_mix_rgb(void) tex_node_type_base(&ntype, TEX_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); ntype.labelfunc = node_blend_label; - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index 89dd8e8d8bd..b640880ba9b 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -138,9 +138,9 @@ void register_node_type_tex_output(void) tex_node_type_base(&ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT); node_type_socket_templates(&ntype, inputs, NULL); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); - node_type_init(&ntype, init); + ntype.initfunc = init; node_type_storage(&ntype, "TexNodeOutput", node_free_standard_storage, copy); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; ntype.flag |= NODE_PREVIEW; ntype.no_muting = true; diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index d925c9f3554..f23c4f55820 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -254,9 +254,9 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node) tex_node_type_base(&ntype, TEX_NODE_PROC + TEXTYPE, Name, NODE_CLASS_TEXTURE); \ node_type_socket_templates(&ntype, name##_inputs, outputs); \ node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); \ - node_type_init(&ntype, init); \ + ntype.initfunc = init; \ node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \ - node_type_exec(&ntype, NULL, NULL, name##_exec); \ + ntype.exec_fn = name##_exec; \ ntype.flag |= NODE_PREVIEW; \ \ nodeRegisterType(&ntype); \ diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c index 0bd2de76a9c..b31adefcbba 100644 --- a/source/blender/nodes/texture/nodes/node_texture_rotate.c +++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c @@ -81,7 +81,7 @@ void register_node_type_tex_rotate(void) tex_node_type_base(&ntype, TEX_NODE_ROTATE, "Rotate", NODE_CLASS_DISTORT); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_scale.c b/source/blender/nodes/texture/nodes/node_texture_scale.c index d565146cf09..93a4db7677c 100644 --- a/source/blender/nodes/texture/nodes/node_texture_scale.c +++ b/source/blender/nodes/texture/nodes/node_texture_scale.c @@ -54,7 +54,7 @@ void register_node_type_tex_scale(void) tex_node_type_base(&ntype, TEX_NODE_SCALE, "Scale", NODE_CLASS_DISTORT); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_separate_color.c b/source/blender/nodes/texture/nodes/node_texture_separate_color.c index a482a3f3421..030f7d79043 100644 --- a/source/blender/nodes/texture/nodes/node_texture_separate_color.c +++ b/source/blender/nodes/texture/nodes/node_texture_separate_color.c @@ -95,8 +95,8 @@ void register_node_type_tex_separate_color(void) tex_node_type_base(&ntype, TEX_NODE_SEPARATE_COLOR, "Separate Color", NODE_CLASS_OP_COLOR); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); - node_type_update(&ntype, update); + ntype.exec_fn = exec; + ntype.updatefunc = update; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 79cd8bbb1df..163a6516a58 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -78,7 +78,7 @@ void register_node_type_tex_texture(void) tex_node_type_base(&ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; ntype.flag |= NODE_PREVIEW; nodeRegisterType(&ntype); diff --git a/source/blender/nodes/texture/nodes/node_texture_translate.c b/source/blender/nodes/texture/nodes/node_texture_translate.c index 7ce7722938d..a8c12116097 100644 --- a/source/blender/nodes/texture/nodes/node_texture_translate.c +++ b/source/blender/nodes/texture/nodes/node_texture_translate.c @@ -50,7 +50,7 @@ void register_node_type_tex_translate(void) tex_node_type_base(&ntype, TEX_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c index 492aadf3281..d0fc5229e06 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c @@ -66,7 +66,7 @@ void register_node_type_tex_valtonor(void) tex_node_type_base(&ntype, TEX_NODE_VALTONOR, "Value to Normal", NODE_CLASS_CONVERTER); node_type_socket_templates(&ntype, inputs, outputs); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c index e41e83555fc..b2acef407e2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c @@ -50,9 +50,9 @@ void register_node_type_tex_valtorgb(void) tex_node_type_base(&ntype, TEX_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTER); node_type_socket_templates(&ntype, valtorgb_in, valtorgb_out); node_type_size_preset(&ntype, NODE_SIZE_LARGE); - node_type_init(&ntype, valtorgb_init); + ntype.initfunc = valtorgb_init; node_type_storage(&ntype, "ColorBand", node_free_standard_storage, node_copy_standard_storage); - node_type_exec(&ntype, NULL, NULL, valtorgb_exec); + ntype.exec_fn = valtorgb_exec; nodeRegisterType(&ntype); } @@ -91,7 +91,7 @@ void register_node_type_tex_rgbtobw(void) tex_node_type_base(&ntype, TEX_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTER); node_type_socket_templates(&ntype, rgbtobw_in, rgbtobw_out); - node_type_exec(&ntype, NULL, NULL, rgbtobw_exec); + ntype.exec_fn = rgbtobw_exec; nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/texture/nodes/node_texture_viewer.c b/source/blender/nodes/texture/nodes/node_texture_viewer.c index 72da751f8ef..1f31d62ed38 100644 --- a/source/blender/nodes/texture/nodes/node_texture_viewer.c +++ b/source/blender/nodes/texture/nodes/node_texture_viewer.c @@ -38,7 +38,7 @@ void register_node_type_tex_viewer(void) tex_node_type_base(&ntype, TEX_NODE_VIEWER, "Viewer", NODE_CLASS_OUTPUT); node_type_socket_templates(&ntype, inputs, NULL); - node_type_exec(&ntype, NULL, NULL, exec); + ntype.exec_fn = exec; ntype.no_muting = true; ntype.flag |= NODE_PREVIEW; diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c index 2e6d1698da9..cc413ad7924 100644 --- a/source/blender/python/bmesh/bmesh_py_api.c +++ b/source/blender/python/bmesh/bmesh_py_api.c @@ -156,14 +156,14 @@ PyDoc_STRVAR(BPy_BM_doc, ".. include:: include__bmesh.rst\n"); static struct PyModuleDef BPy_BM_module_def = { PyModuleDef_HEAD_INIT, - "bmesh", /* m_name */ - BPy_BM_doc, /* m_doc */ - 0, /* m_size */ - BPy_BM_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bmesh", + /*m_doc*/ BPy_BM_doc, + /*m_size*/ 0, + /*m_methods*/ BPy_BM_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_bmesh(void) diff --git a/source/blender/python/bmesh/bmesh_py_geometry.c b/source/blender/python/bmesh/bmesh_py_geometry.c index f2af8599807..aed197bc353 100644 --- a/source/blender/python/bmesh/bmesh_py_geometry.c +++ b/source/blender/python/bmesh/bmesh_py_geometry.c @@ -62,14 +62,14 @@ PyDoc_STRVAR(BPy_BM_utils_doc, "This module provides access to bmesh geometry evaluation functions."); static struct PyModuleDef BPy_BM_geometry_module_def = { PyModuleDef_HEAD_INIT, - "bmesh.geometry", /* m_name */ - BPy_BM_utils_doc, /* m_doc */ - 0, /* m_size */ - BPy_BM_geometry_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bmesh.geometry", + /*m_doc*/ BPy_BM_utils_doc, + /*m_size*/ 0, + /*m_methods*/ BPy_BM_geometry_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_bmesh_geometry(void) diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c index 37e2b009f55..e5ca170599f 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.c +++ b/source/blender/python/bmesh/bmesh_py_ops.c @@ -146,82 +146,54 @@ static PyGetSetDef bpy_bmesh_op_getseters[] = { * ===== */ static PyTypeObject bmesh_op_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "BMeshOpFunc", /* tp_name */ - sizeof(BPy_BMeshOpFunc), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - (reprfunc)bpy_bmesh_op_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - (ternaryfunc)BPy_BMO_call, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - bpy_bmesh_op_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_name*/ PyVarObject_HEAD_INIT(NULL, 0) "BMeshOpFunc", + /*tp_basicsize*/ sizeof(BPy_BMeshOpFunc), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)bpy_bmesh_op_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ (ternaryfunc)BPy_BMO_call, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ bpy_bmesh_op_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /* bmesh module 'bmesh.ops' @@ -263,14 +235,14 @@ static struct PyMethodDef BPy_BM_ops_methods[] = { PyDoc_STRVAR(BPy_BM_ops_doc, "Access to BMesh operators"); static struct PyModuleDef BPy_BM_ops_module_def = { PyModuleDef_HEAD_INIT, - "bmesh.ops", /* m_name */ - BPy_BM_ops_doc, /* m_doc */ - 0, /* m_size */ - BPy_BM_ops_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bmesh.ops", + /*m_doc*/ BPy_BM_ops_doc, + /*m_size*/ 0, + /*m_methods*/ BPy_BM_ops_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_bmesh_ops(void) diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 1aa20700f31..12267ef5b13 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -3314,31 +3314,30 @@ static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyOb } static PySequenceMethods bpy_bmelemseq_as_sequence = { - (lenfunc)bpy_bmelemseq_length, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)bpy_bmelemseq_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmelemseq_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)bpy_bmelemseq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)bpy_bmelemseq_subscript_int, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)bpy_bmelemseq_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmelemseq_as_mapping = { - (lenfunc)bpy_bmelemseq_length, /* mp_length */ - (binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */ - (objobjargproc)NULL, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)bpy_bmelemseq_length, + /*mp_subscript*/ (binaryfunc)bpy_bmelemseq_subscript, + /*mp_ass_subscript*/ (objobjargproc)NULL, }; /* for customdata access */ static PyMappingMethods bpy_bm_elem_as_mapping = { - (lenfunc)NULL, - /* mp_length */ /* keep this empty, messes up 'if elem: ...' test */ - (binaryfunc)bpy_bmelem_subscript, /* mp_subscript */ - (objobjargproc)bpy_bmelem_ass_subscript, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)NULL, /* Keep this empty, messes up `if elem: ...` test. */ + /*mp_subscript*/ (binaryfunc)bpy_bmelem_subscript, + /*mp_ass_subscript*/ (objobjargproc)bpy_bmelem_ass_subscript, }; /* Iterator @@ -3737,14 +3736,14 @@ void BPy_BM_init_types(void) static struct PyModuleDef BPy_BM_types_module_def = { PyModuleDef_HEAD_INIT, - "bmesh.types", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bmesh.types", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_bmesh_types(void) diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 00b8f579021..1288083f8e7 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -872,23 +872,23 @@ static int bpy_bmlayercollection_contains(BPy_BMLayerCollection *self, PyObject } static PySequenceMethods bpy_bmlayercollection_as_sequence = { - (lenfunc)bpy_bmlayercollection_length, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)bpy_bmlayercollection_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmlayercollection_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)bpy_bmlayercollection_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)bpy_bmlayercollection_subscript_int, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)bpy_bmlayercollection_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmlayercollection_as_mapping = { - (lenfunc)bpy_bmlayercollection_length, /* mp_length */ - (binaryfunc)bpy_bmlayercollection_subscript, /* mp_subscript */ - (objobjargproc)NULL, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)bpy_bmlayercollection_length, + /*mp_subscript*/ (binaryfunc)bpy_bmlayercollection_subscript, + /*mp_ass_subscript*/ (objobjargproc)NULL, }; /* Iterator diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index fc2e70221a0..9bd98f2df53 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -486,26 +486,24 @@ static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value) /* only defined for __contains__ */ static PySequenceMethods bpy_bmdeformvert_as_sequence = { - (lenfunc)bpy_bmdeformvert_len, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - + /*sq_length*/ (lenfunc)bpy_bmdeformvert_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, /* NOTE: if this is set #PySequence_Check() returns True, * but in this case we don't want to be treated as a seq. */ - NULL, /* sq_item */ - - NULL, /* sq_slice */ - NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmdeformvert_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)bpy_bmdeformvert_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmdeformvert_as_mapping = { - (lenfunc)bpy_bmdeformvert_len, - (binaryfunc)bpy_bmdeformvert_subscript, - (objobjargproc)bpy_bmdeformvert_ass_subscript, + /*mp_len*/ (lenfunc)bpy_bmdeformvert_len, + /*mp_subscript*/ (binaryfunc)bpy_bmdeformvert_subscript, + /*mp_ass_subscript*/ (objobjargproc)bpy_bmdeformvert_ass_subscript, }; /* Methods diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c index 01d555c00ca..ed25caee74d 100644 --- a/source/blender/python/bmesh/bmesh_py_types_select.c +++ b/source/blender/python/bmesh/bmesh_py_types_select.c @@ -291,23 +291,23 @@ static int bpy_bmeditselseq_contains(BPy_BMEditSelSeq *self, PyObject *value) } static PySequenceMethods bpy_bmeditselseq_as_sequence = { - (lenfunc)bpy_bmeditselseq_length, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)bpy_bmeditselseq_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmeditselseq_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)bpy_bmeditselseq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)bpy_bmeditselseq_subscript_int, + /*sq_slice */ NULL, + /*sq_ass_item */ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)bpy_bmeditselseq_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmeditselseq_as_mapping = { - (lenfunc)bpy_bmeditselseq_length, /* mp_length */ - (binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */ - (objobjargproc)NULL, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)bpy_bmeditselseq_length, + /*mp_subscript*/ (binaryfunc)bpy_bmeditselseq_subscript, + /*mp_ass_subscript*/ (objobjargproc)NULL, }; /* Iterator diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index 6630eb4924e..5eca6f854f6 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -818,14 +818,14 @@ static struct PyMethodDef BPy_BM_utils_methods[] = { PyDoc_STRVAR(BPy_BM_utils_doc, "This module provides access to blenders bmesh data structures."); static struct PyModuleDef BPy_BM_utils_module_def = { PyModuleDef_HEAD_INIT, - "bmesh.utils", /* m_name */ - BPy_BM_utils_doc, /* m_doc */ - 0, /* m_size */ - BPy_BM_utils_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bmesh.utils", + /*m_doc*/ BPy_BM_utils_doc, + /*m_size*/ 0, + /*m_methods*/ BPy_BM_utils_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_bmesh_utils(void) diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index 07ee3ed8752..fe64b247d43 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -491,22 +491,22 @@ static bool compare_dimensions(int ndim, const int *dim1, const Py_ssize_t *dim2 * \{ */ static PySequenceMethods Buffer_SeqMethods = { - (lenfunc)Buffer_len, /* sq_length */ - (binaryfunc)NULL, /* sq_concat */ - (ssizeargfunc)NULL, /* sq_repeat */ - (ssizeargfunc)Buffer_item, /* sq_item */ - (ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in Buffer_item */ - (ssizeobjargproc)Buffer_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in Buffer_ass_item */ - (objobjproc)NULL, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)Buffer_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Buffer_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #Buffer_item. */ + /*sq_ass_item*/ (ssizeobjargproc)Buffer_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #Buffer_ass_item. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Buffer_AsMapping = { - (lenfunc)Buffer_len, - (binaryfunc)Buffer_subscript, - (objobjargproc)Buffer_ass_subscript, + /*mp_len*/ (lenfunc)Buffer_len, + /*mp_subscript*/ (binaryfunc)Buffer_subscript, + /*mp_ass_subscript*/ (objobjargproc)Buffer_ass_subscript, }; static void Buffer_dealloc(Buffer *self); @@ -568,72 +568,55 @@ static PyGetSetDef Buffer_getseters[] = { }; PyTypeObject BGL_bufferType = { - PyVarObject_HEAD_INIT(NULL, 0) "bgl.Buffer", /* tp_name */ - sizeof(Buffer), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Buffer_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Buffer_repr, /* tp_repr */ - NULL, /* tp_as_number */ - &Buffer_SeqMethods, /* tp_as_sequence */ - &Buffer_AsMapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - Buffer_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - Buffer_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /*tp_base*/ - NULL, /*tp_dict*/ - NULL, /*tp_descr_get*/ - NULL, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - NULL, /*tp_init*/ - NULL, /*tp_alloc*/ - Buffer_new, /*tp_new*/ - NULL, /*tp_free*/ - NULL, /*tp_is_gc*/ - NULL, /*tp_bases*/ - NULL, /*tp_mro*/ - NULL, /*tp_cache*/ - NULL, /*tp_subclasses*/ - NULL, /*tp_weaklist*/ - NULL, /*tp_del*/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bgl.Buffer", + /*tp_basicsize*/ sizeof(Buffer), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Buffer_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Buffer_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &Buffer_SeqMethods, + /*tp_as_mapping*/ &Buffer_AsMapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Buffer_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Buffer_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Buffer_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static Buffer *BGL_MakeBuffer_FromData( @@ -1393,14 +1376,14 @@ BGL_Wrap(TexImage3DMultisample, static struct PyModuleDef BGL_module_def = { PyModuleDef_HEAD_INIT, - "bgl", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bgl", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; static void py_module_dict_add_int(PyObject *dict, const char *name, int value) diff --git a/source/blender/python/generic/bl_math_py_api.c b/source/blender/python/generic/bl_math_py_api.c index 19958a99df9..47a1687d20b 100644 --- a/source/blender/python/generic/bl_math_py_api.c +++ b/source/blender/python/generic/bl_math_py_api.c @@ -129,14 +129,14 @@ static PyMethodDef M_bl_math_methods[] = { static struct PyModuleDef M_bl_math_module_def = { PyModuleDef_HEAD_INIT, - "bl_math", /* m_name */ - M_bl_math_doc, /* m_doc */ - 0, /* m_size */ - M_bl_math_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bl_math", + /*m_doc*/ M_bl_math_doc, + /*m_size*/ 0, + /*m_methods*/ M_bl_math_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyMODINIT_FUNC BPyInit_bl_math(void) diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c index 979a581463e..2b7c5ed7e55 100644 --- a/source/blender/python/generic/blf_py_api.c +++ b/source/blender/python/generic/blf_py_api.c @@ -466,14 +466,14 @@ static PyMethodDef BLF_methods[] = { PyDoc_STRVAR(BLF_doc, "This module provides access to Blender's text drawing functions."); static struct PyModuleDef BLF_module_def = { PyModuleDef_HEAD_INIT, - "blf", /* m_name */ - BLF_doc, /* m_doc */ - 0, /* m_size */ - BLF_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "blf", + /*m_doc*/ BLF_doc, + /*m_size*/ 0, + /*m_methods*/ BLF_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_blf(void) diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 9ffea65bf55..9a6568355af 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -1156,36 +1156,36 @@ static int BPy_Group_ViewItems_Contains(BPy_IDGroup_View *self, PyObject *value) } static PySequenceMethods BPy_IDGroup_ViewKeys_as_sequence = { - (lenfunc)BPy_Group_View_len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - (objobjproc)BPy_Group_ViewKeys_Contains, /* sq_contains */ + /*sq_length*/ (lenfunc)BPy_Group_View_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)BPy_Group_ViewKeys_Contains, }; static PySequenceMethods BPy_IDGroup_ViewValues_as_sequence = { - (lenfunc)BPy_Group_View_len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - (objobjproc)BPy_Group_ViewValues_Contains, /* sq_contains */ + /*sq_length*/ (lenfunc)BPy_Group_View_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)BPy_Group_ViewValues_Contains, }; static PySequenceMethods BPy_IDGroup_ViewItems_as_sequence = { - (lenfunc)BPy_Group_View_len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - (objobjproc)BPy_Group_ViewItems_Contains, /* sq_contains */ + /*sq_length*/ (lenfunc)BPy_Group_View_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)BPy_Group_ViewItems_Contains, }; /* Methods. */ @@ -1551,84 +1551,76 @@ static struct PyMethodDef BPy_IDGroup_methods[] = { * \{ */ static PySequenceMethods BPy_IDGroup_Seq = { - (lenfunc)BPy_IDGroup_Map_Len, /* lenfunc sq_length */ - NULL, /* binaryfunc sq_concat */ - NULL, /* ssizeargfunc sq_repeat */ - NULL, - /* ssizeargfunc sq_item */ /* TODO: setting this will allow PySequence_Check to return True. */ - NULL, /* intintargfunc ***was_sq_slice*** */ - NULL, /* intobjargproc sq_ass_item */ - NULL, /* ssizeobjargproc ***was_sq_ass_slice*** */ - (objobjproc)BPy_IDGroup_Contains, /* objobjproc sq_contains */ - NULL, /* binaryfunc sq_inplace_concat */ - NULL, /* ssizeargfunc sq_inplace_repeat */ + /*sq_length*/ (lenfunc)BPy_IDGroup_Map_Len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* TODO: setting this will allow `PySequence_Check()` to return True. */ + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)BPy_IDGroup_Contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods BPy_IDGroup_Mapping = { - (lenfunc)BPy_IDGroup_Map_Len, /* inquiry mp_length */ - (binaryfunc)BPy_IDGroup_Map_GetItem, /* binaryfunc mp_subscript */ - (objobjargproc)BPy_IDGroup_Map_SetItem, /* objobjargproc mp_ass_subscript */ + /*mp_len*/ (lenfunc)BPy_IDGroup_Map_Len, + /*mp_subscript*/ (binaryfunc)BPy_IDGroup_Map_GetItem, + /*mp_ass_subscript*/ (objobjargproc)BPy_IDGroup_Map_SetItem, }; PyTypeObject BPy_IDGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "IDPropertyGroup", /* char *tp_name; */ - sizeof(BPy_IDProperty), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - NULL, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)BPy_IDGroup_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - &BPy_IDGroup_Seq, /* PySequenceMethods *tp_as_sequence; */ - &BPy_IDGroup_Mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)BPy_IDGroup_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - (getiterfunc)BPy_IDGroup_iter, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - BPy_IDGroup_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - BPy_IDGroup_getseters, /* struct PyGetSetDef *tp_getset; */ + /* For printing, in format `<module>.<name>`. */ + /*tp_name*/ "IDPropertyGroup", + /*tp_basicsize*/ sizeof(BPy_IDProperty), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)BPy_IDGroup_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &BPy_IDGroup_Seq, + /*tp_as_mapping*/ &BPy_IDGroup_Mapping, + /*tp_hash*/ (hashfunc)BPy_IDGroup_hash, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)BPy_IDGroup_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ BPy_IDGroup_methods, + /*tp_members*/ NULL, + /*tp_getset*/ BPy_IDGroup_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /** \} */ @@ -1768,17 +1760,16 @@ static int BPy_IDArray_SetItem(BPy_IDArray *self, Py_ssize_t index, PyObject *va } static PySequenceMethods BPy_IDArray_Seq = { - (lenfunc)BPy_IDArray_Len, /* inquiry sq_length */ - NULL, /* binaryfunc sq_concat */ - NULL, /* intargfunc sq_repeat */ - (ssizeargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */ - NULL, /* intintargfunc sq_slice */ - (ssizeobjargproc)BPy_IDArray_SetItem, /* intobjargproc sq_ass_item */ - NULL, /* intintobjargproc sq_ass_slice */ - NULL, /* objobjproc sq_contains */ - /* Added in release 2.0 */ - NULL, /* binaryfunc sq_inplace_concat */ - NULL, /* intargfunc sq_inplace_repeat */ + /*sq_length*/ (lenfunc)BPy_IDArray_Len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)BPy_IDArray_GetItem, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)BPy_IDArray_SetItem, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; /* sequence slice (get): idparr[a:b] */ @@ -1926,9 +1917,9 @@ static int BPy_IDArray_ass_subscript(BPy_IDArray *self, PyObject *item, PyObject } static PyMappingMethods BPy_IDArray_AsMapping = { - (lenfunc)BPy_IDArray_Len, - (binaryfunc)BPy_IDArray_subscript, - (objobjargproc)BPy_IDArray_ass_subscript, + /*mp_len*/ (lenfunc)BPy_IDArray_Len, + /*mp_subscript*/ (binaryfunc)BPy_IDArray_subscript, + /*mp_ass_subscript*/ (objobjargproc)BPy_IDArray_ass_subscript, }; static int itemsize_by_idarray_type(int array_type) @@ -1971,8 +1962,8 @@ static void BPy_IDArray_releasebuffer(BPy_IDArray *UNUSED(self), Py_buffer *view } static PyBufferProcs BPy_IDArray_Buffer = { - (getbufferproc)BPy_IDArray_getbuffer, - (releasebufferproc)BPy_IDArray_releasebuffer, + /*bf_getbuffer*/ (getbufferproc)BPy_IDArray_getbuffer, + /*bf_releasebuffer*/ (releasebufferproc)BPy_IDArray_releasebuffer, }; /** \} */ @@ -1983,83 +1974,55 @@ static PyBufferProcs BPy_IDArray_Buffer = { PyTypeObject BPy_IDArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "IDPropertyArray", /* char *tp_name; */ - sizeof(BPy_IDArray), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - NULL, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)BPy_IDArray_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - &BPy_IDArray_Seq, /* PySequenceMethods *tp_as_sequence; */ - &BPy_IDArray_AsMapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - &BPy_IDArray_Buffer, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - BPy_IDArray_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - BPy_IDArray_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /* For printing, in format `<module>.<name>`. */ + /*tp_name*/ "IDPropertyArray", + /*tp_basicsize*/ sizeof(BPy_IDArray), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)BPy_IDArray_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &BPy_IDArray_Seq, + /*tp_as_mapping*/ &BPy_IDArray_AsMapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ &BPy_IDArray_Buffer, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ BPy_IDArray_methods, + /*tp_members*/ NULL, + /*tp_getset*/ BPy_IDArray_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /** \} */ @@ -2129,14 +2092,14 @@ static PyObject *BPy_IDGroup_ViewItems_CreatePyObject(BPy_IDProperty *group) static struct PyModuleDef IDProp_types_module_def = { PyModuleDef_HEAD_INIT, - "idprop.types", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "idprop.types", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; static PyObject *BPyInit_idprop_types(void) @@ -2178,14 +2141,14 @@ PyDoc_STRVAR(IDProp_module_doc, "This module provides access id property types (currently mainly for docs)."); static struct PyModuleDef IDProp_module_def = { PyModuleDef_HEAD_INIT, - "idprop", /* m_name */ - IDProp_module_doc, /* m_doc */ - 0, /* m_size */ - IDProp_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "idprop", + /*m_doc*/ IDProp_module_doc, + /*m_size*/ 0, + /*m_methods*/ IDProp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_idprop(void) diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index 890ba997548..4487a885a6c 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -660,63 +660,55 @@ static Py_hash_t BPy_IDPropertyUIManager_hash(BPy_IDPropertyUIManager *self) PyTypeObject BPy_IDPropertyUIManager_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "IDPropertyUIManager", /* char *tp_name; */ - sizeof(BPy_IDPropertyUIManager), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - NULL, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)BPy_IDPropertyUIManager_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)BPy_IDPropertyUIManager_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - BPy_IDPropertyUIManager_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ + /* For printing, in format `<module>.<name>`. */ + /*tp_name*/ "IDPropertyUIManager", + /*tp_basicsize*/ sizeof(BPy_IDPropertyUIManager), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)BPy_IDPropertyUIManager_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ (hashfunc)BPy_IDPropertyUIManager_hash, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ BPy_IDPropertyUIManager_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; void IDPropertyUIData_Init_Types() diff --git a/source/blender/python/generic/imbuf_py_api.c b/source/blender/python/generic/imbuf_py_api.c index 14f1958b71d..77d450d496e 100644 --- a/source/blender/python/generic/imbuf_py_api.c +++ b/source/blender/python/generic/imbuf_py_api.c @@ -348,63 +348,54 @@ static Py_hash_t py_imbuf_hash(Py_ImBuf *self) PyTypeObject Py_ImBuf_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "ImBuf", /* tp_name */ - sizeof(Py_ImBuf), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - (destructor)py_imbuf_dealloc, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)py_imbuf_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)py_imbuf_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - Py_ImBuf_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - Py_ImBuf_getseters, /* struct PyGetSetDef *tp_getset; */ + /*tp_name*/ "ImBuf", + /*tp_basicsize*/ sizeof(Py_ImBuf), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)py_imbuf_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)py_imbuf_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ (hashfunc)py_imbuf_hash, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Py_ImBuf_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Py_ImBuf_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static PyObject *Py_ImBuf_CreatePyObject(ImBuf *ibuf) @@ -566,14 +557,14 @@ PyDoc_STRVAR(IMB_doc, ":class:`bpy.types.Image` data-block context.\n"); static struct PyModuleDef IMB_module_def = { PyModuleDef_HEAD_INIT, - "imbuf", /* m_name */ - IMB_doc, /* m_doc */ - 0, /* m_size */ - IMB_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "imbuf", + /*m_doc*/ IMB_doc, + /*m_size*/ 0, + /*m_methods*/ IMB_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_imbuf(void) @@ -610,14 +601,14 @@ PyDoc_STRVAR(IMB_types_doc, static struct PyModuleDef IMB_types_module_def = { PyModuleDef_HEAD_INIT, - "imbuf.types", /* m_name */ - IMB_types_doc, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "imbuf.types", + /*m_doc*/ IMB_types_doc, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_imbuf_types(void) diff --git a/source/blender/python/gpu/gpu_py_api.c b/source/blender/python/gpu/gpu_py_api.c index a2075566f31..8f5897be649 100644 --- a/source/blender/python/gpu/gpu_py_api.c +++ b/source/blender/python/gpu/gpu_py_api.c @@ -32,8 +32,14 @@ PyDoc_STRVAR(pygpu_doc, "Some higher level functions can be found in the `gpu_extras` module."); static struct PyModuleDef pygpu_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu", - .m_doc = pygpu_doc, + /*m_name*/ "gpu", + /*m_doc*/ pygpu_doc, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_gpu(void) diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c index cee8a1d349b..51bda9b4941 100644 --- a/source/blender/python/gpu/gpu_py_buffer.c +++ b/source/blender/python/gpu/gpu_py_buffer.c @@ -579,22 +579,22 @@ static PyGetSetDef pygpu_buffer_getseters[] = { }; static PySequenceMethods pygpu_buffer__tp_as_sequence = { - (lenfunc)pygpu_buffer__sq_length, /* sq_length */ - (binaryfunc)NULL, /* sq_concat */ - (ssizeargfunc)NULL, /* sq_repeat */ - (ssizeargfunc)pygpu_buffer__sq_item, /* sq_item */ - (ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in pygpu_buffer__sq_item */ - (ssizeobjargproc)pygpu_buffer__sq_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in pygpu_buffer__sq_ass_item */ - (objobjproc)NULL, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pygpu_buffer__sq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)pygpu_buffer__sq_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_item. */ + /*sq_ass_item*/ (ssizeobjargproc)pygpu_buffer__sq_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_ass_item. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods pygpu_buffer__tp_as_mapping = { - (lenfunc)pygpu_buffer__sq_length, - (binaryfunc)pygpu_buffer__mp_subscript, - (objobjargproc)pygpu_buffer__mp_ass_subscript, + /*mp_len*/ (lenfunc)pygpu_buffer__sq_length, + /*mp_subscript*/ (binaryfunc)pygpu_buffer__mp_subscript, + /*mp_ass_subscript*/ (objobjargproc)pygpu_buffer__mp_ass_subscript, }; #ifdef PYGPU_BUFFER_PROTOCOL @@ -648,8 +648,8 @@ static void pygpu_buffer__bf_releasebuffer(PyObject *UNUSED(exporter), Py_buffer } static PyBufferProcs pygpu_buffer__tp_as_buffer = { - (getbufferproc)pygpu_buffer__bf_getbuffer, - (releasebufferproc)pygpu_buffer__bf_releasebuffer, + /*bf_getbuffer*/ (getbufferproc)pygpu_buffer__bf_getbuffer, + /*bf_releasebuffer*/ (releasebufferproc)pygpu_buffer__bf_releasebuffer, }; #endif diff --git a/source/blender/python/gpu/gpu_py_capabilities.c b/source/blender/python/gpu/gpu_py_capabilities.c index dea057bf8e3..2345982eb42 100644 --- a/source/blender/python/gpu/gpu_py_capabilities.c +++ b/source/blender/python/gpu/gpu_py_capabilities.c @@ -301,9 +301,14 @@ static struct PyMethodDef pygpu_capabilities__tp_methods[] = { PyDoc_STRVAR(pygpu_capabilities__tp_doc, "This module provides access to the GPU capabilities."); static PyModuleDef pygpu_capabilities_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.capabilities", - .m_doc = pygpu_capabilities__tp_doc, - .m_methods = pygpu_capabilities__tp_methods, + /*m_name*/ "gpu.capabilities", + /*m_doc*/ pygpu_capabilities__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_capabilities__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_capabilities_init(void) diff --git a/source/blender/python/gpu/gpu_py_matrix.c b/source/blender/python/gpu/gpu_py_matrix.c index 18925a101da..7d80f763162 100644 --- a/source/blender/python/gpu/gpu_py_matrix.c +++ b/source/blender/python/gpu/gpu_py_matrix.c @@ -528,9 +528,14 @@ static struct PyMethodDef pygpu_matrix__tp_methods[] = { PyDoc_STRVAR(pygpu_matrix__tp_doc, "This module provides access to the matrix stack."); static PyModuleDef pygpu_matrix_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.matrix", - .m_doc = pygpu_matrix__tp_doc, - .m_methods = pygpu_matrix__tp_methods, + /*m_name*/ "gpu.matrix", + /*m_doc*/ pygpu_matrix__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_matrix__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_matrix_init(void) diff --git a/source/blender/python/gpu/gpu_py_platform.c b/source/blender/python/gpu/gpu_py_platform.c index c6e964405fa..5f9f653a3c4 100644 --- a/source/blender/python/gpu/gpu_py_platform.c +++ b/source/blender/python/gpu/gpu_py_platform.c @@ -141,9 +141,14 @@ static struct PyMethodDef pygpu_platform__tp_methods[] = { PyDoc_STRVAR(pygpu_platform__tp_doc, "This module provides access to GPU Platform definitions."); static PyModuleDef pygpu_platform_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.platform", - .m_doc = pygpu_platform__tp_doc, - .m_methods = pygpu_platform__tp_methods, + /*m_name*/ "gpu.platform", + /*m_doc*/ pygpu_platform__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_platform__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_platform_init(void) diff --git a/source/blender/python/gpu/gpu_py_select.c b/source/blender/python/gpu/gpu_py_select.c index 6d11e94433e..02e06e0ffd5 100644 --- a/source/blender/python/gpu/gpu_py_select.c +++ b/source/blender/python/gpu/gpu_py_select.c @@ -58,9 +58,14 @@ static struct PyMethodDef pygpu_select__tp_methods[] = { PyDoc_STRVAR(pygpu_select__tp_doc, "This module provides access to selection."); static PyModuleDef pygpu_select_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.select", - .m_doc = pygpu_select__tp_doc, - .m_methods = pygpu_select__tp_methods, + /*m_name*/ "gpu.select", + /*m_doc*/ pygpu_select__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_select__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_select_init(void) diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index a57b00e671e..7222cb1696a 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -923,9 +923,14 @@ PyDoc_STRVAR(pygpu_shader_module__tp_doc, "\n" PYDOC_BUILTIN_SHADER_DESCRIPTION); static PyModuleDef pygpu_shader_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.shader", - .m_doc = pygpu_shader_module__tp_doc, - .m_methods = pygpu_shader_module__tp_methods, + /*m_name*/ "gpu.shader", + /*m_doc*/ pygpu_shader_module__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_shader_module__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /** \} */ diff --git a/source/blender/python/gpu/gpu_py_state.c b/source/blender/python/gpu/gpu_py_state.c index 35ecc2aff40..f17a3fecfdd 100644 --- a/source/blender/python/gpu/gpu_py_state.c +++ b/source/blender/python/gpu/gpu_py_state.c @@ -431,9 +431,14 @@ static struct PyMethodDef pygpu_state__tp_methods[] = { PyDoc_STRVAR(pygpu_state__tp_doc, "This module provides access to the gpu state."); static PyModuleDef pygpu_state_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.state", - .m_doc = pygpu_state__tp_doc, - .m_methods = pygpu_state__tp_methods, + /*m_name*/ "gpu.state", + /*m_doc*/ pygpu_state__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_state__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_state_init(void) diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c index ae004341304..11b44a2a35e 100644 --- a/source/blender/python/gpu/gpu_py_texture.c +++ b/source/blender/python/gpu/gpu_py_texture.c @@ -565,9 +565,14 @@ static struct PyMethodDef pygpu_texture__m_methods[] = { PyDoc_STRVAR(pygpu_texture__m_doc, "This module provides utils for textures."); static PyModuleDef pygpu_texture_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.texture", - .m_doc = pygpu_texture__m_doc, - .m_methods = pygpu_texture__m_methods, + /*m_name*/ "gpu.texture", + /*m_doc*/ pygpu_texture__m_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_texture__m_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /** \} */ diff --git a/source/blender/python/gpu/gpu_py_types.c b/source/blender/python/gpu/gpu_py_types.c index eccbebbd8dd..b5cabd93b42 100644 --- a/source/blender/python/gpu/gpu_py_types.c +++ b/source/blender/python/gpu/gpu_py_types.c @@ -19,7 +19,14 @@ static struct PyModuleDef pygpu_types_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.types", + /*m_name*/ "gpu.types", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_types_init(void) diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 8c5fb22eab1..3580481941d 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -132,7 +132,7 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type), return NULL; } -/* dummy type because decorators can't be PyCFunctions */ +/** Dummy type because decorators can't be a #PyCFunction. */ static PyTypeObject BPyPersistent_Type = { #if defined(_MSC_VER) @@ -140,46 +140,54 @@ static PyTypeObject BPyPersistent_Type = { #else PyVarObject_HEAD_INIT(&PyType_Type, 0) #endif - - "persistent", /* tp_name */ - 0, /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - 0, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - bpy_app_handlers_persistent_new, /* tp_new */ - 0, /* tp_free */ + /*tp_name*/ "persistent", + /*tp_basicsize*/ 0, + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ bpy_app_handlers_persistent_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static PyObject *py_cb_array[BKE_CB_EVT_TOT] = {NULL}; diff --git a/source/blender/python/intern/bpy_app_icons.c b/source/blender/python/intern/bpy_app_icons.c index 918d96d9f44..65edbb597ca 100644 --- a/source/blender/python/intern/bpy_app_icons.c +++ b/source/blender/python/intern/bpy_app_icons.c @@ -162,14 +162,14 @@ static struct PyMethodDef M_AppIcons_methods[] = { static struct PyModuleDef M_AppIcons_module_def = { PyModuleDef_HEAD_INIT, - "bpy.app.icons", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - M_AppIcons_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bpy.app.icons", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ M_AppIcons_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_app_icons_module(void) diff --git a/source/blender/python/intern/bpy_app_timers.c b/source/blender/python/intern/bpy_app_timers.c index 4adc200357b..e5de5121e9e 100644 --- a/source/blender/python/intern/bpy_app_timers.c +++ b/source/blender/python/intern/bpy_app_timers.c @@ -164,14 +164,14 @@ static struct PyMethodDef M_AppTimers_methods[] = { static struct PyModuleDef M_AppTimers_module_def = { PyModuleDef_HEAD_INIT, - "bpy.app.timers", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - M_AppTimers_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bpy.app.timers", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ M_AppTimers_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_app_timers_module(void) diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index 7627d498774..1f5565eb0a7 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -773,84 +773,54 @@ PyDoc_STRVAR(app_translations_doc, "\n"); static PyTypeObject BlenderAppTranslationsType = { PyVarObject_HEAD_INIT(NULL, 0) - /* tp_name */ - "bpy.app._translations_type", - /* tp_basicsize */ - sizeof(BlenderAppTranslations), - 0, /* tp_itemsize */ - /* methods */ - /* No destructor, this is a singleton! */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - app_translations_doc, /* char *tp_doc; Documentation string */ - - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - app_translations_methods, /* struct PyMethodDef *tp_methods; */ - app_translations_members, /* struct PyMemberDef *tp_members; */ - app_translations_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - /* newfunc tp_new; */ - (newfunc)app_translations_new, - /* Low-level free-memory routine */ - app_translations_free, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_name*/ "bpy.app._translations_type", + /*tp_basicsize*/ sizeof(BlenderAppTranslations), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ app_translations_doc, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ app_translations_methods, + /*tp_members*/ app_translations_members, + /*tp_getset*/ app_translations_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ (newfunc)app_translations_new, + /*tp_free*/ app_translations_free, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyObject *BPY_app_translations_struct(void) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 3a095f4b9f3..a83dc464e43 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -768,14 +768,14 @@ extern void main_python_exit(void); static struct PyModuleDef bpy_proxy_def = { PyModuleDef_HEAD_INIT, - "bpy", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - bpy_module_free, /* m_free */ + /*m_name*/ "bpy", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ bpy_module_free, }; typedef struct { diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c index f29a8d34359..acc6e2cf448 100644 --- a/source/blender/python/intern/bpy_library_load.c +++ b/source/blender/python/intern/bpy_library_load.c @@ -84,82 +84,55 @@ static void bpy_lib_dealloc(BPy_Library *self) } static PyTypeObject bpy_lib_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_lib", /* tp_name */ - sizeof(BPy_Library), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)bpy_lib_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* Will only use these if this is a sub-type of a Python class. */ - PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - bpy_lib_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - offsetof(BPy_Library, dict), /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_lib", + /*tp_basicsize*/ sizeof(BPy_Library), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)bpy_lib_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ PyObject_GenericGetAttr, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ bpy_lib_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ offsetof(BPy_Library, dict), + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyDoc_STRVAR( diff --git a/source/blender/python/intern/bpy_msgbus.c b/source/blender/python/intern/bpy_msgbus.c index 4e41c44cab4..835ef8f7f1f 100644 --- a/source/blender/python/intern/bpy_msgbus.c +++ b/source/blender/python/intern/bpy_msgbus.c @@ -393,8 +393,14 @@ static struct PyMethodDef BPy_msgbus_methods[] = { static struct PyModuleDef _bpy_msgbus_def = { PyModuleDef_HEAD_INIT, - .m_name = "msgbus", - .m_methods = BPy_msgbus_methods, + /*m_name*/ "msgbus", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ BPy_msgbus_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_msgbus_module(void) diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 2db8c08cfd4..546e67a521f 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -493,14 +493,14 @@ static struct PyMethodDef bpy_ops_methods[] = { static struct PyModuleDef bpy_ops_module = { PyModuleDef_HEAD_INIT, - "_bpy.ops", - NULL, - -1, /* multiple "initialization" just copies the module dict. */ - bpy_ops_methods, - NULL, - NULL, - NULL, - NULL, + /*m_name*/ "_bpy.ops", + /*m_doc*/ NULL, + /*m_size*/ -1, /* multiple "initialization" just copies the module dict. */ + /*m_methods*/ bpy_ops_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_operator_module(void) diff --git a/source/blender/python/intern/bpy_path.c b/source/blender/python/intern/bpy_path.c index f3a1a7cb1df..6b9a09b636b 100644 --- a/source/blender/python/intern/bpy_path.c +++ b/source/blender/python/intern/bpy_path.c @@ -22,14 +22,14 @@ extern const char *imb_ext_audio[]; /*----------------------------MODULE INIT-------------------------*/ static struct PyModuleDef _bpy_path_module_def = { PyModuleDef_HEAD_INIT, - "_bpy_path", /* m_name */ - NULL, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "_bpy_path", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit__bpy_path(void) diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index b6c75f7a793..dec4c65e48d 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -4621,21 +4621,25 @@ static int props_clear(PyObject *UNUSED(self)) return 0; } -static struct PyModuleDef props_module = { - PyModuleDef_HEAD_INIT, - "bpy.props", +PyDoc_STRVAR( + props_module_doc, "This module defines properties to extend Blender's internal data. The result of these " "functions" " is used to assign properties to classes registered with Blender and can't be used " "directly.\n" "\n" - ".. note:: All parameters to these functions must be passed as keywords.\n", - -1, /* multiple "initialization" just copies the module dict. */ - props_methods, - NULL, - props_visit, - props_clear, - NULL, + ".. note:: All parameters to these functions must be passed as keywords.\n"); + +static struct PyModuleDef props_module = { + PyModuleDef_HEAD_INIT, + /*m_name*/ "bpy.props", + /*m_doc*/ props_module_doc, + /*m_size*/ -1, /* multiple "initialization" just copies the module dict. */ + /*m_methods*/ props_methods, + /*m_slots*/ NULL, + /*m_traverse*/ props_visit, + /*m_clear*/ props_clear, + /*m_free*/ NULL, }; PyObject *BPY_rna_props(void) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3ceed4ab207..c61cab5aa6f 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3251,41 +3251,67 @@ static int pyrna_prop_array_ass_subscript(BPy_PropertyArrayRNA *self, /* For slice only. */ static PyMappingMethods pyrna_prop_array_as_mapping = { - (lenfunc)pyrna_prop_array_length, /* mp_length */ - (binaryfunc)pyrna_prop_array_subscript, /* mp_subscript */ - (objobjargproc)pyrna_prop_array_ass_subscript, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)pyrna_prop_array_length, + /*mp_subscript*/ (binaryfunc)pyrna_prop_array_subscript, + /*mp_ass_subscript*/ (objobjargproc)pyrna_prop_array_ass_subscript, }; static PyMappingMethods pyrna_prop_collection_as_mapping = { - (lenfunc)pyrna_prop_collection_length, /* mp_length */ - (binaryfunc)pyrna_prop_collection_subscript, /* mp_subscript */ - (objobjargproc)pyrna_prop_collection_ass_subscript, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)pyrna_prop_collection_length, + /*mp_subscript*/ (binaryfunc)pyrna_prop_collection_subscript, + /*mp_ass_subscript*/ (objobjargproc)pyrna_prop_collection_ass_subscript, }; /* Only for fast bool's, large structs, assign nb_bool on init. */ static PyNumberMethods pyrna_prop_array_as_number = { - NULL, /* nb_add */ - NULL, /* nb_subtract */ - NULL, /* nb_multiply */ - NULL, /* nb_remainder */ - NULL, /* nb_divmod */ - NULL, /* nb_power */ - NULL, /* nb_negative */ - NULL, /* nb_positive */ - NULL, /* nb_absolute */ - (inquiry)pyrna_prop_array_bool, /* nb_bool */ + /*nb_add*/ NULL, + /*nb_subtract*/ NULL, + /*nb_multiply*/ NULL, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ NULL, + /*nb_positive*/ NULL, + /*nb_absolute*/ NULL, + /*nb_bool*/ (inquiry)pyrna_prop_array_bool, }; static PyNumberMethods pyrna_prop_collection_as_number = { - NULL, /* nb_add */ - NULL, /* nb_subtract */ - NULL, /* nb_multiply */ - NULL, /* nb_remainder */ - NULL, /* nb_divmod */ - NULL, /* nb_power */ - NULL, /* nb_negative */ - NULL, /* nb_positive */ - NULL, /* nb_absolute */ - (inquiry)pyrna_prop_collection_bool, /* nb_bool */ + /*nb_add*/ NULL, + /*nb_subtract*/ NULL, + /*nb_multiply*/ NULL, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ NULL, + /*nb_positive*/ NULL, + /*nb_absolute*/ NULL, + /*nb_bool*/ (inquiry)pyrna_prop_collection_bool, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ NULL, + /*nb_inplace_subtract*/ NULL, + /*nb_inplace_multiply*/ NULL, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ NULL, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ NULL, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ NULL, + /*nb_inplace_matrix_multiply*/ NULL, }; static int pyrna_prop_array_contains(BPy_PropertyRNA *self, PyObject *value) @@ -3345,46 +3371,46 @@ static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value) } static PySequenceMethods pyrna_prop_array_as_sequence = { - (lenfunc)pyrna_prop_array_length, - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)pyrna_prop_array_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)prop_subscript_ass_array_int, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)pyrna_prop_array_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pyrna_prop_array_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)pyrna_prop_array_subscript_int, + /*sq_slice*/ NULL, + /*sq_ass_item*/ (ssizeobjargproc)prop_subscript_ass_array_int, + /* was_sq_ass_slice */ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)pyrna_prop_array_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PySequenceMethods pyrna_prop_collection_as_sequence = { - (lenfunc)pyrna_prop_collection_length, - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)pyrna_prop_collection_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* *was* sq_slice */ - (ssizeobjargproc) /* pyrna_prop_collection_ass_subscript_int */ - NULL /* let mapping take this one */, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)pyrna_prop_collection_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pyrna_prop_collection_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so PySequence_Check() returns True */ + /*sq_item*/ (ssizeargfunc)pyrna_prop_collection_subscript_int, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /* Let mapping take this one: #pyrna_prop_collection_ass_subscript_int */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)pyrna_prop_collection_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PySequenceMethods pyrna_struct_as_sequence = { - NULL, /* Can't set the len otherwise it can evaluate as false */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - NULL, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* *was* sq_slice */ - NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)pyrna_struct_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ NULL, /* Can't set the len otherwise it can evaluate as false */ + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item */ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)pyrna_struct_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyObject *pyrna_struct_subscript(BPy_StructRNA *self, PyObject *key) @@ -3457,9 +3483,9 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje } static PyMappingMethods pyrna_struct_as_mapping = { - (lenfunc)NULL, /* mp_length */ - (binaryfunc)pyrna_struct_subscript, /* mp_subscript */ - (objobjargproc)pyrna_struct_ass_subscript, /* mp_ass_subscript */ + /*mp_length*/ (lenfunc)NULL, + /*mp_subscript*/ (binaryfunc)pyrna_struct_subscript, + /*mp_ass_subscript*/ (objobjargproc)pyrna_struct_ass_subscript, }; PyDoc_STRVAR(pyrna_struct_keys_doc, @@ -3471,8 +3497,10 @@ PyDoc_STRVAR(pyrna_struct_keys_doc, " :return: custom property keys.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewKeys`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE); -static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self) +static PyObject *pyrna_struct_keys(BPy_StructRNA *self) { + PYRNA_STRUCT_CHECK_OBJ(self); + if (RNA_struct_idprops_check(self->ptr.type) == 0) { PyErr_SetString(PyExc_TypeError, "bpy_struct.keys(): this type doesn't support IDProperties"); return NULL; @@ -3492,8 +3520,10 @@ PyDoc_STRVAR(pyrna_struct_items_doc, " :return: custom property key, value pairs.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewItems`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE); -static PyObject *pyrna_struct_items(BPy_PropertyRNA *self) +static PyObject *pyrna_struct_items(BPy_StructRNA *self) { + PYRNA_STRUCT_CHECK_OBJ(self); + if (RNA_struct_idprops_check(self->ptr.type) == 0) { PyErr_SetString(PyExc_TypeError, "bpy_struct.items(): this type doesn't support IDProperties"); return NULL; @@ -3513,8 +3543,10 @@ PyDoc_STRVAR(pyrna_struct_values_doc, " :return: custom property values.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewValues`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE); -static PyObject *pyrna_struct_values(BPy_PropertyRNA *self) +static PyObject *pyrna_struct_values(BPy_StructRNA *self) { + PYRNA_STRUCT_CHECK_OBJ(self); + if (RNA_struct_idprops_check(self->ptr.type) == 0) { PyErr_SetString(PyExc_TypeError, "bpy_struct.values(): this type doesn't support IDProperties"); @@ -6483,606 +6515,415 @@ static PyObject *pyrna_func_doc_get(BPy_FunctionRNA *self, void *UNUSED(closure) return ret; } -/* Subclasses of pyrna_struct_Type which support idprop definitions use this as a metaclass. */ -/* NOTE: tp_base member is set to &PyType_Type on init. */ +/** + * Sub-classes of #pyrna_struct_Type which support idprop definitions use this as a meta-class. + * \note tp_base member is set to `&PyType_Type` on initialization. + */ PyTypeObject pyrna_struct_meta_idprop_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_struct_meta_idprop", /* tp_name */ - - /* NOTE: would be PyTypeObject, but sub-types of Type must be PyHeapTypeObject's. */ - sizeof(PyHeapTypeObject), /* tp_basicsize */ - - 0, /* tp_itemsize */ - /* methods */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* deprecated in Python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL /* (getattrofunc) pyrna_struct_meta_idprop_getattro */, /* getattrofunc tp_getattro; */ - (setattrofunc)pyrna_struct_meta_idprop_setattro, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_struct_meta_idprop", + /* NOTE: would be `sizeof(PyTypeObject)`, + * but sub-types of Type must be #PyHeapTypeObject's. */ + /*tp_basicsize*/ sizeof(PyHeapTypeObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, /* Sub-classed: #pyrna_struct_meta_idprop_getattro. */ + /*tp_setattro*/ (setattrofunc)pyrna_struct_meta_idprop_setattro, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, #if defined(_MSC_VER) - NULL, /* defer assignment */ + /*tp_base*/ NULL, /* Defer assignment. */ #else - &PyType_Type, /* struct _typeobject *tp_base; */ + /*tp_base*/ &PyType_Type, #endif - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /*-----------------------BPy_StructRNA method def------------------------------*/ PyTypeObject pyrna_struct_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_struct", /* tp_name */ - sizeof(BPy_StructRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_struct_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_struct_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - &pyrna_struct_as_sequence, /* PySequenceMethods *tp_as_sequence; */ - &pyrna_struct_as_mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)pyrna_struct_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - (reprfunc)pyrna_struct_str, /* reprfunc tp_str; */ - (getattrofunc)pyrna_struct_getattro, /* getattrofunc tp_getattro; */ - (setattrofunc)pyrna_struct_setattro, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_struct", + /*tp_basicsize*/ sizeof(BPy_StructRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_struct_dealloc, + /*tp_vectorcall_offset */ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_struct_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &pyrna_struct_as_sequence, + /*tp_as_mapping*/ &pyrna_struct_as_mapping, + /*tp_hash*/ (hashfunc)pyrna_struct_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)pyrna_struct_str, + /*tp_getattro*/ (getattrofunc)pyrna_struct_getattro, + /*tp_setattro*/ (setattrofunc)pyrna_struct_setattro, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE #ifdef USE_PYRNA_STRUCT_REFERENCE | Py_TPFLAGS_HAVE_GC #endif - , /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ -/*** Assigned meaning in release 2.0 ***/ -/* call function for all accessible objects */ + , + /*tp_doc*/ NULL, #ifdef USE_PYRNA_STRUCT_REFERENCE - (traverseproc)pyrna_struct_traverse, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - (inquiry)pyrna_struct_clear, /* inquiry tp_clear; */ + /*tp_traverse*/ (traverseproc)pyrna_struct_traverse, + /*tp_clear*/ (inquiry)pyrna_struct_clear, #else - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, #endif /* !USE_PYRNA_STRUCT_REFERENCE */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - (richcmpfunc)pyrna_struct_richcmp, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + /*tp_richcompare*/ (richcmpfunc)pyrna_struct_richcmp, #ifdef USE_WEAKREFS - offsetof(BPy_StructRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_StructRNA, in_weakreflist), #else 0, #endif - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_struct_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - pyrna_struct_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - pyrna_struct_new, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_struct_methods, + /*tp_members*/ NULL, + /*tp_getset*/ pyrna_struct_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ pyrna_struct_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /*-----------------------BPy_PropertyRNA method def------------------------------*/ PyTypeObject pyrna_prop_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop", /* tp_name */ - sizeof(BPy_PropertyRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_prop_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)pyrna_prop_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - (reprfunc)pyrna_prop_str, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - (richcmpfunc)pyrna_prop_richcmp, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop", + /*tp_basicsize*/ sizeof(BPy_PropertyRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_prop_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ (hashfunc)pyrna_prop_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)pyrna_prop_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ (richcmpfunc)pyrna_prop_richcmp, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - pyrna_prop_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - pyrna_prop_new, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_methods, + /*tp_members*/ NULL, + /*tp_getset*/ pyrna_prop_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ pyrna_prop_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyTypeObject pyrna_prop_array_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_array", /* tp_name */ - sizeof(BPy_PropertyArrayRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_array_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_prop_array_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - &pyrna_prop_array_as_number, /* PyNumberMethods *tp_as_number; */ - &pyrna_prop_array_as_sequence, /* PySequenceMethods *tp_as_sequence; */ - &pyrna_prop_array_as_mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - (getattrofunc)pyrna_prop_array_getattro, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_array", + /*tp_basicsize*/ sizeof(BPy_PropertyArrayRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_array_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_prop_array_repr, + /*tp_as_number*/ &pyrna_prop_array_as_number, + /*tp_as_sequence*/ &pyrna_prop_array_as_sequence, + /*tp_as_mapping*/ &pyrna_prop_array_as_mapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ (getattrofunc)pyrna_prop_array_getattro, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyArrayRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyArrayRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - /*** Added in release 2.2 ***/ - /* Iterators */ - (getiterfunc)pyrna_prop_array_iter, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_array_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ - &pyrna_prop_Type, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ (getiterfunc)pyrna_prop_array_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_array_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL /* Sub-classed: #pyrna_prop_getseters. */, + /*tp_base*/ &pyrna_prop_Type, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyTypeObject pyrna_prop_collection_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_collection", /* tp_name */ - sizeof(BPy_PropertyRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - NULL, - /* subclassed */ /* tp_repr */ - - /* Method suites for standard classes */ - - &pyrna_prop_collection_as_number, /* PyNumberMethods *tp_as_number; */ - &pyrna_prop_collection_as_sequence, /* PySequenceMethods *tp_as_sequence; */ - &pyrna_prop_collection_as_mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - (getattrofunc)pyrna_prop_collection_getattro, /* getattrofunc tp_getattro; */ - (setattrofunc)pyrna_prop_collection_setattro, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_collection", + /*tp_basicsize*/ sizeof(BPy_PropertyRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, /* Sub-classed, no need to define. */ + /*tp_as_number*/ &pyrna_prop_collection_as_number, + /*tp_as_sequence*/ &pyrna_prop_collection_as_sequence, + /*tp_as_mapping*/ &pyrna_prop_collection_as_mapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ (getattrofunc)pyrna_prop_collection_getattro, + /*tp_setattro*/ (setattrofunc)pyrna_prop_collection_setattro, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - (getiterfunc)pyrna_prop_collection_iter, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_collection_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ - &pyrna_prop_Type, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ (getiterfunc)pyrna_prop_collection_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_collection_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL /*Sub-classed: see #pyrna_prop_getseters. */, + /*tp_base*/ &pyrna_prop_Type, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /* only for add/remove/move methods */ static PyTypeObject pyrna_prop_collection_idprop_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_collection_idprop", /* tp_name */ - sizeof(BPy_PropertyRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - NULL, - /* subclassed */ /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_collection_idprop", + /*tp_basicsize*/ sizeof(BPy_PropertyRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_compare*/ NULL, /* DEPRECATED. */ + /*tp_repr*/ NULL, /* Sub-classed, no need to define. */ + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_collection_idprop_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ - &pyrna_prop_collection_Type, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_collection_idprop_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL /* Sub-classed: #pyrna_prop_getseters. */, + /*tp_base*/ &pyrna_prop_collection_Type, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /*-----------------------BPy_PropertyRNA method def------------------------------*/ PyTypeObject pyrna_func_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_func", /* tp_name */ - sizeof(BPy_FunctionRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_func_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - (ternaryfunc)pyrna_func_call, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_func", + /*tp_basicsize*/ sizeof(BPy_FunctionRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_func_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ (ternaryfunc)pyrna_func_call, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - pyrna_func_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ pyrna_func_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; #ifdef USE_PYRNA_ITER @@ -7098,87 +6939,59 @@ static void pyrna_prop_collection_iter_dealloc(BPy_PropertyCollectionIterRNA *se static PyObject *pyrna_prop_collection_iter_next(BPy_PropertyCollectionIterRNA *self); static PyTypeObject pyrna_prop_collection_iter_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_collection_iter", /* tp_name */ - sizeof(BPy_PropertyCollectionIterRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_collection_iter_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - NULL, - /* subclassed */ /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_collection_iter", + /*tp_basicsize*/ sizeof(BPy_PropertyCollectionIterRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_collection_iter_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, /* No need to define, sub-classed. */ + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ PyObject_GenericGetAttr, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, # ifdef USE_WEAKREFS - offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), # else - 0, + /*tp_weaklistoffset*/ 0, # endif - /*** Added in release 2.2 ***/ - /* Iterators */ - PyObject_SelfIter, /* getiterfunc tp_iter; */ - (iternextfunc)pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ PyObject_SelfIter, + /*tp_iternext*/ (iternextfunc)pyrna_prop_collection_iter_next, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static PyObject *pyrna_prop_collection_iter_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop) @@ -7865,14 +7678,14 @@ static struct PyMethodDef bpy_types_module_methods[] = { PyDoc_STRVAR(bpy_types_module_doc, "Access to internal Blender types"); static struct PyModuleDef bpy_types_module_def = { PyModuleDef_HEAD_INIT, - "bpy.types", /* m_name */ - bpy_types_module_doc, /* m_doc */ - sizeof(struct BPy_TypesModule_State), /* m_size */ - bpy_types_module_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "bpy.types", + /*m_doc*/ bpy_types_module_doc, + /*m_size*/ sizeof(struct BPy_TypesModule_State), + /*m_methods*/ bpy_types_module_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_rna_types(void) diff --git a/source/blender/python/intern/bpy_rna_data.c b/source/blender/python/intern/bpy_rna_data.c index 3c7ec3bddc3..2dc0b8dc999 100644 --- a/source/blender/python/intern/bpy_rna_data.c +++ b/source/blender/python/intern/bpy_rna_data.c @@ -60,84 +60,56 @@ static void bpy_rna_data_context_dealloc(BPy_DataContext *self) Py_CLEAR(self->data_rna); PyObject_GC_Del(self); } - static PyTypeObject bpy_rna_data_context_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_rna_data_context", /* tp_name */ - sizeof(BPy_DataContext), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)bpy_rna_data_context_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* Will only use these if this is a sub-type of a Python class. */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - (traverseproc)bpy_rna_data_context_traverse, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - (inquiry)bpy_rna_data_context_clear, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - bpy_rna_data_context_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_rna_data_context", + /*tp_basicsize*/ sizeof(BPy_DataContext), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)bpy_rna_data_context_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ NULL, + /*tp_traverse*/ (traverseproc)bpy_rna_data_context_traverse, + /*tp_clear*/ (inquiry)bpy_rna_data_context_clear, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ bpy_rna_data_context_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyDoc_STRVAR(bpy_rna_data_context_load_doc, diff --git a/source/blender/python/intern/bpy_utils_previews.c b/source/blender/python/intern/bpy_utils_previews.c index aa79ac56347..83e74816020 100644 --- a/source/blender/python/intern/bpy_utils_previews.c +++ b/source/blender/python/intern/bpy_utils_previews.c @@ -163,14 +163,14 @@ PyDoc_STRVAR( "(low-level API, not exposed to final users)."); static struct PyModuleDef bpy_utils_previews_module = { PyModuleDef_HEAD_INIT, - "bpy._utils_previews", - bpy_utils_previews_doc, - 0, - bpy_utils_previews_methods, - NULL, - NULL, - NULL, - NULL, + /*m_name*/ "bpy._utils_previews", + /*m_doc*/ bpy_utils_previews_doc, + /*m_size*/ 0, + /*m_methods*/ bpy_utils_previews_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_utils_previews_module(void) diff --git a/source/blender/python/intern/bpy_utils_units.c b/source/blender/python/intern/bpy_utils_units.c index 075a68f31f9..95d7f4f2eb7 100644 --- a/source/blender/python/intern/bpy_utils_units.c +++ b/source/blender/python/intern/bpy_utils_units.c @@ -336,14 +336,14 @@ PyDoc_STRVAR(bpyunits_doc, "This module contains some data/methods regarding uni static struct PyModuleDef bpyunits_module = { PyModuleDef_HEAD_INIT, - "bpy.utils.units", - bpyunits_doc, - -1, /* multiple "initialization" just copies the module dict. */ - bpyunits_methods, - NULL, - NULL, - NULL, - NULL, + /*m_name*/ "bpy.utils.units", + /*m_doc*/ bpyunits_doc, + /*m_size*/ -1, /* multiple "initialization" just copies the module dict. */ + /*m_methods*/ bpyunits_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPY_utils_units(void) diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index c4c0659100b..ef5339c3aa3 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -766,14 +766,14 @@ static struct PyMethodDef M_Mathutils_methods[] = { static struct PyModuleDef M_Mathutils_module_def = { PyModuleDef_HEAD_INIT, - "mathutils", /* m_name */ - M_Mathutils_doc, /* m_doc */ - 0, /* m_size */ - M_Mathutils_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "mathutils", + /*m_doc*/ M_Mathutils_doc, + /*m_size*/ 0, + /*m_methods*/ M_Mathutils_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /* submodules only */ diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 8bce6af4910..1a1ea1a2535 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -825,59 +825,61 @@ static PyObject *Color_neg(ColorObject *self) * \{ */ static PySequenceMethods Color_SeqMethods = { - (lenfunc)Color_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Color_item, /*sq_item*/ - NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Color_ass_item, /*sq_ass_item*/ - NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Color_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Color_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Color_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Color_AsMapping = { - (lenfunc)Color_len, - (binaryfunc)Color_subscript, - (objobjargproc)Color_ass_subscript, + /*mp_len*/ (lenfunc)Color_len, + /*mp_subscript*/ (binaryfunc)Color_subscript, + /*mp_ass_subscript*/ (objobjargproc)Color_ass_subscript, }; static PyNumberMethods Color_NumMethods = { - (binaryfunc)Color_add, /*nb_add*/ - (binaryfunc)Color_sub, /*nb_subtract*/ - (binaryfunc)Color_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)Color_neg, /*nb_negative*/ - (unaryfunc)Color_copy, /*tp_positive*/ - (unaryfunc)NULL, /*tp_absolute*/ - (inquiry)NULL, /*tp_bool*/ - (unaryfunc)NULL, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)NULL, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - Color_iadd, /*nb_inplace_add*/ - Color_isub, /*nb_inplace_subtract*/ - Color_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - Color_div, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - Color_idiv, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ + /*nb_add*/ (binaryfunc)Color_add, + /*nb_subtract*/ (binaryfunc)Color_sub, + /*nb_multiply*/ (binaryfunc)Color_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ (unaryfunc)Color_neg, + /*tp_positive*/ (unaryfunc)Color_copy, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ Color_iadd, + /*nb_inplace_subtract*/ Color_isub, + /*nb_inplace_multiply*/ Color_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ Color_div, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ Color_idiv, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ NULL, + /*nb_inplace_matrix_multiply*/ NULL, }; /** \} */ @@ -1100,6 +1102,10 @@ static struct PyMethodDef Color_methods[] = { /** \name Color Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Color_str NULL +#endif + PyDoc_STRVAR( color_doc, ".. class:: Color(rgb)\n" @@ -1113,57 +1119,61 @@ PyDoc_STRVAR( " :arg rgb: (r, g, b) color values\n" " :type rgb: 3d vector\n"); PyTypeObject color_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Color", /* tp_name */ - sizeof(ColorObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BaseMathObject_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Color_repr, /* tp_repr */ - &Color_NumMethods, /* tp_as_number */ - &Color_SeqMethods, /* tp_as_sequence */ - &Color_AsMapping, /* tp_as_mapping */ - (hashfunc)Color_hash, /* tp_hash */ - NULL, /* tp_call */ -#ifndef MATH_STANDALONE - (reprfunc)Color_str, /* tp_str */ -#else - NULL, /* tp_str */ -#endif - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ - color_doc, /* tp_doc */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - (richcmpfunc)Color_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - Color_methods, /* tp_methods */ - NULL, /* tp_members */ - Color_getseters, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - NULL, /* tp_alloc */ - Color_new, /* tp_new */ - NULL, /* tp_free */ - (inquiry)BaseMathObject_is_gc, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Color", + /*tp_basicsize*/ sizeof(ColorObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Color_repr, + /*tp_as_number*/ &Color_NumMethods, + /*tp_as_sequence*/ &Color_SeqMethods, + /*tp_as_mapping*/ &Color_AsMapping, + /*tp_hash*/ (hashfunc)Color_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Color_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ color_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Color_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Color_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Color_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Color_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# define Color_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index fd4467c9799..551e5d6706d 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -636,22 +636,22 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu * \{ */ static PySequenceMethods Euler_SeqMethods = { - (lenfunc)Euler_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Euler_item, /*sq_item*/ - (ssizessizeargfunc)NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Euler_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Euler_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Euler_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Euler_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Euler_AsMapping = { - (lenfunc)Euler_len, - (binaryfunc)Euler_subscript, - (objobjargproc)Euler_ass_subscript, + /*mp_len*/ (lenfunc)Euler_len, + /*mp_subscript*/ (binaryfunc)Euler_subscript, + /*mp_ass_subscript*/ (objobjargproc)Euler_ass_subscript, }; /** \} */ @@ -766,6 +766,10 @@ static struct PyMethodDef Euler_methods[] = { /** \name Euler Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Euler_str NULL +#endif + PyDoc_STRVAR( euler_doc, ".. class:: Euler(angles, order='XYZ')\n" @@ -779,57 +783,61 @@ PyDoc_STRVAR( " :arg order: Optional order of the angles, a permutation of ``XYZ``.\n" " :type order: str\n"); PyTypeObject euler_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Euler", /* tp_name */ - sizeof(EulerObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BaseMathObject_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Euler_repr, /* tp_repr */ - NULL, /* tp_as_number */ - &Euler_SeqMethods, /* tp_as_sequence */ - &Euler_AsMapping, /* tp_as_mapping */ - (hashfunc)Euler_hash, /* tp_hash */ - NULL, /* tp_call */ -#ifndef MATH_STANDALONE - (reprfunc)Euler_str, /* tp_str */ -#else - NULL, /* tp_str */ -#endif - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ - euler_doc, /* tp_doc */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - (richcmpfunc)Euler_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - Euler_methods, /* tp_methods */ - NULL, /* tp_members */ - Euler_getseters, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - NULL, /* tp_alloc */ - Euler_new, /* tp_new */ - NULL, /* tp_free */ - (inquiry)BaseMathObject_is_gc, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Euler", + /*tp_basicsize*/ sizeof(EulerObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Euler_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &Euler_SeqMethods, + /*tp_as_mapping*/ &Euler_AsMapping, + /*tp_hash*/ (hashfunc)Euler_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Euler_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ euler_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Euler_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Euler_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Euler_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Euler_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# undef Euler_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 682f40c23f1..21ad79bc94d 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -2964,61 +2964,61 @@ static PyObject *Matrix_imatmul(PyObject *m1, PyObject *m2) * \{ */ static PySequenceMethods Matrix_SeqMethods = { - (lenfunc)Matrix_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Matrix_item_row, /*sq_item*/ - (ssizessizeargfunc)NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Matrix_ass_item_row, /*sq_ass_item*/ - (ssizessizeobjargproc)NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Matrix_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Matrix_item_row, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Matrix_ass_item_row, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Matrix_AsMapping = { - (lenfunc)Matrix_len, - (binaryfunc)Matrix_subscript, - (objobjargproc)Matrix_ass_subscript, + /*mp_len*/ (lenfunc)Matrix_len, + /*mp_subscript*/ (binaryfunc)Matrix_subscript, + /*mp_ass_subscript*/ (objobjargproc)Matrix_ass_subscript, }; static PyNumberMethods Matrix_NumMethods = { - (binaryfunc)Matrix_add, /*nb_add*/ - (binaryfunc)Matrix_sub, /*nb_subtract*/ - (binaryfunc)Matrix_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*tp_positive*/ - (unaryfunc)0, /*tp_absolute*/ - (inquiry)0, /*tp_bool*/ - (unaryfunc)Matrix_inverted_noargs, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)0, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - NULL, /*nb_inplace_add*/ - NULL, /*nb_inplace_subtract*/ - (binaryfunc)Matrix_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - NULL, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - NULL, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ - (binaryfunc)Matrix_matmul, /*nb_matrix_multiply*/ - (binaryfunc)Matrix_imatmul, /*nb_inplace_matrix_multiply*/ + /*nb_add*/ (binaryfunc)Matrix_add, + /*nb_subtract*/ (binaryfunc)Matrix_sub, + /*nb_multiply*/ (binaryfunc)Matrix_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ NULL, + /*tp_positive*/ NULL, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ (unaryfunc)Matrix_inverted_noargs, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ NULL, + /*nb_inplace_subtract*/ NULL, + /*nb_inplace_multiply*/ (binaryfunc)Matrix_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ NULL, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ NULL, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ (binaryfunc)Matrix_matmul, + /*nb_inplace_matrix_multiply*/ (binaryfunc)Matrix_imatmul, }; /** \} */ @@ -3314,6 +3314,10 @@ static struct PyMethodDef Matrix_methods[] = { /** \name Matrix Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Matrix_str NULL +#endif + PyDoc_STRVAR( matrix_doc, ".. class:: Matrix([rows])\n" @@ -3324,57 +3328,61 @@ PyDoc_STRVAR( " :arg rows: Sequence of rows. When omitted, a 4x4 identity matrix is constructed.\n" " :type rows: 2d number sequence\n"); PyTypeObject matrix_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Matrix", /*tp_name*/ - sizeof(MatrixObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)BaseMathObject_dealloc, /*tp_dealloc*/ - (printfunc)NULL, /*tp_print*/ - NULL, /*tp_getattr*/ - NULL, /*tp_setattr*/ - NULL, /*tp_compare*/ - (reprfunc)Matrix_repr, /*tp_repr*/ - &Matrix_NumMethods, /*tp_as_number*/ - &Matrix_SeqMethods, /*tp_as_sequence*/ - &Matrix_AsMapping, /*tp_as_mapping*/ - (hashfunc)Matrix_hash, /*tp_hash*/ - NULL, /*tp_call*/ -#ifndef MATH_STANDALONE - (reprfunc)Matrix_str, /*tp_str*/ -#else - NULL, /*tp_str*/ -#endif - NULL, /*tp_getattro*/ - NULL, /*tp_setattro*/ - NULL, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - matrix_doc, /*tp_doc*/ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /*tp_clear*/ - (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - NULL, /*tp_iter*/ - NULL, /*tp_iternext*/ - Matrix_methods, /*tp_methods*/ - NULL, /*tp_members*/ - Matrix_getseters, /*tp_getset*/ - NULL, /*tp_base*/ - NULL, /*tp_dict*/ - NULL, /*tp_descr_get*/ - NULL, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - NULL, /*tp_init*/ - NULL, /*tp_alloc*/ - Matrix_new, /*tp_new*/ - NULL, /*tp_free*/ - (inquiry)BaseMathObject_is_gc, /*tp_is_gc*/ - NULL, /*tp_bases*/ - NULL, /*tp_mro*/ - NULL, /*tp_cache*/ - NULL, /*tp_subclasses*/ - NULL, /*tp_weaklist*/ - NULL, /*tp_del*/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Matrix", + /*tp_basicsize*/ sizeof(MatrixObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Matrix_repr, + /*tp_as_number*/ &Matrix_NumMethods, + /*tp_as_sequence*/ &Matrix_SeqMethods, + /*tp_as_mapping*/ &Matrix_AsMapping, + /*tp_hash*/ (hashfunc)Matrix_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Matrix_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ matrix_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Matrix_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Matrix_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Matrix_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Matrix_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# undef Matrix_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ @@ -3752,9 +3760,9 @@ static PyObject *MatrixAccess_iter(MatrixAccessObject *self) } static PyMappingMethods MatrixAccess_AsMapping = { - (lenfunc)MatrixAccess_len, - (binaryfunc)MatrixAccess_subscript, - (objobjargproc)MatrixAccess_ass_subscript, + /*mp_len*/ (lenfunc)MatrixAccess_len, + /*mp_subscript*/ (binaryfunc)MatrixAccess_subscript, + /*mp_ass_subscript*/ (objobjargproc)MatrixAccess_ass_subscript, }; /** \} */ @@ -3764,31 +3772,55 @@ static PyMappingMethods MatrixAccess_AsMapping = { * \{ */ PyTypeObject matrix_access_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "MatrixAccess", /*tp_name*/ - sizeof(MatrixAccessObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)MatrixAccess_dealloc, /*tp_dealloc*/ - (printfunc)NULL, /*tp_print*/ - NULL, /*tp_getattr*/ - NULL, /*tp_setattr*/ - NULL, /*tp_compare*/ - NULL, /*tp_repr*/ - NULL, /*tp_as_number*/ - NULL /* &MatrixAccess_SeqMethods */ /* TODO */, /*tp_as_sequence*/ - &MatrixAccess_AsMapping, /*tp_as_mapping*/ - NULL, /*tp_hash*/ - NULL, /*tp_call*/ - NULL, /*tp_str*/ - NULL, /*tp_getattro*/ - NULL, /*tp_setattro*/ - NULL, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - NULL, /*tp_doc*/ - (traverseproc)MatrixAccess_traverse, /*tp_traverse*/ - (inquiry)MatrixAccess_clear, /*tp_clear*/ - NULL /* (richcmpfunc)MatrixAccess_richcmpr */ /* TODO*/, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - (getiterfunc)MatrixAccess_iter, /* getiterfunc tp_iter; */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "MatrixAccess", + /*tp_basicsize*/ sizeof(MatrixAccessObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)MatrixAccess_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL /* &MatrixAccess_SeqMethods */ /* TODO */, + /*tp_as_mapping*/ &MatrixAccess_AsMapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ NULL, + /*tp_traverse*/ (traverseproc)MatrixAccess_traverse, + /*tp_clear*/ (inquiry)MatrixAccess_clear, + /*tp_richcompare*/ NULL /* MatrixAccess_richcmpr */ /* TODO*/, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)MatrixAccess_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /** \} */ diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index 55269ae20c1..f2348713433 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -1342,61 +1342,61 @@ static PyObject *Quaternion_neg(QuaternionObject *self) * \{ */ static PySequenceMethods Quaternion_SeqMethods = { - (lenfunc)Quaternion_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Quaternion_item, /*sq_item*/ - (ssizessizeargfunc)NULL, /*sq_slice(deprecated)*/ - (ssizeobjargproc)Quaternion_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)NULL, /*sq_ass_slice(deprecated)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Quaternion_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Quaternion_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Quaternion_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Quaternion_AsMapping = { - (lenfunc)Quaternion_len, - (binaryfunc)Quaternion_subscript, - (objobjargproc)Quaternion_ass_subscript, + /*mp_len*/ (lenfunc)Quaternion_len, + /*mp_subscript*/ (binaryfunc)Quaternion_subscript, + /*mp_ass_subscript*/ (objobjargproc)Quaternion_ass_subscript, }; static PyNumberMethods Quaternion_NumMethods = { - (binaryfunc)Quaternion_add, /*nb_add*/ - (binaryfunc)Quaternion_sub, /*nb_subtract*/ - (binaryfunc)Quaternion_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)Quaternion_neg, /*nb_negative*/ - (unaryfunc)Quaternion_copy, /*tp_positive*/ - (unaryfunc)0, /*tp_absolute*/ - (inquiry)0, /*tp_bool*/ - (unaryfunc)0, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)0, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - NULL, /*nb_inplace_add*/ - NULL, /*nb_inplace_subtract*/ - (binaryfunc)Quaternion_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - NULL, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - NULL, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ - (binaryfunc)Quaternion_matmul, /*nb_matrix_multiply*/ - (binaryfunc)Quaternion_imatmul, /*nb_inplace_matrix_multiply*/ + /*nb_add*/ (binaryfunc)Quaternion_add, + /*nb_subtract*/ (binaryfunc)Quaternion_sub, + /*nb_multiply*/ (binaryfunc)Quaternion_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ (unaryfunc)Quaternion_neg, + /*tp_positive*/ (unaryfunc)Quaternion_copy, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ NULL, + /*nb_inplace_subtract*/ NULL, + /*nb_inplace_multiply*/ (binaryfunc)Quaternion_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ NULL, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ NULL, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ (binaryfunc)Quaternion_matmul, + /*nb_inplace_matrix_multiply*/ (binaryfunc)Quaternion_imatmul, }; /** \} */ @@ -1657,6 +1657,10 @@ static struct PyMethodDef Quaternion_methods[] = { /** \name Quaternion Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Quaternion_str NULL +#endif + PyDoc_STRVAR(quaternion_doc, ".. class:: Quaternion([seq, [angle]])\n" "\n" @@ -1682,57 +1686,61 @@ PyDoc_STRVAR(quaternion_doc, "\n" " .. seealso:: :meth:`to_axis_angle`\n"); PyTypeObject quaternion_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Quaternion", /* tp_name */ - sizeof(QuaternionObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BaseMathObject_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Quaternion_repr, /* tp_repr */ - &Quaternion_NumMethods, /* tp_as_number */ - &Quaternion_SeqMethods, /* tp_as_sequence */ - &Quaternion_AsMapping, /* tp_as_mapping */ - (hashfunc)Quaternion_hash, /* tp_hash */ - NULL, /* tp_call */ -#ifndef MATH_STANDALONE - (reprfunc)Quaternion_str, /* tp_str */ -#else - NULL, /* tp_str */ -#endif - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ - quaternion_doc, /* tp_doc */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - (richcmpfunc)Quaternion_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - Quaternion_methods, /* tp_methods */ - NULL, /* tp_members */ - Quaternion_getseters, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - NULL, /* tp_alloc */ - Quaternion_new, /* tp_new */ - NULL, /* tp_free */ - (inquiry)BaseMathObject_is_gc, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Quaternion", + /*tp_basicsize*/ sizeof(QuaternionObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Quaternion_repr, + /*tp_as_number*/ &Quaternion_NumMethods, + /*tp_as_sequence*/ &Quaternion_SeqMethods, + /*tp_as_mapping*/ &Quaternion_AsMapping, + /*tp_hash*/ (hashfunc)Quaternion_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Quaternion_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ quaternion_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Quaternion_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Quaternion_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Quaternion_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Quaternion_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# undef Quaternion_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index a31297571a5..c5a002a6058 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -2387,61 +2387,61 @@ static PyObject *Vector_neg(VectorObject *self) * \{ */ static PySequenceMethods Vector_SeqMethods = { - (lenfunc)Vector_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Vector_item, /*sq_item*/ - NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Vector_ass_item, /*sq_ass_item*/ - NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat */ - (ssizeargfunc)NULL, /*sq_inplace_repeat */ + /*sq_length*/ (lenfunc)Vector_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Vector_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Vector_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat */ NULL, + /*sq_inplace_repeat */ NULL, }; static PyMappingMethods Vector_AsMapping = { - (lenfunc)Vector_len, - (binaryfunc)Vector_subscript, - (objobjargproc)Vector_ass_subscript, + /*mp_len*/ (lenfunc)Vector_len, + /*mp_subscript*/ (binaryfunc)Vector_subscript, + /*mp_ass_subscript*/ (objobjargproc)Vector_ass_subscript, }; static PyNumberMethods Vector_NumMethods = { - (binaryfunc)Vector_add, /*nb_add*/ - (binaryfunc)Vector_sub, /*nb_subtract*/ - (binaryfunc)Vector_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)Vector_neg, /*nb_negative*/ - (unaryfunc)Vector_copy, /*tp_positive*/ - (unaryfunc)NULL, /*tp_absolute*/ - (inquiry)NULL, /*tp_bool*/ - (unaryfunc)NULL, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)NULL, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - Vector_iadd, /*nb_inplace_add*/ - Vector_isub, /*nb_inplace_subtract*/ - Vector_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - Vector_div, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - Vector_idiv, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ - (binaryfunc)Vector_matmul, /*nb_matrix_multiply*/ - (binaryfunc)Vector_imatmul, /*nb_inplace_matrix_multiply*/ + /*nb_add*/ (binaryfunc)Vector_add, + /*nb_subtract*/ (binaryfunc)Vector_sub, + /*nb_multiply*/ (binaryfunc)Vector_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ (unaryfunc)Vector_neg, + /*tp_positive*/ (unaryfunc)Vector_copy, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ Vector_iadd, + /*nb_inplace_subtract*/ Vector_isub, + /*nb_inplace_multiply*/ Vector_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ Vector_div, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ Vector_idiv, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ (binaryfunc)Vector_matmul, + /*nb_inplace_matrix_multiply*/ (binaryfunc)Vector_imatmul, }; /** \} */ @@ -3183,6 +3183,10 @@ static struct PyMethodDef Vector_methods[] = { * both get sent to Vector_mul and it needs to sort out the order * \{ */ +#ifdef MATH_STANDALONE +# define Vector_str NULL +#endif + PyDoc_STRVAR(vector_doc, ".. class:: Vector(seq)\n" "\n" @@ -3192,88 +3196,59 @@ PyDoc_STRVAR(vector_doc, " :type seq: sequence of numbers\n"); PyTypeObject vector_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "Vector", /* char *tp_name; */ - sizeof(VectorObject), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - (destructor)BaseMathObject_dealloc, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)Vector_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - &Vector_NumMethods, /* PyNumberMethods *tp_as_number; */ - &Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */ - &Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ + /*tp_name*/ "Vector", + /*tp_basicsize*/ sizeof(VectorObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Vector_repr, + /*tp_as_number*/ &Vector_NumMethods, + /*tp_as_sequence*/ &Vector_SeqMethods, + /*tp_as_mapping*/ &Vector_AsMapping, + /*tp_hash*/ (hashfunc)Vector_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Vector_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ vector_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Vector_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Vector_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Vector_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Vector_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, +}; - (hashfunc)Vector_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ -#ifndef MATH_STANDALONE - (reprfunc)Vector_str, /* reprfunc tp_str; */ -#else - NULL, /* reprfunc tp_str; */ +#ifdef MATH_STANDALONE +# undef Vector_str NULL #endif - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, - vector_doc, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - - /* call function for all accessible objects */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - - /* delete references to contained objects */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - (richcmpfunc)Vector_richcmpr, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - Vector_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - Vector_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - Vector_new, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - (inquiry)BaseMathObject_is_gc, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, -}; /** \} */ diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index 4bdb1adcdde..7b6c444515b 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -1235,52 +1235,55 @@ static PyMethodDef py_bvhtree_methods[] = { }; PyTypeObject PyBVHTree_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "BVHTree", /* tp_name */ - sizeof(PyBVHTree), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)py_bvhtree__tp_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - NULL, /* tp_repr */ - NULL, /* tp_as_number */ - NULL, /* tp_as_sequence */ - NULL, /* tp_as_mapping */ - NULL, /* tp_hash */ - NULL, /* tp_call */ - NULL, /* tp_str */ - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - NULL, /* Documentation string */ - NULL, /* tp_traverse */ - NULL, /* tp_clear */ - NULL, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - py_bvhtree_methods, /* tp_methods */ - NULL, /* tp_members */ - NULL, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - (allocfunc)PyType_GenericAlloc, /* tp_alloc */ - (newfunc)PyType_GenericNew, /* tp_new */ - (freefunc)0, /* tp_free */ - NULL, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - (destructor)NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "BVHTree", + /*tp_basicsize*/ sizeof(PyBVHTree), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)py_bvhtree__tp_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ py_bvhtree_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ (allocfunc)PyType_GenericAlloc, + /*tp_new*/ (newfunc)PyType_GenericNew, + /*tp_free*/ (freefunc)0, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ (destructor)NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /* -------------------------------------------------------------------- */ @@ -1290,14 +1293,14 @@ PyDoc_STRVAR(py_bvhtree_doc, "BVH tree structures for proximity searches and ray casts on geometry."); static struct PyModuleDef bvhtree_moduledef = { PyModuleDef_HEAD_INIT, - "mathutils.bvhtree", /* m_name */ - py_bvhtree_doc, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "mathutils.bvhtree", + /*m_doc*/ py_bvhtree_doc, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyMODINIT_FUNC PyInit_mathutils_bvhtree(void) diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index 52ea2a9ed31..59a3bc40b1c 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -1793,14 +1793,14 @@ static PyMethodDef M_Geometry_methods[] = { static struct PyModuleDef M_Geometry_module_def = { PyModuleDef_HEAD_INIT, - "mathutils.geometry", /* m_name */ - M_Geometry_doc, /* m_doc */ - 0, /* m_size */ - M_Geometry_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "mathutils.geometry", + /*m_doc*/ M_Geometry_doc, + /*m_size*/ 0, + /*m_methods*/ M_Geometry_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /*----------------------------MODULE INIT-------------------------*/ diff --git a/source/blender/python/mathutils/mathutils_interpolate.c b/source/blender/python/mathutils/mathutils_interpolate.c index 10f42d9b070..76a0fc55774 100644 --- a/source/blender/python/mathutils/mathutils_interpolate.c +++ b/source/blender/python/mathutils/mathutils_interpolate.c @@ -89,14 +89,14 @@ static PyMethodDef M_Interpolate_methods[] = { static struct PyModuleDef M_Interpolate_module_def = { PyModuleDef_HEAD_INIT, - "mathutils.interpolate", /* m_name */ - M_Interpolate_doc, /* m_doc */ - 0, /* m_size */ - M_Interpolate_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "mathutils.interpolate", + /*m_doc*/ M_Interpolate_doc, + /*m_size*/ 0, + /*m_methods*/ M_Interpolate_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /*----------------------------MODULE INIT-------------------------*/ diff --git a/source/blender/python/mathutils/mathutils_kdtree.c b/source/blender/python/mathutils/mathutils_kdtree.c index f5a27c6f90f..ace8ccdeb2a 100644 --- a/source/blender/python/mathutils/mathutils_kdtree.c +++ b/source/blender/python/mathutils/mathutils_kdtree.c @@ -372,66 +372,70 @@ PyDoc_STRVAR(py_KDtree_doc, "\n" " :class:`KDTree.balance` must have been called before using any of the ``find`` " "methods.\n"); + PyTypeObject PyKDTree_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "KDTree", /* tp_name */ - sizeof(PyKDTree), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)PyKDTree__tp_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - NULL, /* tp_repr */ - NULL, /* tp_as_number */ - NULL, /* tp_as_sequence */ - NULL, /* tp_as_mapping */ - NULL, /* tp_hash */ - NULL, /* tp_call */ - NULL, /* tp_str */ - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - py_KDtree_doc, /* Documentation string */ - NULL, /* tp_traverse */ - NULL, /* tp_clear */ - NULL, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - (struct PyMethodDef *)PyKDTree_methods, /* tp_methods */ - NULL, /* tp_members */ - NULL, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)PyKDTree__tp_init, /* tp_init */ - (allocfunc)PyType_GenericAlloc, /* tp_alloc */ - (newfunc)PyType_GenericNew, /* tp_new */ - (freefunc)0, /* tp_free */ - NULL, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - (destructor)NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "KDTree", + /*tp_basicsize*/ sizeof(PyKDTree), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)PyKDTree__tp_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*Documentation string*/ py_KDtree_doc, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ (struct PyMethodDef *)PyKDTree_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)PyKDTree__tp_init, + /*tp_alloc*/ (allocfunc)PyType_GenericAlloc, + /*tp_new*/ (newfunc)PyType_GenericNew, + /*tp_free*/ (freefunc)0, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ (destructor)NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyDoc_STRVAR(py_kdtree_doc, "Generic 3-dimensional kd-tree to perform spatial searches."); static struct PyModuleDef kdtree_moduledef = { PyModuleDef_HEAD_INIT, - "mathutils.kdtree", /* m_name */ - py_kdtree_doc, /* m_doc */ - 0, /* m_size */ - NULL, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "mathutils.kdtree", + /*m_doc*/ py_kdtree_doc, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyMODINIT_FUNC PyInit_mathutils_kdtree(void) diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c index 3c564142160..869201bbcfd 100644 --- a/source/blender/python/mathutils/mathutils_noise.c +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -1085,14 +1085,14 @@ static PyMethodDef M_Noise_methods[] = { static struct PyModuleDef M_Noise_module_def = { PyModuleDef_HEAD_INIT, - "mathutils.noise", /* m_name */ - M_Noise_doc, /* m_doc */ - 0, /* m_size */ - M_Noise_methods, /* m_methods */ - NULL, /* m_slots */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL, /* m_free */ + /*m_name*/ "mathutils.noise", + /*m_doc*/ M_Noise_doc, + /*m_size*/ 0, + /*m_methods*/ M_Noise_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /*----------------------------MODULE INIT-------------------------*/ diff --git a/source/blender/render/RE_multires_bake.h b/source/blender/render/RE_multires_bake.h index a478f124892..70ce46bc195 100644 --- a/source/blender/render/RE_multires_bake.h +++ b/source/blender/render/RE_multires_bake.h @@ -43,8 +43,8 @@ typedef struct MultiresBakeRender { float user_scale; /* User scale used to scale displacement when baking derivative map. */ - short *stop; - short *do_update; + bool *stop; + bool *do_update; float *progress; } MultiresBakeRender; diff --git a/source/blender/render/RE_pipeline.h b/source/blender/render/RE_pipeline.h index e9a90096dab..d12162c0b9a 100644 --- a/source/blender/render/RE_pipeline.h +++ b/source/blender/render/RE_pipeline.h @@ -398,7 +398,7 @@ void RE_display_update_cb(struct Render *re, void RE_stats_draw_cb(struct Render *re, void *handle, void (*f)(void *handle, RenderStats *rs)); void RE_progress_cb(struct Render *re, void *handle, void (*f)(void *handle, float)); void RE_draw_lock_cb(struct Render *re, void *handle, void (*f)(void *handle, bool lock)); -void RE_test_break_cb(struct Render *re, void *handle, int (*f)(void *handle)); +void RE_test_break_cb(struct Render *re, void *handle, bool (*f)(void *handle)); void RE_current_scene_update_cb(struct Render *re, void *handle, void (*f)(void *handle, struct Scene *scene)); diff --git a/source/blender/render/intern/multires_bake.c b/source/blender/render/intern/multires_bake.c index f701d9a987a..cfb91e86ad9 100644 --- a/source/blender/render/intern/multires_bake.c +++ b/source/blender/render/intern/multires_bake.c @@ -89,7 +89,7 @@ typedef struct { char *texels; const MResolvePixelData *data; MFlushPixel flush_pixel; - short *do_update; + bool *do_update; } MBakeRast; typedef struct { @@ -134,7 +134,7 @@ static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResolvePixelData *data, MFlushPixel flush_pixel, - short *do_update) + bool *do_update) { BakeImBufuserData *userdata = (BakeImBufuserData *)ibuf->userdata; diff --git a/source/blender/render/intern/pipeline.cc b/source/blender/render/intern/pipeline.cc index 1971c6fe6be..17cf3b7ff74 100644 --- a/source/blender/render/intern/pipeline.cc +++ b/source/blender/render/intern/pipeline.cc @@ -177,7 +177,7 @@ static void stats_nothing(void * /*arg*/, RenderStats * /*rs*/) static void float_nothing(void * /*arg*/, float /*val*/) { } -static int default_break(void * /*arg*/) +static bool default_break(void * /*arg*/) { return G.is_break == true; } @@ -748,7 +748,7 @@ void RE_InitState(Render *re, if (re->rectx < 1 || re->recty < 1 || (BKE_imtype_is_movie(rd->im_format.imtype) && (re->rectx < 16 || re->recty < 16))) { BKE_report(re->reports, RPT_ERROR, "Image too small"); - re->ok = 0; + re->ok = false; return; } @@ -847,7 +847,7 @@ void RE_draw_lock_cb(Render *re, void *handle, void (*f)(void *handle, bool lock re->dlh = handle; } -void RE_test_break_cb(Render *re, void *handle, int (*f)(void *handle)) +void RE_test_break_cb(Render *re, void *handle, bool (*f)(void *handle)) { re->test_break = f; re->tbh = handle; @@ -1605,15 +1605,15 @@ const char *RE_GetActiveRenderView(Render *re) return re->viewname; } -/* evaluating scene options for general Blender render */ -static int render_init_from_main(Render *re, - const RenderData *rd, - Main *bmain, - Scene *scene, - ViewLayer *single_layer, - Object *camera_override, - int anim, - int anim_init) +/** Evaluating scene options for general Blender render. */ +static bool render_init_from_main(Render *re, + const RenderData *rd, + Main *bmain, + Scene *scene, + ViewLayer *single_layer, + Object *camera_override, + int anim, + int anim_init) { int winx, winy; rcti disprect; @@ -1647,7 +1647,7 @@ static int render_init_from_main(Render *re, /* not too nice, but it survives anim-border render */ if (anim) { re->disprect = disprect; - return 1; + return true; } /* @@ -1669,7 +1669,7 @@ static int render_init_from_main(Render *re, RE_InitState(re, nullptr, &scene->r, &scene->view_layers, single_layer, winx, winy, &disprect); if (!re->ok) { /* if an error was printed, abort */ - return 0; + return false; } /* initstate makes new result, have to send changed tags around */ @@ -1678,7 +1678,7 @@ static int render_init_from_main(Render *re, re->display_init(re->dih, re->result); re->display_clear(re->dch, re->result); - return 1; + return true; } void RE_SetReports(Render *re, ReportList *reports) @@ -1831,7 +1831,7 @@ static bool use_eevee_for_freestyle_render(Render *re) void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene, int render) { - re->result_ok = 0; + re->result_ok = false; if (render_init_from_main(re, &scene->r, bmain, scene, nullptr, nullptr, 0, 0)) { if (render) { char scene_engine[32]; @@ -1845,7 +1845,7 @@ void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene, int render change_renderdata_engine(re, scene_engine); } } - re->result_ok = 1; + re->result_ok = true; } void RE_RenderFreestyleExternal(Render *re) diff --git a/source/blender/render/intern/render_types.h b/source/blender/render/intern/render_types.h index ad58f081388..418acbca3b1 100644 --- a/source/blender/render/intern/render_types.h +++ b/source/blender/render/intern/render_types.h @@ -39,7 +39,8 @@ struct Render { int slot; /* state settings */ - short flag, ok, result_ok; + short flag; + bool ok, result_ok; /* result of rendering */ RenderResult *result; @@ -107,7 +108,7 @@ struct Render { void (*draw_lock)(void *handle, bool lock); void *dlh; - int (*test_break)(void *handle); + bool (*test_break)(void *handle); void *tbh; RenderStats i; diff --git a/source/blender/sequencer/SEQ_proxy.h b/source/blender/sequencer/SEQ_proxy.h index 00747f4b9cf..caf123afbcf 100644 --- a/source/blender/sequencer/SEQ_proxy.h +++ b/source/blender/sequencer/SEQ_proxy.h @@ -29,8 +29,8 @@ bool SEQ_proxy_rebuild_context(struct Main *bmain, struct ListBase *queue, bool build_only_on_bad_performance); void SEQ_proxy_rebuild(struct SeqIndexBuildContext *context, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); void SEQ_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop); void SEQ_proxy_set(struct Sequence *seq, bool value); diff --git a/source/blender/sequencer/SEQ_render.h b/source/blender/sequencer/SEQ_render.h index 9c163de4230..e2672eef8b9 100644 --- a/source/blender/sequencer/SEQ_render.h +++ b/source/blender/sequencer/SEQ_render.h @@ -66,8 +66,8 @@ void SEQ_render_thumbnails(const struct SeqRenderData *context, struct Sequence *seq, struct Sequence *seq_orig, float frame_step, - rctf *view_area, - const short *stop); + const struct rctf *view_area, + const bool *stop); /** * Get cached thumbnails. */ @@ -82,7 +82,7 @@ struct ImBuf *SEQ_get_thumbnail(const struct SeqRenderData *context, float SEQ_render_thumbnail_first_frame_get(const struct Scene *scene, struct Sequence *seq, float frame_step, - struct rctf *view_area); + const struct rctf *view_area); /** * Get frame for first thumbnail. */ @@ -102,8 +102,8 @@ int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const struct Scene *scen void SEQ_render_thumbnails_base_set(const struct SeqRenderData *context, struct Sequence *seq, struct Sequence *seq_orig, - rctf *view_area, - const short *stop); + const struct rctf *view_area, + const bool *stop); void SEQ_render_init_colorspace(struct Sequence *seq); void SEQ_render_new_render_data(struct Main *bmain, diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c index 87da2017296..21ce2cbdf9a 100644 --- a/source/blender/sequencer/intern/image_cache.c +++ b/source/blender/sequencer/intern/image_cache.c @@ -811,8 +811,11 @@ bool seq_cache_put_if_possible( return false; } -void seq_cache_thumbnail_put( - const SeqRenderData *context, Sequence *seq, float timeline_frame, ImBuf *i, rctf *view_area) +void seq_cache_thumbnail_put(const SeqRenderData *context, + Sequence *seq, + float timeline_frame, + ImBuf *i, + const rctf *view_area) { Scene *scene = context->scene; diff --git a/source/blender/sequencer/intern/image_cache.h b/source/blender/sequencer/intern/image_cache.h index a7ae130dc41..7b7e020c926 100644 --- a/source/blender/sequencer/intern/image_cache.h +++ b/source/blender/sequencer/intern/image_cache.h @@ -48,7 +48,7 @@ void seq_cache_thumbnail_put(const struct SeqRenderData *context, struct Sequence *seq, float timeline_frame, struct ImBuf *i, - rctf *view_area); + const struct rctf *view_area); bool seq_cache_put_if_possible(const struct SeqRenderData *context, struct Sequence *seq, float timeline_frame, diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index fc1df4dc3ac..eaea310f423 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -479,10 +479,7 @@ bool SEQ_proxy_rebuild_context(Main *bmain, return true; } -void SEQ_proxy_rebuild(SeqIndexBuildContext *context, - short *stop, - short *do_update, - float *progress) +void SEQ_proxy_rebuild(SeqIndexBuildContext *context, bool *stop, bool *do_update, float *progress) { const bool overwrite = context->overwrite; SeqRenderData render_context; diff --git a/source/blender/sequencer/intern/proxy_job.c b/source/blender/sequencer/intern/proxy_job.c index 8520c06f9a2..d7dfe0130d8 100644 --- a/source/blender/sequencer/intern/proxy_job.c +++ b/source/blender/sequencer/intern/proxy_job.c @@ -41,7 +41,7 @@ static void proxy_freejob(void *pjv) } /* Only this runs inside thread. */ -static void proxy_startjob(void *pjv, short *stop, short *do_update, float *progress) +static void proxy_startjob(void *pjv, bool *stop, bool *do_update, float *progress) { ProxyJob *pj = pjv; LinkData *link; @@ -52,7 +52,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog SEQ_proxy_rebuild(context, stop, do_update, progress); if (*stop) { - pj->stop = 1; + pj->stop = true; fprintf(stderr, "Canceling proxy rebuild on users request...\n"); break; } diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index e3fd9216842..5c6a59a5943 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -2010,7 +2010,7 @@ ImBuf *SEQ_render_give_ibuf_direct(const SeqRenderData *context, float SEQ_render_thumbnail_first_frame_get(const Scene *scene, Sequence *seq, float frame_step, - rctf *view_area) + const rctf *view_area) { int first_drawable_frame = max_iii( SEQ_time_left_handle_frame_get(scene, seq), seq->start, view_area->xmin); @@ -2102,8 +2102,8 @@ void SEQ_render_thumbnails(const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, float frame_step, - rctf *view_area, - const short *stop) + const rctf *view_area, + const bool *stop) { SeqRenderState state; seq_render_state_init(&state); @@ -2163,8 +2163,8 @@ int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Scene *scene, cons void SEQ_render_thumbnails_base_set(const SeqRenderData *context, Sequence *seq, Sequence *seq_orig, - rctf *view_area, - const short *stop) + const rctf *view_area, + const bool *stop) { SeqRenderState state; seq_render_state_init(&state); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 1f9de8040f6..329e22c156a 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -341,6 +341,18 @@ void WM_cursor_warp(struct wmWindow *win, int x, int y); /* Handlers. */ +typedef enum eWM_EventHandlerFlag { + /** After this handler all others are ignored. */ + WM_HANDLER_BLOCKING = (1 << 0), + /** Handler accepts double key press events. */ + WM_HANDLER_ACCEPT_DBL_CLICK = (1 << 1), + + /* Internal. */ + /** Handler tagged to be freed in #wm_handlers_do(). */ + WM_HANDLER_DO_FREE = (1 << 7), +} eWM_EventHandlerFlag; +ENUM_OPERATORS(eWM_EventHandlerFlag, WM_HANDLER_DO_FREE) + typedef bool (*EventHandlerPoll)(const ARegion *region, const struct wmEvent *event); struct wmEventHandler_Keymap *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap); struct wmEventHandler_Keymap *WM_event_add_keymap_handler_poll(ListBase *handlers, @@ -407,7 +419,7 @@ struct wmEventHandler_UI *WM_event_add_ui_handler(const struct bContext *C, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, - char flag); + eWM_EventHandlerFlag flag); /** * Return the first modal operator of type \a ot or NULL. @@ -450,15 +462,6 @@ void WM_event_modal_handler_region_replace(wmWindow *win, */ void WM_event_remove_handlers(struct bContext *C, ListBase *handlers); -/* handler flag */ -enum { - WM_HANDLER_BLOCKING = (1 << 0), /* after this handler all others are ignored */ - WM_HANDLER_ACCEPT_DBL_CLICK = (1 << 1), /* handler accepts double key press events */ - - /* internal */ - WM_HANDLER_DO_FREE = (1 << 7), /* handler tagged to be freed in wm_handlers_do() */ -}; - struct wmEventHandler_Dropbox *WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes); @@ -1355,17 +1358,18 @@ void wmOrtho2_pixelspace(float x, float y); void wmGetProjectionMatrix(float mat[4][4], const struct rcti *winrct); /* threaded Jobs Manager */ -enum { +typedef enum eWM_JobFlag { WM_JOB_PRIORITY = (1 << 0), WM_JOB_EXCL_RENDER = (1 << 1), WM_JOB_PROGRESS = (1 << 2), -}; +} eWM_JobFlag; +ENUM_OPERATORS(enum eWM_JobFlag, WM_JOB_PROGRESS); /** * Identifying jobs by owner alone is unreliable, this isn't saved, * order can change (keep 0 for 'any'). */ -enum { +typedef enum eWM_JobType { WM_JOB_TYPE_ANY = 0, WM_JOB_TYPE_COMPOSITE, WM_JOB_TYPE_RENDER, @@ -1397,7 +1401,7 @@ enum { WM_JOB_TYPE_SEQ_DRAG_DROP_PREVIEW, /* add as needed, bake, seq proxy build * if having hard coded values is a problem */ -}; +} eWM_JobType; /** * \return current job or adds new job, but doesn't run it. @@ -1409,8 +1413,8 @@ struct wmJob *WM_jobs_get(struct wmWindowManager *wm, struct wmWindow *win, const void *owner, const char *name, - int flag, - int job_type); + eWM_JobFlag flag, + eWM_JobType job_type); /** * Returns true if job runs, for UI (progress) indicators. @@ -1432,8 +1436,8 @@ void WM_jobs_timer(struct wmJob *, double timestep, unsigned int note, unsigned void WM_jobs_delay_start(struct wmJob *, double delay_time); typedef void (*wm_jobs_start_callback)(void *custom_data, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress); void WM_jobs_callbacks(struct wmJob *, wm_jobs_start_callback startjob, @@ -1463,7 +1467,7 @@ void WM_jobs_stop(struct wmWindowManager *wm, const void *owner, void *startjob) */ void WM_jobs_kill(struct wmWindowManager *wm, void *owner, - void (*)(void *, short int *, short int *, float *)); + void (*)(void *, bool *, bool *, float *)); /** * Wait until every job ended. */ diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 181ec89cabd..c84df617f98 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -4535,7 +4535,7 @@ wmEventHandler_UI *WM_event_add_ui_handler(const bContext *C, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn, void *user_data, - const char flag) + const eWM_EventHandlerFlag flag) { wmEventHandler_UI *handler = MEM_cnew<wmEventHandler_UI>(__func__); handler->head.type = WM_HANDLER_TYPE_UI; diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 5360f327a0a..fcfc83312b8 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -108,8 +108,10 @@ struct wmJob { /* internal */ const void *owner; - int flag; - short suspended, running, ready, do_update, stop, job_type; + eWM_JobFlag flag; + bool suspended, running, ready; + eWM_JobType job_type; + bool do_update, stop; float progress; /** For display in header, identification */ @@ -152,9 +154,9 @@ static void wm_job_main_thread_yield(wmJob *wm_job) /** * Finds if type or owner, compare for it, otherwise any matching job. */ -static wmJob *wm_job_find(const wmWindowManager *wm, const void *owner, const int job_type) +static wmJob *wm_job_find(const wmWindowManager *wm, const void *owner, const eWM_JobType job_type) { - if (owner && job_type) { + if (owner && (job_type != WM_JOB_TYPE_ANY)) { LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) { if (wm_job->owner == owner && wm_job->job_type == job_type) { return wm_job; @@ -168,7 +170,7 @@ static wmJob *wm_job_find(const wmWindowManager *wm, const void *owner, const in } } } - else if (job_type) { + else if (job_type != WM_JOB_TYPE_ANY) { LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) { if (wm_job->job_type == job_type) { return wm_job; @@ -185,8 +187,8 @@ wmJob *WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, - int flag, - int job_type) + const eWM_JobFlag flag, + const eWM_JobType job_type) { wmJob *wm_job = wm_job_find(wm, owner, job_type); @@ -593,7 +595,7 @@ void WM_jobs_stop(wmWindowManager *wm, const void *owner, void *startjob) void WM_jobs_kill(wmWindowManager *wm, void *owner, - void (*startjob)(void *, short int *, short int *, float *)) + void (*startjob)(void *, bool *, bool *, float *)) { LISTBASE_FOREACH_MUTABLE (wmJob *, wm_job, &wm->jobs) { if (wm_job->owner == owner || wm_job->startjob == startjob) { diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index edbfe0202de..f49be20e174 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -29,21 +29,21 @@ extern "C" { /* wmKeyMap is in DNA_windowmanager.h, it's saveable */ /** Custom types for handlers, for signaling, freeing */ -enum eWM_EventHandlerType { +typedef enum eWM_EventHandlerType { WM_HANDLER_TYPE_GIZMO = 1, WM_HANDLER_TYPE_UI, WM_HANDLER_TYPE_OP, WM_HANDLER_TYPE_DROPBOX, WM_HANDLER_TYPE_KEYMAP, -}; +} eWM_EventHandlerType; typedef bool (*EventHandlerPoll)(const ARegion *region, const wmEvent *event); typedef struct wmEventHandler { struct wmEventHandler *next, *prev; - enum eWM_EventHandlerType type; - char flag; /* WM_HANDLER_BLOCKING, ... */ + eWM_EventHandlerType type; + eWM_EventHandlerFlag flag; EventHandlerPoll poll; } wmEventHandler; |