Merge branch 'master' into blender2.8

Conflicts:
	source/blender/alembic/intern/abc_exporter.cc
This commit is contained in:
Bastien Montagne 2017-04-14 12:36:56 +02:00
commit 95b3632112
16 changed files with 175 additions and 133 deletions

View File

@ -74,6 +74,9 @@ if 'cmake' in builder:
cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
cmake_extra_options.append('-DWITH_CODEC_QUICKTIME=OFF')
cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6')
cmake_extra_options.append('-DCUDA_HOST_COMPILER=/usr/local/cuda-hack/clang')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')
elif builder.startswith('win'):
@ -177,7 +180,7 @@ if 'cmake' in builder:
os.remove('CMakeCache.txt')
retcode = subprocess.call(target_chroot_prefix + ['cmake', blender_dir] + target_cmake_options)
if retcode != 0:
print('Condifuration FAILED!')
print('Configuration FAILED!')
sys.exit(retcode)
if 'win32' in builder or 'win64' in builder:

View File

@ -565,7 +565,7 @@ ccl_device_curveintersect bool bvh_cardinal_curve_intersect(KernelGlobals *kg, I
r_ext = mw_extension + r_curr;
#ifdef __KERNEL_SSE__
const float3 p_curr_sq = p_curr * p_curr;
const float3 dxxx = _mm_sqrt_ss(_mm_hadd_ps(p_curr_sq.m128, p_curr_sq.m128));
const float3 dxxx(_mm_sqrt_ss(_mm_hadd_ps(p_curr_sq.m128, p_curr_sq.m128)));
float d = dxxx.x;
#else
float d = sqrtf(p_curr.x * p_curr.x + p_curr.y * p_curr.y);

View File

@ -606,7 +606,7 @@ 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));
return _mm_div_ps(a.m128, norm);
return float3(_mm_div_ps(a.m128, norm));
#else
return a/len(a);
#endif
@ -657,7 +657,7 @@ ccl_device_inline bool operator!=(const float3& a, const float3& b)
ccl_device_inline float3 min(const float3& a, const float3& b)
{
#ifdef __KERNEL_SSE__
return _mm_min_ps(a.m128, b.m128);
return float3(_mm_min_ps(a.m128, b.m128));
#else
return make_float3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z));
#endif
@ -666,7 +666,7 @@ ccl_device_inline float3 min(const float3& a, const float3& b)
ccl_device_inline float3 max(const float3& a, const float3& b)
{
#ifdef __KERNEL_SSE__
return _mm_max_ps(a.m128, b.m128);
return float3(_mm_max_ps(a.m128, b.m128));
#else
return make_float3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z));
#endif
@ -681,7 +681,7 @@ ccl_device_inline float3 fabs(const float3& a)
{
#ifdef __KERNEL_SSE__
__m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff));
return _mm_and_ps(a.m128, mask);
return float3(_mm_and_ps(a.m128, mask));
#else
return make_float3(fabsf(a.x), fabsf(a.y), fabsf(a.z));
#endif
@ -714,8 +714,9 @@ ccl_device_inline void print_float3(const char *label, const float3& a)
ccl_device_inline float3 rcp(const float3& a)
{
#ifdef __KERNEL_SSE__
float4 r = _mm_rcp_ps(a.m128);
return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
const float4 r(_mm_rcp_ps(a.m128));
return float3(_mm_sub_ps(_mm_add_ps(r, r),
_mm_mul_ps(_mm_mul_ps(r, r), a)));
#else
return make_float3(1.0f/a.x, 1.0f/a.y, 1.0f/a.z);
#endif
@ -769,26 +770,29 @@ ccl_device_inline bool isequal_float3(const float3 a, const float3 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& b)
{
return _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(index_3, index_2, index_1, index_0)));
return float4(_mm_castsi128_ps(
_mm_shuffle_epi32(_mm_castps_si128(b),
_MM_SHUFFLE(index_3, index_2, index_1, index_0))));
}
#if defined(__KERNEL_SSE3__)
template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4& b)
{
return _mm_moveldup_ps(b);
return float4(_mm_moveldup_ps(b));
}
template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4& b)
{
return _mm_movehdup_ps(b);
return float4(_mm_movehdup_ps(b));
}
#endif
template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4& b)
{
return _mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b)));
return float4(_mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b))));
}
#endif
@ -799,7 +803,7 @@ ccl_device_inline float4 operator-(const float4& a)
{
#ifdef __KERNEL_SSE__
__m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
return _mm_xor_ps(a.m128, mask);
return float4(_mm_xor_ps(a.m128, mask));
#else
return make_float4(-a.x, -a.y, -a.z, -a.w);
#endif
@ -808,7 +812,7 @@ ccl_device_inline float4 operator-(const float4& a)
ccl_device_inline float4 operator*(const float4& a, const float4& b)
{
#ifdef __KERNEL_SSE__
return _mm_mul_ps(a.m128, b.m128);
return float4(_mm_mul_ps(a.m128, b.m128));
#else
return make_float4(a.x*b.x, a.y*b.y, a.z*b.z, a.w*b.w);
#endif
@ -831,8 +835,9 @@ ccl_device_inline float4 operator*(float f, const float4& a)
ccl_device_inline float4 rcp(const float4& a)
{
#ifdef __KERNEL_SSE__
float4 r = _mm_rcp_ps(a.m128);
return _mm_sub_ps(_mm_add_ps(r, r), _mm_mul_ps(_mm_mul_ps(r, r), a));
float4 r(_mm_rcp_ps(a.m128));
return float4(_mm_sub_ps(_mm_add_ps(r, r),
_mm_mul_ps(_mm_mul_ps(r, r), a)));
#else
return make_float4(1.0f/a.x, 1.0f/a.y, 1.0f/a.z, 1.0f/a.w);
#endif
@ -856,7 +861,7 @@ 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 _mm_add_ps(a.m128, b.m128);
return float4(_mm_add_ps(a.m128, b.m128));
#else
return make_float4(a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w);
#endif
@ -865,7 +870,7 @@ 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 _mm_sub_ps(a.m128, b.m128);
return float4(_mm_sub_ps(a.m128, b.m128));
#else
return make_float4(a.x-b.x, a.y-b.y, a.z-b.z, a.w-b.w);
#endif
@ -889,7 +894,8 @@ ccl_device_inline float4 operator/=(float4& a, float f)
ccl_device_inline int4 operator<(const float4& a, const float4& b)
{
#ifdef __KERNEL_SSE__
return _mm_cvtps_epi32(_mm_cmplt_ps(a.m128, b.m128)); /* todo: avoid cvt */
/* TODO(sergey): avoid cvt. */
return int4(_mm_cvtps_epi32(_mm_cmplt_ps(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
@ -898,7 +904,8 @@ 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 _mm_cvtps_epi32(_mm_cmpge_ps(a.m128, b.m128)); /* todo: avoid cvt */
/* TODO(sergey): avoid cvt. */
return int4(_mm_cvtps_epi32(_mm_cmpge_ps(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
@ -907,7 +914,8 @@ 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 _mm_cvtps_epi32(_mm_cmple_ps(a.m128, b.m128)); /* todo: avoid cvt */
/* TODO(sergey): avoid cvt. */
return int4(_mm_cvtps_epi32(_mm_cmple_ps(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
@ -943,8 +951,9 @@ ccl_device_inline bool is_zero(const float4& a)
ccl_device_inline float reduce_add(const float4& a)
{
#ifdef __KERNEL_SSE__
float4 h = shuffle<1,0,3,2>(a) + a;
return _mm_cvtss_f32(shuffle<2,3,0,1>(h) + h); /* todo: efficiency? */
float4 h(shuffle<1,0,3,2>(a) + a);
/* TODO(sergey): Investigate efficiency. */
return _mm_cvtss_f32(shuffle<2,3,0,1>(h) + h);
#else
return ((a.x + a.y) + (a.z + a.w));
#endif
@ -974,7 +983,7 @@ ccl_device_inline float4 safe_normalize(const float4& a)
ccl_device_inline float4 min(const float4& a, const float4& b)
{
#ifdef __KERNEL_SSE__
return _mm_min_ps(a.m128, b.m128);
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
@ -983,7 +992,7 @@ ccl_device_inline float4 min(const float4& a, const float4& b)
ccl_device_inline float4 max(const float4& a, const float4& b)
{
#ifdef __KERNEL_SSE__
return _mm_max_ps(a.m128, b.m128);
return float4(_mm_max_ps(a.m128, b.m128));
#else
return make_float4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w));
#endif
@ -996,7 +1005,9 @@ ccl_device_inline float4 max(const float4& a, const float4& b)
ccl_device_inline float4 select(const int4& mask, const float4& a, const float4& b)
{
#ifdef __KERNEL_SSE__
return _mm_or_ps(_mm_and_ps(_mm_cvtepi32_ps(mask), a), _mm_andnot_ps(_mm_cvtepi32_ps(mask), b)); /* todo: avoid cvt */
/* TODO(sergey): avoid cvt. */
return float4(_mm_or_ps(_mm_and_ps(_mm_cvtepi32_ps(mask), a),
_mm_andnot_ps(_mm_cvtepi32_ps(mask), b)));
#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
@ -1079,7 +1090,7 @@ ccl_device_inline int2 operator/(const int2 &a, const int2 &b)
ccl_device_inline int3 min(int3 a, int3 b)
{
#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
return _mm_min_epi32(a.m128, b.m128);
return int3(_mm_min_epi32(a.m128, b.m128));
#else
return make_int3(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z));
#endif
@ -1088,7 +1099,7 @@ ccl_device_inline int3 min(int3 a, int3 b)
ccl_device_inline int3 max(int3 a, int3 b)
{
#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
return _mm_max_epi32(a.m128, b.m128);
return int3(_mm_max_epi32(a.m128, b.m128));
#else
return make_int3(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z));
#endif
@ -1130,7 +1141,7 @@ ccl_device_inline void print_int3(const char *label, const int3& a)
ccl_device_inline int4 operator+(const int4& a, const int4& b)
{
#ifdef __KERNEL_SSE__
return _mm_add_epi32(a.m128, b.m128);
return int4(_mm_add_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
@ -1144,7 +1155,7 @@ ccl_device_inline int4 operator+=(int4& a, const int4& b)
ccl_device_inline int4 operator>>(const int4& a, int i)
{
#ifdef __KERNEL_SSE__
return _mm_srai_epi32(a.m128, i);
return int4(_mm_srai_epi32(a.m128, i));
#else
return make_int4(a.x >> i, a.y >> i, a.z >> i, a.w >> i);
#endif
@ -1153,7 +1164,7 @@ ccl_device_inline int4 operator>>(const int4& a, int i)
ccl_device_inline int4 min(int4 a, int4 b)
{
#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
return _mm_min_epi32(a.m128, b.m128);
return int4(_mm_min_epi32(a.m128, b.m128));
#else
return make_int4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w));
#endif
@ -1162,7 +1173,7 @@ ccl_device_inline int4 min(int4 a, int4 b)
ccl_device_inline int4 max(int4 a, int4 b)
{
#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
return _mm_max_epi32(a.m128, b.m128);
return int4(_mm_max_epi32(a.m128, b.m128));
#else
return make_int4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w));
#endif
@ -1176,8 +1187,10 @@ 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)
{
#ifdef __KERNEL_SSE__
__m128 m = _mm_cvtepi32_ps(mask);
return _mm_castps_si128(_mm_or_ps(_mm_and_ps(m, _mm_castsi128_ps(a)), _mm_andnot_ps(m, _mm_castsi128_ps(b)))); /* todo: avoid cvt */
const __m128 m = _mm_cvtepi32_ps(mask);
/* TODO(sergey): avoid cvt. */
return int4(_mm_castps_si128(_mm_or_ps(_mm_and_ps(m, _mm_castsi128_ps(a)),
_mm_andnot_ps(m, _mm_castsi128_ps(b)))));
#else
return make_int4((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
@ -1493,31 +1506,6 @@ ccl_device_inline float2 map_to_sphere(const float3 co)
return make_float2(u, v);
}
ccl_device_inline int util_max_axis(float3 vec)
{
#ifdef __KERNEL_SSE__
__m128 a = shuffle<0,0,1,1>(vec.m128);
__m128 b = shuffle<1,2,2,1>(vec.m128);
__m128 c = _mm_cmpgt_ps(a, b);
int mask = _mm_movemask_ps(c) & 0x7;
static const char tab[8] = {2, 2, 2, 0, 1, 2, 1, 0};
return tab[mask];
#else
if(vec.x > vec.y) {
if(vec.x > vec.z)
return 0;
else
return 2;
}
else {
if(vec.y > vec.z)
return 1;
else
return 2;
}
#endif
}
CCL_NAMESPACE_END
#endif /* __UTIL_MATH_H__ */

View File

@ -182,7 +182,7 @@ struct ccl_try_align(16) int3 {
};
__forceinline int3() {}
__forceinline int3(const __m128i& a) : m128(a) {}
__forceinline explicit int3(const __m128i& a) : m128(a) {}
__forceinline operator const __m128i&(void) const { return m128; }
__forceinline operator __m128i&(void) { return m128; }
@ -204,7 +204,7 @@ struct ccl_try_align(16) int4 {
};
__forceinline int4() {}
__forceinline int4(const __m128i& a) : m128(a) {}
__forceinline explicit int4(const __m128i& a) : m128(a) {}
__forceinline operator const __m128i&(void) const { return m128; }
__forceinline operator __m128i&(void) { return m128; }
@ -254,7 +254,7 @@ struct ccl_try_align(16) float3 {
};
__forceinline float3() {}
__forceinline float3(const __m128& a) : m128(a) {}
__forceinline explicit float3(const __m128& a) : m128(a) {}
__forceinline operator const __m128&(void) const { return m128; }
__forceinline operator __m128&(void) { return m128; }
@ -276,7 +276,7 @@ struct ccl_try_align(16) float4 {
};
__forceinline float4() {}
__forceinline float4(const __m128& a) : m128(a) {}
__forceinline explicit float4(const __m128& a) : m128(a) {}
__forceinline operator const __m128&(void) const { return m128; }
__forceinline operator __m128&(void) { return m128; }

View File

@ -318,7 +318,7 @@ class BoundingBox:
class StrokeCollector(StrokeShader):
"Collects and Stores stroke objects"
"""Collects and Stores stroke objects"""
def __init__(self):
StrokeShader.__init__(self)
self.strokes = []

View File

@ -36,7 +36,7 @@ from bpy.props import (
class ANIM_OT_keying_set_export(Operator):
"Export Keying Set to a python script"
"""Export Keying Set to a python script"""
bl_idname = "anim.keying_set_export"
bl_label = "Export Keying Set..."
@ -102,15 +102,13 @@ class ANIM_OT_keying_set_export(Operator):
if ksp.id in id_to_paths_cache:
continue
"""
- idtype_list is used to get the list of id-datablocks from
bpy.data.* since this info isn't available elsewhere
- id.bl_rna.name gives a name suitable for UI,
with a capitalised first letter, but we need
the plural form that's all lower case
- special handling is needed for "nested" ID-blocks
(e.g. nodetree in Material)
"""
# - idtype_list is used to get the list of id-datablocks from
# bpy.data.* since this info isn't available elsewhere
# - id.bl_rna.name gives a name suitable for UI,
# with a capitalised first letter, but we need
# the plural form that's all lower case
# - special handling is needed for "nested" ID-blocks
# (e.g. nodetree in Material)
if ksp.id.bl_rna.identifier.startswith("ShaderNodeTree"):
# Find material or lamp using this node tree...
id_bpy_path = "bpy.data.nodes[\"%s\"]"

View File

@ -24,7 +24,7 @@ from bpy.props import BoolProperty
class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
"Extrude individual elements and move"
"""Extrude individual elements and move"""
bl_label = "Extrude Individual and Move"
bl_idname = "view3d.edit_mesh_extrude_individual_move"
@ -62,7 +62,7 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
class VIEW3D_OT_edit_mesh_extrude_move(Operator):
"Extrude and move along normals"
"""Extrude and move along normals"""
bl_label = "Extrude and Move on Normals"
bl_idname = "view3d.edit_mesh_extrude_move_normal"
@ -111,7 +111,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
"Extrude and move along individual normals"
"""Extrude and move along individual normals"""
bl_label = "Extrude and Move on Individual Normals"
bl_idname = "view3d.edit_mesh_extrude_move_shrink_fatten"
@ -128,7 +128,7 @@ class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
class VIEW3D_OT_select_or_deselect_all(Operator):
"Select element under the mouse, deselect everything is there's nothing under the mouse"
"""Select element under the mouse, deselect everything is there's nothing under the mouse"""
bl_label = "Select or Deselect All"
bl_idname = "view3d.select_or_deselect_all"
bl_options = {'UNDO'}
@ -220,4 +220,4 @@ classes = (
VIEW3D_OT_edit_mesh_extrude_move,
VIEW3D_OT_edit_mesh_extrude_shrink_fatten,
VIEW3D_OT_select_or_deselect_all,
)
)

View File

@ -845,7 +845,7 @@ class WM_OT_context_modal_mouse(Operator):
class WM_OT_url_open(Operator):
"Open a website in the web-browser"
"""Open a website in the web-browser"""
bl_idname = "wm.url_open"
bl_label = ""
bl_options = {'INTERNAL'}
@ -862,7 +862,7 @@ class WM_OT_url_open(Operator):
class WM_OT_path_open(Operator):
"Open a path in a file browser"
"""Open a path in a file browser"""
bl_idname = "wm.path_open"
bl_label = ""
bl_options = {'INTERNAL'}
@ -1324,7 +1324,7 @@ class WM_OT_properties_add(Operator):
class WM_OT_properties_context_change(Operator):
"Jump to a different tab inside the properties editor"
"""Jump to a different tab inside the properties editor"""
bl_idname = "wm.properties_context_change"
bl_label = ""
bl_options = {'INTERNAL'}
@ -1532,7 +1532,7 @@ class WM_OT_blenderplayer_start(Operator):
class WM_OT_keyconfig_test(Operator):
"Test key-config for conflicts"
"""Test key-config for conflicts"""
bl_idname = "wm.keyconfig_test"
bl_label = "Test Key Configuration for Conflicts"
@ -1549,7 +1549,7 @@ class WM_OT_keyconfig_test(Operator):
class WM_OT_keyconfig_import(Operator):
"Import key configuration from a python script"
"""Import key configuration from a python script"""
bl_idname = "wm.keyconfig_import"
bl_label = "Import Key Configuration..."
@ -1616,7 +1616,7 @@ class WM_OT_keyconfig_import(Operator):
class WM_OT_keyconfig_export(Operator):
"Export key configuration to a python script"
"""Export key configuration to a python script"""
bl_idname = "wm.keyconfig_export"
bl_label = "Export Key Configuration..."
@ -1666,7 +1666,7 @@ class WM_OT_keyconfig_export(Operator):
class WM_OT_keymap_restore(Operator):
"Restore key map(s)"
"""Restore key map(s)"""
bl_idname = "wm.keymap_restore"
bl_label = "Restore Key Map(s)"
@ -1689,7 +1689,7 @@ class WM_OT_keymap_restore(Operator):
class WM_OT_keyitem_restore(Operator):
"Restore key map item"
"""Restore key map item"""
bl_idname = "wm.keyitem_restore"
bl_label = "Restore Key Map Item"
@ -1714,7 +1714,7 @@ class WM_OT_keyitem_restore(Operator):
class WM_OT_keyitem_add(Operator):
"Add key map item"
"""Add key map item"""
bl_idname = "wm.keyitem_add"
bl_label = "Add Key Map Item"
@ -1736,7 +1736,7 @@ class WM_OT_keyitem_add(Operator):
class WM_OT_keyitem_remove(Operator):
"Remove key map item"
"""Remove key map item"""
bl_idname = "wm.keyitem_remove"
bl_label = "Remove Key Map Item"
@ -1757,7 +1757,7 @@ class WM_OT_keyitem_remove(Operator):
class WM_OT_keyconfig_remove(Operator):
"Remove key config"
"""Remove key config"""
bl_idname = "wm.keyconfig_remove"
bl_label = "Remove Key Config"
@ -1775,6 +1775,7 @@ class WM_OT_keyconfig_remove(Operator):
class WM_OT_operator_cheat_sheet(Operator):
"""List all the Operators in a text-block, useful for scripting"""
bl_idname = "wm.operator_cheat_sheet"
bl_label = "Operator Cheat Sheet"
@ -1803,7 +1804,7 @@ class WM_OT_operator_cheat_sheet(Operator):
# Add-on Operators
class WM_OT_addon_enable(Operator):
"Enable an add-on"
"""Enable an add-on"""
bl_idname = "wm.addon_enable"
bl_label = "Enable Add-on"
@ -1847,7 +1848,7 @@ class WM_OT_addon_enable(Operator):
class WM_OT_addon_disable(Operator):
"Disable an add-on"
"""Disable an add-on"""
bl_idname = "wm.addon_disable"
bl_label = "Disable Add-on"
@ -1876,7 +1877,7 @@ class WM_OT_addon_disable(Operator):
class WM_OT_theme_install(Operator):
"Load and apply a Blender XML theme file"
"""Load and apply a Blender XML theme file"""
bl_idname = "wm.theme_install"
bl_label = "Install Theme..."
@ -1938,7 +1939,7 @@ class WM_OT_theme_install(Operator):
class WM_OT_addon_refresh(Operator):
"Scan add-on directories for new modules"
"""Scan add-on directories for new modules"""
bl_idname = "wm.addon_refresh"
bl_label = "Refresh"
@ -1953,7 +1954,7 @@ class WM_OT_addon_refresh(Operator):
# Note: shares some logic with WM_OT_app_template_install
# but not enough to de-duplicate. Fixed here may apply to both.
class WM_OT_addon_install(Operator):
"Install an add-on"
"""Install an add-on"""
bl_idname = "wm.addon_install"
bl_label = "Install Add-on from File..."
@ -2107,7 +2108,7 @@ class WM_OT_addon_install(Operator):
class WM_OT_addon_remove(Operator):
"Delete the add-on from the file system"
"""Delete the add-on from the file system"""
bl_idname = "wm.addon_remove"
bl_label = "Remove Add-on"
@ -2166,7 +2167,7 @@ class WM_OT_addon_remove(Operator):
class WM_OT_addon_expand(Operator):
"Display information and preferences for this add-on"
"""Display information and preferences for this add-on"""
bl_idname = "wm.addon_expand"
bl_label = ""
bl_options = {'INTERNAL'}
@ -2190,7 +2191,7 @@ class WM_OT_addon_expand(Operator):
class WM_OT_addon_userpref_show(Operator):
"Show add-on user preferences"
"""Show add-on user preferences"""
bl_idname = "wm.addon_userpref_show"
bl_label = ""
bl_options = {'INTERNAL'}
@ -2222,7 +2223,7 @@ class WM_OT_addon_userpref_show(Operator):
# Note: shares some logic with WM_OT_addon_install
# but not enough to de-duplicate. Fixes here may apply to both.
class WM_OT_app_template_install(Operator):
"Install an application-template"
"""Install an application-template"""
bl_idname = "wm.app_template_install"
bl_label = "Install Template from File..."

View File

@ -124,14 +124,32 @@ static bool object_is_shape(Object *ob)
}
}
static bool export_object(const ExportSettings * const settings, const Base * const ob_base)
/**
* Returns whether this object should be exported into the Alembic file.
*
* @param settings export settings, used for options like 'selected only'.
* @param ob the object's base in question.
* @param is_duplicated normally false; true when the object is instanced
* into the scene by a dupli-object (e.g. part of a
* dupligroup). This ignores selection and layer
* visibility, and assumes that the dupli-object itself
* (e.g. the group-instantiating empty) is exported.
*/
static bool export_object(const ExportSettings * const settings, const Base * const ob_base,
bool is_duplicated)
{
if (settings->selected_only && !object_selected(ob_base)) {
return false;
}
// FIXME Sybren: handle these cleanly (maybe just remove code), now using active scene layer instead.
if (settings->visible_layers_only && (ob_base->flag & BASE_VISIBLED) == 0) {
return false;
if (!is_duplicated) {
/* These two tests only make sense when the object isn't being instanced
* into the scene. When it is, its exportability is determined by
* its dupli-object and the DupliObject::no_draw property. */
if (settings->selected_only && !object_selected(ob_base)) {
return false;
}
// FIXME Sybren: handle these cleanly (maybe just remove code), now using active scene layer instead.
if (settings->visible_layers_only && (ob_base->flag & BASE_VISIBLED) == 0) {
return false;
}
}
// if (settings->renderable_only && (ob->restrictflag & OB_RESTRICT_RENDER)) {
@ -347,7 +365,7 @@ void AbcExporter::createTransformWritersHierarchy(EvaluationContext *eval_ctx)
for (Base *base = static_cast<Base *>(m_settings.sl->object_bases.first); base; base = base->next) {
Object *ob = base->object;
if (export_object(&m_settings, base)) {
if (export_object(&m_settings, base, false)) {
switch (ob->type) {
case OB_LAMP:
case OB_LATTICE:
@ -368,7 +386,7 @@ void AbcExporter::createTransformWritersFlat()
for (Base *base = static_cast<Base *>(m_settings.sl->object_bases.first); base; base = base->next) {
Object *ob = base->object;
if (!export_object(&m_settings, base)) {
if (export_object(&m_settings, base, false) && object_is_shape(ob)) {
std::string name = get_id_name(ob);
m_xforms[name] = new AbcTransformWriter(
ob, m_writer->archive().getTop(), NULL,
@ -381,7 +399,13 @@ void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, O
{
Object *ob = ob_base->object;
if (export_object(&m_settings, ob_base) && object_is_shape(ob)) {
/* If an object isn't exported itself, its duplilist shouldn't be
* exported either. */
if (!export_object(&m_settings, ob_base, dupliObParent != NULL)) {
return;
}
if (object_is_shape(ob)) {
createTransformWriter(ob, parent, dupliObParent);
}
@ -391,9 +415,15 @@ void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Base *ob_base, O
Base fake_base = *ob_base; // copy flags (like selection state) from the real object.
fake_base.next = fake_base.prev = NULL;
for (DupliObject *link = static_cast<DupliObject *>(lb->first); link; link = link->next) {
Object *dupli_ob = NULL;
Object *dupli_parent = NULL;
DupliObject *link = static_cast<DupliObject *>(lb->first);
Object *dupli_ob = NULL;
Object *dupli_parent = NULL;
for (; link; link = link->next) {
/* This skips things like custom bone shapes. */
if (m_settings.renderable_only && link->no_draw) {
continue;
}
if (link->type == OB_DUPLIGROUP) {
dupli_ob = link->ob;
@ -469,18 +499,30 @@ void AbcExporter::createShapeWriters(EvaluationContext *eval_ctx)
void AbcExporter::exploreObject(EvaluationContext *eval_ctx, Base *ob_base, Object *dupliObParent)
{
Object *ob = ob_base->object;
ListBase *lb = object_duplilist(eval_ctx, m_scene, ob);
/* If an object isn't exported itself, its duplilist shouldn't be
* exported either. */
if (!export_object(&m_settings, ob_base, dupliObParent != NULL)) {
return;
}
createShapeWriter(ob_base, dupliObParent);
Object *ob = ob_base->object;
ListBase *lb = object_duplilist(eval_ctx, m_scene, ob);
if (lb) {
Base fake_base = *ob_base; // copy flags (like selection state) from the real object.
fake_base.next = fake_base.prev = NULL;
for (DupliObject *dupliob = static_cast<DupliObject *>(lb->first); dupliob; dupliob = dupliob->next) {
if (dupliob->type == OB_DUPLIGROUP) {
fake_base.object = dupliob->ob;
DupliObject *link = static_cast<DupliObject *>(lb->first);
for (; link; link = link->next) {
/* This skips things like custom bone shapes. */
if (m_settings.renderable_only && link->no_draw) {
continue;
}
if (link->type == OB_DUPLIGROUP) {
fake_base.object = link->ob;
exploreObject(eval_ctx, &fake_base, ob);
}
}
@ -497,10 +539,6 @@ void AbcExporter::createShapeWriter(Base *ob_base, Object *dupliObParent)
return;
}
if (!export_object(&m_settings, ob_base)) {
return;
}
std::string name;
if (m_settings.flatten_hierarchy) {

View File

@ -734,8 +734,8 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
CFRA = SFRA;
}
else if (min_time < max_time) {
SFRA = static_cast<int>(min_time * FPS);
EFRA = static_cast<int>(max_time * FPS);
SFRA = static_cast<int>(round(min_time * FPS));
EFRA = static_cast<int>(round(max_time * FPS));
CFRA = SFRA;
}
}

View File

@ -135,6 +135,7 @@ void blf_glyph_cache_clear(FontBLF *font)
while ((gc = BLI_pophead(&font->cache))) {
blf_glyph_cache_free(gc);
}
font->glyph_cache = NULL;
}
void blf_glyph_cache_free(GlyphCacheBLF *gc)

View File

@ -168,6 +168,9 @@ struct TaskPool {
*/
bool use_local_tls;
TaskThreadLocalStorage local_tls;
#ifndef NDEBUG
pthread_t creator_thread_id;
#endif
#ifdef DEBUG_STATS
TaskMemPoolStats *mempool_stats;
@ -220,11 +223,14 @@ BLI_INLINE TaskThreadLocalStorage *get_task_tls(TaskPool *pool,
TaskScheduler *scheduler = pool->scheduler;
BLI_assert(thread_id >= 0);
BLI_assert(thread_id <= scheduler->num_threads);
if (pool->use_local_tls) {
if (pool->use_local_tls && thread_id == 0) {
BLI_assert(pool->thread_id == 0);
BLI_assert(!BLI_thread_is_main());
BLI_assert(pthread_equal(pthread_self(), pool->creator_thread_id));
return &pool->local_tls;
}
if (thread_id == 0) {
BLI_assert(BLI_thread_is_main());
return &scheduler->task_threads[pool->thread_id].tls;
}
return &scheduler->task_threads[thread_id].tls;
@ -268,6 +274,9 @@ static void task_free(TaskPool *pool, Task *task, const int thread_id)
task_data_free(task, thread_id);
BLI_assert(thread_id >= 0);
BLI_assert(thread_id <= pool->scheduler->num_threads);
if (thread_id == 0) {
BLI_assert(pool->use_local_tls || BLI_thread_is_main());
}
TaskThreadLocalStorage *tls = get_task_tls(pool, thread_id);
TaskMemPool *task_mempool = &tls->task_mempool;
if (task_mempool->num_tasks < MEMPOOL_SIZE - 1) {
@ -613,6 +622,9 @@ static TaskPool *task_pool_create_ex(TaskScheduler *scheduler,
*/
pool->thread_id = 0;
pool->use_local_tls = true;
#ifndef NDEBUG
pool->creator_thread_id = pthread_self();
#endif
initialize_task_tls(&pool->local_tls);
}
else {

View File

@ -793,7 +793,7 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot)
/* identifiers */
ot->name = "Add Modifier";
ot->description = "Add a modifier to the active object";
ot->description = "Add a procedural operation/effect to the active object";
ot->idname = "OBJECT_OT_modifier_add";
/* api callbacks */

View File

@ -612,7 +612,7 @@ void WORLD_OT_new(wmOperatorType *ot)
/* identifiers */
ot->name = "New World";
ot->idname = "WORLD_OT_new";
ot->description = "Add a new world";
ot->description = "Create a new world Data-Block";
/* api callbacks */
ot->exec = new_world_exec;

View File

@ -670,7 +670,7 @@ static void SOUND_OT_mixdown(wmOperatorType *ot)
/* identifiers */
ot->name = "Mixdown";
ot->description = "Mixes the scene's audio to a sound file";
ot->description = "Mix the scene's audio to a sound file";
ot->idname = "SOUND_OT_mixdown";
/* api callbacks */

View File

@ -1103,6 +1103,11 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un
tdm = smd->target->derivedFinal;
}
if (!tdm) {
modifier_setError(md, "No valid target mesh");
return;
}
tnumverts = tdm->getNumVerts(tdm);
tnumpoly = tdm->getNumPolys(tdm);
@ -1122,12 +1127,10 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un
/* Poly count checks */
if (smd->numverts != numverts) {
modifier_setError(md, "Verts changed from %u to %u", smd->numverts, numverts);
tdm->release(tdm);
return;
}
else if (smd->numpoly != tnumpoly) {
modifier_setError(md, "Target polygons changed from %u to %u", smd->numpoly, tnumpoly);
tdm->release(tdm);
return;
}
@ -1153,8 +1156,6 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un
MEM_freeN(data.targetCos);
}
tdm->release(tdm);
}
static void deformVerts(ModifierData *md, Object *ob,