mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 00:47:39 +02:00
commit
b0c326fa2c
3 changed files with 14 additions and 2 deletions
|
@ -115,10 +115,12 @@ Window {
|
||||||
Assets.mappingModel.refresh();
|
Assets.mappingModel.refresh();
|
||||||
}
|
}
|
||||||
function addToWorld() {
|
function addToWorld() {
|
||||||
var path = assetMappingsModel.data(treeView.currentIndex, 0x100);
|
var url = assetMappingsModel.data(treeView.currentIndex, 0x102);
|
||||||
if (!path) {
|
if (!url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Entities.addModelEntity(url, MyAvatar.position);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyURLToClipboard() {
|
function copyURLToClipboard() {
|
||||||
|
|
|
@ -178,6 +178,14 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUuid EntityScriptingInterface::addModelEntity(const QString& modelUrl, const glm::vec3& position) {
|
||||||
|
EntityItemProperties properties;
|
||||||
|
properties.setType(EntityTypes::Model);
|
||||||
|
properties.setModelURL(modelUrl);
|
||||||
|
properties.setPosition(position);
|
||||||
|
return addEntity(properties);
|
||||||
|
}
|
||||||
|
|
||||||
EntityItemProperties EntityScriptingInterface::getEntityProperties(QUuid identity) {
|
EntityItemProperties EntityScriptingInterface::getEntityProperties(QUuid identity) {
|
||||||
EntityPropertyFlags noSpecificProperties;
|
EntityPropertyFlags noSpecificProperties;
|
||||||
return getEntityProperties(identity, noSpecificProperties);
|
return getEntityProperties(identity, noSpecificProperties);
|
||||||
|
|
|
@ -84,6 +84,8 @@ public slots:
|
||||||
/// adds a model with the specific properties
|
/// adds a model with the specific properties
|
||||||
Q_INVOKABLE QUuid addEntity(const EntityItemProperties& properties);
|
Q_INVOKABLE QUuid addEntity(const EntityItemProperties& properties);
|
||||||
|
|
||||||
|
Q_INVOKABLE QUuid addModelEntity(const QString& modelUrl, const glm::vec3& position);
|
||||||
|
|
||||||
/// gets the current model properties for a specific model
|
/// gets the current model properties for a specific model
|
||||||
/// this function will not find return results in script engine contexts which don't have access to models
|
/// this function will not find return results in script engine contexts which don't have access to models
|
||||||
Q_INVOKABLE EntityItemProperties getEntityProperties(QUuid entityID);
|
Q_INVOKABLE EntityItemProperties getEntityProperties(QUuid entityID);
|
||||||
|
|
Loading…
Reference in a new issue