mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-24 09:54:19 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into skin
This commit is contained in:
commit
4ffaee9dce
7 changed files with 38 additions and 19 deletions
|
@ -2916,7 +2916,7 @@ bool Application::exportEntities(const QString& filename, const QVector<EntityIt
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (success) {
|
if (success) {
|
||||||
exportTree->writeToJSONFile(filename.toLocal8Bit().constData());
|
success = exportTree->writeToJSONFile(filename.toLocal8Bit().constData());
|
||||||
|
|
||||||
// restore the main window's active state
|
// restore the main window's active state
|
||||||
_window->activateWindow();
|
_window->activateWindow();
|
||||||
|
|
|
@ -1868,24 +1868,26 @@ bool Octree::readJSONFromStream(unsigned long streamLength, QDataStream& inputSt
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octree::writeToFile(const char* fileName, OctreeElementPointer element, QString persistAsFileType) {
|
bool Octree::writeToFile(const char* fileName, OctreeElementPointer element, QString persistAsFileType) {
|
||||||
// make the sure file extension makes sense
|
// make the sure file extension makes sense
|
||||||
QString qFileName = fileNameWithoutExtension(QString(fileName), PERSIST_EXTENSIONS) + "." + persistAsFileType;
|
QString qFileName = fileNameWithoutExtension(QString(fileName), PERSIST_EXTENSIONS) + "." + persistAsFileType;
|
||||||
QByteArray byteArray = qFileName.toUtf8();
|
QByteArray byteArray = qFileName.toUtf8();
|
||||||
const char* cFileName = byteArray.constData();
|
const char* cFileName = byteArray.constData();
|
||||||
|
|
||||||
|
bool success = false;
|
||||||
if (persistAsFileType == "svo") {
|
if (persistAsFileType == "svo") {
|
||||||
writeToSVOFile(fileName, element);
|
success = writeToSVOFile(fileName, element);
|
||||||
} else if (persistAsFileType == "json") {
|
} else if (persistAsFileType == "json") {
|
||||||
writeToJSONFile(cFileName, element);
|
success = writeToJSONFile(cFileName, element);
|
||||||
} else if (persistAsFileType == "json.gz") {
|
} else if (persistAsFileType == "json.gz") {
|
||||||
writeToJSONFile(cFileName, element, true);
|
success = writeToJSONFile(cFileName, element, true);
|
||||||
} else {
|
} else {
|
||||||
qCDebug(octree) << "unable to write octree to file of type" << persistAsFileType;
|
qCDebug(octree) << "unable to write octree to file of type" << persistAsFileType;
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element, bool doGzip) {
|
bool Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element, bool doGzip) {
|
||||||
QVariantMap entityDescription;
|
QVariantMap entityDescription;
|
||||||
|
|
||||||
qCDebug(octree, "Saving JSON SVO to file %s...", fileName);
|
qCDebug(octree, "Saving JSON SVO to file %s...", fileName);
|
||||||
|
@ -1906,7 +1908,7 @@ void Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element,
|
||||||
bool entityDescriptionSuccess = writeToMap(entityDescription, top, true, true);
|
bool entityDescriptionSuccess = writeToMap(entityDescription, top, true, true);
|
||||||
if (!entityDescriptionSuccess) {
|
if (!entityDescriptionSuccess) {
|
||||||
qCritical("Failed to convert Entities to QVariantMap while saving to json.");
|
qCritical("Failed to convert Entities to QVariantMap while saving to json.");
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert the QVariantMap to JSON
|
// convert the QVariantMap to JSON
|
||||||
|
@ -1916,22 +1918,26 @@ void Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element,
|
||||||
if (doGzip) {
|
if (doGzip) {
|
||||||
if (!gzip(jsonData, jsonDataForFile, -1)) {
|
if (!gzip(jsonData, jsonDataForFile, -1)) {
|
||||||
qCritical("unable to gzip data while saving to json.");
|
qCritical("unable to gzip data while saving to json.");
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jsonDataForFile = jsonData;
|
jsonDataForFile = jsonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile persistFile(fileName);
|
QFile persistFile(fileName);
|
||||||
|
bool success = false;
|
||||||
if (persistFile.open(QIODevice::WriteOnly)) {
|
if (persistFile.open(QIODevice::WriteOnly)) {
|
||||||
persistFile.write(jsonDataForFile);
|
success = persistFile.write(jsonDataForFile) != -1;
|
||||||
} else {
|
} else {
|
||||||
qCritical("Could not write to JSON description of entities.");
|
qCritical("Could not write to JSON description of entities.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element) {
|
bool Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element) {
|
||||||
qWarning() << "SVO file format depricated. Support for reading SVO files is no longer support and will be removed soon.";
|
qWarning() << "SVO file format deprecated. Support for reading SVO files is no longer support and will be removed soon.";
|
||||||
|
bool success = false;
|
||||||
|
|
||||||
std::ofstream file(fileName, std::ios::out|std::ios::binary);
|
std::ofstream file(fileName, std::ios::out|std::ios::binary);
|
||||||
|
|
||||||
|
@ -2010,8 +2016,12 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element)
|
||||||
}
|
}
|
||||||
|
|
||||||
releaseSceneEncodeData(&extraEncodeData);
|
releaseSceneEncodeData(&extraEncodeData);
|
||||||
|
|
||||||
|
success = true;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long Octree::getOctreeElementsCount() {
|
unsigned long Octree::getOctreeElementsCount() {
|
||||||
|
|
|
@ -299,9 +299,9 @@ public:
|
||||||
void loadOctreeFile(const char* fileName);
|
void loadOctreeFile(const char* fileName);
|
||||||
|
|
||||||
// Octree exporters
|
// Octree exporters
|
||||||
void writeToFile(const char* filename, OctreeElementPointer element = NULL, QString persistAsFileType = "svo");
|
bool writeToFile(const char* filename, OctreeElementPointer element = NULL, QString persistAsFileType = "svo");
|
||||||
void writeToJSONFile(const char* filename, OctreeElementPointer element = NULL, bool doGzip = false);
|
bool writeToJSONFile(const char* filename, OctreeElementPointer element = NULL, bool doGzip = false);
|
||||||
void writeToSVOFile(const char* filename, OctreeElementPointer element = NULL);
|
bool writeToSVOFile(const char* filename, OctreeElementPointer element = NULL);
|
||||||
virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues,
|
virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues,
|
||||||
bool skipThoseWithBadParents) = 0;
|
bool skipThoseWithBadParents) = 0;
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,9 @@ bool Procedural::parseVersion(const QJsonValue& version) {
|
||||||
|
|
||||||
bool Procedural::parseUrl(const QUrl& shaderUrl) {
|
bool Procedural::parseUrl(const QUrl& shaderUrl) {
|
||||||
if (!shaderUrl.isValid()) {
|
if (!shaderUrl.isValid()) {
|
||||||
qWarning() << "Invalid shader URL: " << shaderUrl;
|
if (!shaderUrl.isEmpty()) {
|
||||||
|
qWarning() << "Invalid shader URL: " << shaderUrl;
|
||||||
|
}
|
||||||
_networkShader.reset();
|
_networkShader.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,12 +264,18 @@ float snoise(vec2 v) {
|
||||||
return 130.0 * dot(m, g);
|
return 130.0 * dot(m, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define PROCEDURAL 1
|
#define PROCEDURAL 1
|
||||||
|
|
||||||
//PROCEDURAL_VERSION
|
//PROCEDURAL_VERSION
|
||||||
|
|
||||||
#ifdef PROCEDURAL_V1
|
#ifdef PROCEDURAL_V1
|
||||||
|
|
||||||
|
// shader playback time (in seconds)
|
||||||
|
uniform float iGlobalTime;
|
||||||
|
// the dimensions of the object being rendered
|
||||||
|
uniform vec3 iWorldScale;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Unimplemented uniforms
|
// Unimplemented uniforms
|
||||||
|
|
|
@ -671,7 +671,6 @@
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < elShapeSections.length; i++) {
|
for (var i = 0; i < elShapeSections.length; i++) {
|
||||||
console.log("Hiding shape section " + elShapeSections[i])
|
|
||||||
elShapeSections[i].style.display = 'none';
|
elShapeSections[i].style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -805,8 +804,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var activeElement = document.activeElement;
|
var activeElement = document.activeElement;
|
||||||
|
|
||||||
activeElement.select();
|
if(typeof activeElement.select!=="undefined"){
|
||||||
|
activeElement.select();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -48,7 +48,7 @@ var selectedInputMenu = "";
|
||||||
var selectedOutputMenu = "";
|
var selectedOutputMenu = "";
|
||||||
|
|
||||||
function setupAudioMenus() {
|
function setupAudioMenus() {
|
||||||
Menu.addMenu("Audio > Devices", "Advanced");
|
Menu.addMenu("Audio > Devices");
|
||||||
Menu.addSeparator("Audio > Devices","Output Audio Device");
|
Menu.addSeparator("Audio > Devices","Output Audio Device");
|
||||||
|
|
||||||
var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING);
|
var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING);
|
||||||
|
|
Loading…
Reference in a new issue