mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Use TypedAttribute instead of nonstd::optional for axis attribute.
This commit is contained in:
@@ -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\"";
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user