Merge pull request #1563 from MoritzBrueckner/fix-trait-props
Fix bool type trait properties
This commit is contained in:
commit
3ef7683dfd
|
@ -82,7 +82,7 @@ class ArmTraitPropListItem(bpy.types.PropertyGroup):
|
||||||
elif self.type == "Float":
|
elif self.type == "Float":
|
||||||
self.value_float = float(val)
|
self.value_float = float(val)
|
||||||
elif self.type == "Bool":
|
elif self.type == "Bool":
|
||||||
self.value_bool = bool(val)
|
self.value_bool = val == "true"
|
||||||
elif self.type in ("Vec2", "Vec3", "Vec4"):
|
elif self.type in ("Vec2", "Vec3", "Vec4"):
|
||||||
if isinstance(val, str):
|
if isinstance(val, str):
|
||||||
dimensions = int(self.type[-1])
|
dimensions = int(self.type[-1])
|
||||||
|
|
|
@ -479,7 +479,8 @@ def fetch_prop(o):
|
||||||
prop = item.arm_traitpropslist[found_prop.name]
|
prop = item.arm_traitpropslist[found_prop.name]
|
||||||
|
|
||||||
# Default value added and current value is blank (no override)
|
# Default value added and current value is blank (no override)
|
||||||
if (not found_prop.get_value() and defaults[index]):
|
if (found_prop.get_value() is None
|
||||||
|
or found_prop.get_value() == "") and defaults[index]:
|
||||||
prop.set_value(defaults[index])
|
prop.set_value(defaults[index])
|
||||||
# Type has changed, update displayed name
|
# Type has changed, update displayed name
|
||||||
if (len(found_prop.name) == 1 or (len(found_prop.name) > 1 and found_prop.name[1] != p[1])):
|
if (len(found_prop.name) == 1 or (len(found_prop.name) > 1 and found_prop.name[1] != p[1])):
|
||||||
|
|
Loading…
Reference in a new issue