mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 11:14:10 +02:00
new local reference to image model
This commit is contained in:
parent
d7a847930d
commit
73fde4333e
6 changed files with 12 additions and 8 deletions
|
@ -183,7 +183,7 @@ Windows.ScrollingWindow {
|
|||
|
||||
if (defaultURL.endsWith(".jpg") || defaultURL.endsWith(".png")) {
|
||||
var name = assetProxyModel.data(treeView.selection.currentIndex);
|
||||
var modelURL = "qrc:///snapshot/snapshot.fbx";
|
||||
var modelURL = "../../meshes/images/default-image-model.fbx";
|
||||
var textures = JSON.stringify({ "tex.picture": defaultURL});
|
||||
var shapeType = "box";
|
||||
var dynamic = false;
|
||||
|
|
|
@ -184,7 +184,7 @@ Rectangle {
|
|||
|
||||
if (defaultURL.endsWith(".jpg") || defaultURL.endsWith(".png")) {
|
||||
var name = assetProxyModel.data(treeView.selection.currentIndex);
|
||||
var modelURL = "qrc:///snapshot/snapshot.fbx";
|
||||
var modelURL = "../../../meshes/images/default-image-model.fbx";
|
||||
var textures = JSON.stringify({ "tex.picture": defaultURL});
|
||||
var shapeType = "box";
|
||||
var dynamic = false;
|
||||
|
|
|
@ -540,6 +540,8 @@ var toolBar = (function () {
|
|||
});
|
||||
|
||||
addButton("newImageButton", "web-01.svg", function () {
|
||||
var IMAGE_MODEL = Script.resolvePath("../../interface/resources/meshes/images/default-image-model.fbx");
|
||||
var DEFAULT_IMAGE = Script.resolvePath("../../interface/resources/snapshot/img/no-image.jpg");
|
||||
createNewEntity({
|
||||
type: "Model",
|
||||
dimensions: {
|
||||
|
@ -548,8 +550,8 @@ var toolBar = (function () {
|
|||
z: 2.58
|
||||
},
|
||||
shapeType: "box",
|
||||
modelURL: 'qrc:///snapshot/snapshot.fbx',
|
||||
textures: JSON.stringify({ "tex.picture": 'qrc:///snapshot/img/no-image.jpg' })
|
||||
modelURL: IMAGE_MODEL,
|
||||
textures: JSON.stringify({ "tex.picture": DEFAULT_IMAGE })
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -156,9 +156,9 @@ function loaded() {
|
|||
var urlParts = url.split('/');
|
||||
var filename = urlParts[urlParts.length - 1];
|
||||
|
||||
var snapURL = 'qrc:///snapshot/snapshot.fbx';
|
||||
var IMAGE_MODEL_NAME = 'default-image-model.fbx';
|
||||
|
||||
if (url === snapURL) {
|
||||
if (filename === IMAGE_MODEL_NAME) {
|
||||
type = "Image";
|
||||
}
|
||||
|
||||
|
|
|
@ -797,8 +797,10 @@ function loaded() {
|
|||
elID.value = properties.id;
|
||||
|
||||
// HTML workaround since image is not yet a separate entity type
|
||||
var snapURL = 'qrc:///snapshot/snapshot.fbx';
|
||||
if (properties.type === "Model" && properties.modelURL === snapURL) {
|
||||
var IMAGE_MODEL_NAME = 'default-image-model.fbx';
|
||||
var urlParts = properties.modelURL.split('/')
|
||||
var propsFilename = urlParts[urlParts.length - 1];
|
||||
if (properties.type === "Model" && propsFilename === IMAGE_MODEL_NAME) {
|
||||
properties.type = "Image";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue