diff --git a/examples/example/entities/zoneSkyboxExample.js b/examples/example/entities/zoneSkyboxExample.js index 804afc1707..40b99d6c75 100644 --- a/examples/example/entities/zoneSkyboxExample.js +++ b/examples/example/entities/zoneSkyboxExample.js @@ -45,6 +45,8 @@ var zoneEntityA = Entities.addEntity({ stageSunModelEnabled: true }); +var props = Entities.getEntityProperties(zoneEntityA); +print(JSON.stringify(props)); // register the call back so it fires before each data send Script.update.connect(function(deltaTime) { diff --git a/libraries/entities/src/AtmospherePropertyGroup.cpp b/libraries/entities/src/AtmospherePropertyGroup.cpp index 54e48023b8..b9b49f8c45 100644 --- a/libraries/entities/src/AtmospherePropertyGroup.cpp +++ b/libraries/entities/src/AtmospherePropertyGroup.cpp @@ -26,13 +26,13 @@ AtmospherePropertyGroup::AtmospherePropertyGroup() { } void AtmospherePropertyGroup::copyToScriptValue(QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const { - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_VEC3(Atmosphere, Center, center); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, InnerRadius, innerRadius); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, OuterRadius, outerRadius); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, MieScattering, mieScattering); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, RayleighScattering, rayleighScattering); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_VEC3(Atmosphere, ScatteringWavelengths, scatteringWavelengths); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, HasStars, hasStars); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_VEC3(Atmosphere, atmosphere, Center, center); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, atmosphere, InnerRadius, innerRadius); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, atmosphere, OuterRadius, outerRadius); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, atmosphere, MieScattering, mieScattering); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, atmosphere, RayleighScattering, rayleighScattering); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_VEC3(Atmosphere, atmosphere, ScatteringWavelengths, scatteringWavelengths); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Atmosphere, atmosphere, HasStars, hasStars); } void AtmospherePropertyGroup::copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) { diff --git a/libraries/entities/src/EntityItemPropertiesMacros.h b/libraries/entities/src/EntityItemPropertiesMacros.h index ff6f1bd17a..39a159d6ea 100644 --- a/libraries/entities/src/EntityItemPropertiesMacros.h +++ b/libraries/entities/src/EntityItemPropertiesMacros.h @@ -219,37 +219,37 @@ } -#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_VEC3(G,P,p) \ +#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_VEC3(G,g,P,p) \ if (!skipDefaults || defaultEntityProperties.get##G().get##P() != _##p) { \ - QScriptValue groupProperties = properties.property(#G); \ + QScriptValue groupProperties = properties.property(#g); \ if (!groupProperties.isValid()) { \ groupProperties = engine->newObject(); \ } \ QScriptValue V = vec3toScriptValue(engine, _##p); \ groupProperties.setProperty(#p, V); \ - properties.setProperty(#G, groupProperties); \ + properties.setProperty(#g, groupProperties); \ } -#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(G,P,p) \ +#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(G,g,P,p) \ if (!skipDefaults || defaultEntityProperties.get##G().get##P() != _##p) { \ - QScriptValue groupProperties = properties.property(#G); \ + QScriptValue groupProperties = properties.property(#g); \ if (!groupProperties.isValid()) { \ groupProperties = engine->newObject(); \ } \ groupProperties.setProperty(#p, _##p); \ - properties.setProperty(#G, groupProperties); \ + properties.setProperty(#g, groupProperties); \ } -#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_COLOR(G,P,p) \ +#define COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_COLOR(G,g,P,p) \ if (!skipDefaults || defaultEntityProperties.get##G().get##P() != _##p) { \ - QScriptValue groupProperties = properties.property(#G); \ + QScriptValue groupProperties = properties.property(#g); \ if (!groupProperties.isValid()) { \ groupProperties = engine->newObject(); \ } \ QScriptValue colorValue = xColorToScriptValue(engine, _##p); \ groupProperties.setProperty(#p, colorValue); \ - properties.setProperty(#G, groupProperties); \ + properties.setProperty(#g, groupProperties); \ } diff --git a/libraries/entities/src/SkyboxPropertyGroup.cpp b/libraries/entities/src/SkyboxPropertyGroup.cpp index ea29e0f7c6..8b304d0523 100644 --- a/libraries/entities/src/SkyboxPropertyGroup.cpp +++ b/libraries/entities/src/SkyboxPropertyGroup.cpp @@ -21,8 +21,8 @@ SkyboxPropertyGroup::SkyboxPropertyGroup() { } void SkyboxPropertyGroup::copyToScriptValue(QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const { - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_COLOR(Skybox, Color, color); - COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Skybox, URL, url); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE_COLOR(Skybox, skybox, Color, color); + COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(Skybox, skybox, URL, url); } void SkyboxPropertyGroup::copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings) {