[Bf-blender-cvs] [d0223289747] functions: new float2 particle attribute type
Jacques Lucke
noreply at git.blender.org
Fri Aug 2 19:14:50 CEST 2019
Commit: d0223289747c3959c8276c98d31baf1b19eb4510
Author: Jacques Lucke
Date: Fri Aug 2 13:18:57 2019 +0200
Branches: functions
https://developer.blender.org/rBd0223289747c3959c8276c98d31baf1b19eb4510
new float2 particle attribute type
===================================================================
M source/blender/simulations/bparticles/attributes.hpp
===================================================================
diff --git a/source/blender/simulations/bparticles/attributes.hpp b/source/blender/simulations/bparticles/attributes.hpp
index 1cbd2c6332c..9fb5b89ca63 100644
--- a/source/blender/simulations/bparticles/attributes.hpp
+++ b/source/blender/simulations/bparticles/attributes.hpp
@@ -15,6 +15,7 @@ namespace BParticles {
using BLI::ArrayAllocator;
using BLI::ArrayRef;
+using BLI::float2;
using BLI::float3;
using BLI::Optional;
using BLI::Range;
@@ -32,6 +33,7 @@ enum AttributeType {
Byte,
Integer,
Float,
+ Float2,
Float3,
RGBA_f,
};
@@ -47,6 +49,7 @@ template<typename T> struct attribute_type_by_type {
ATTRIBUTE_TYPE_BY_TYPE(uint8_t, Byte);
ATTRIBUTE_TYPE_BY_TYPE(int32_t, Integer);
ATTRIBUTE_TYPE_BY_TYPE(float, Float);
+ATTRIBUTE_TYPE_BY_TYPE(float2, Float2);
ATTRIBUTE_TYPE_BY_TYPE(float3, Float3);
ATTRIBUTE_TYPE_BY_TYPE(rgba_f, RGBA_f);
@@ -66,14 +69,15 @@ inline uint size_of_attribute_type(AttributeType type)
return sizeof(int32_t);
case AttributeType::Float:
return sizeof(float);
+ case AttributeType::Float2:
+ return sizeof(float2);
case AttributeType::Float3:
return sizeof(float3);
case AttributeType::RGBA_f:
return sizeof(rgba_f);
- default:
- BLI_assert(false);
- return 0;
};
+ BLI_assert(false);
+ return 0;
}
#define MAX_ATTRIBUTE_SIZE sizeof(rgba_f)
More information about the Bf-blender-cvs
mailing list