Use TypedAttribute instead of nonstd::optional for axis attribute.

This commit is contained in:
Syoyo Fujita
2023-07-21 22:00:08 +09:00
parent 081ed17ca0
commit 30b098fb6c
2 changed files with 8 additions and 8 deletions

View File

@@ -2512,11 +2512,11 @@ std::string to_string(const GeomCylinder &geom, const uint32_t indent, bool clos
ss << print_typed_attr(geom.radius, "radius", indent+1);
ss << print_typed_attr(geom.height, "height", indent+1);
if (geom.axis) {
if (geom.axis.authored()) {
std::string axis;
if (geom.axis.value() == Axis::X) {
if (geom.axis.get_value() == Axis::X) {
axis = "\"X\"";
} else if (geom.axis.value() == Axis::Y) {
} else if (geom.axis.get_value() == Axis::Y) {
axis = "\"Y\"";
} else {
axis = "\"Z\"";
@@ -2549,11 +2549,11 @@ std::string to_string(const GeomCapsule &geom, const uint32_t indent, bool closi
ss << print_typed_attr(geom.radius, "radius", indent+1);
ss << print_typed_attr(geom.height, "height", indent+1);
if (geom.axis) {
if (geom.axis.authored()) {
std::string axis;
if (geom.axis.value() == Axis::X) {
if (geom.axis.get_value() == Axis::X) {
axis = "\"X\"";
} else if (geom.axis.value() == Axis::Y) {
} else if (geom.axis.get_value() == Axis::Y) {
axis = "\"Y\"";
} else {
axis = "\"Z\"";

View File

@@ -643,7 +643,7 @@ struct GeomCapsule : public GPrim {
//
TypedAttributeWithFallback<Animatable<double>> height{2.0};
TypedAttributeWithFallback<Animatable<double>> radius{0.5};
nonstd::optional<Axis> axis; // uniform token axis
TypedAttribute<Axis> axis; // uniform token axis
};
struct GeomCylinder : public GPrim {
@@ -652,7 +652,7 @@ struct GeomCylinder : public GPrim {
//
TypedAttributeWithFallback<Animatable<double>> height{2.0};
TypedAttributeWithFallback<Animatable<double>> radius{1.0};
nonstd::optional<Axis> axis; // uniform token axis
TypedAttribute<Axis> axis; // uniform token axis
};
struct GeomCube : public GPrim {