Add getStaticCertificateJSON() to Entity Scripting Interface

This commit is contained in:
Zach Fox 2017-12-12 15:50:04 -08:00
parent 1bd12857ef
commit f5df83667f
2 changed files with 19 additions and 0 deletions

View file

@ -1821,6 +1821,19 @@ glm::mat4 EntityScriptingInterface::getEntityLocalTransform(const QUuid& entityI
return result;
}
QByteArray EntityScriptingInterface::getStaticCertificateJSON(QUuid entityID) {
QByteArray result;
if (_entityTree) {
_entityTree->withReadLock([&] {
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(EntityItemID(entityID));
if (entity) {
result = entity->getProperties().getStaticCertificateJSON();
}
});
}
return result;
}
bool EntityScriptingInterface::verifyStaticCertificateProperties(const QUuid& entityID) {
bool result = false;
if (_entityTree) {

View file

@ -423,6 +423,12 @@ public slots:
*/
Q_INVOKABLE glm::mat4 getEntityLocalTransform(const QUuid& entityID);
/**jsdoc
* Return the Static Certificate JSON for the specified {EntityID}.
* @return {QByteArray} The Static Certificate JSON for the specified entity.
*/
Q_INVOKABLE QByteArray getStaticCertificateJSON(QUuid entityID);
Q_INVOKABLE bool verifyStaticCertificateProperties(const QUuid& entityID);
signals: