I want to have two custom properties in my schema, that have a fallback value if they are not defined, or if their value is below 0.0
this is the schema:
schema: {
url: { type: 'string'},
key: { type: 'string'},
intensity: {
// default is -100 to trigger fallback
default: -100,
parse: function (value) {
if (value >= 0.0) {
return value
}
return -100
}
}
}
The property that is giving me issues is the intensity property. If it is defined in the a-entity
<a-entity io3d-data3d="key: mykey; lightMapIntensity: 1.0" shadow="receive: true"></a-entity>
the value is properly used by the component, but when I open the a-frame 3d editor and click on the entity - I get this error:
this does not happen, if the attributes are not set in a-entity
.
Am I doing something wrong when using custom properties? Is there a way to define optional properties, that have undefined or null as a default value?
Custom Property Type:
https://aframe.io/docs/0.6.0/core/component.html#custom-property-type