Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,13 @@ def get(self, request, pk=None, project_pk=None):
"""
task = self.get_and_check_task(request, pk)

platform = request.query_params.get('platform', '')
max_size_mb = 120
if platform == "mobile":
max_size_mb = 60

try:
model_file = task.get_safe_textured_model()
model_file = task.get_safe_textured_model(max_size_mb=max_size_mb)
return download_file_response(request, model_file, 'attachment')
except FileNotFoundError:
raise exceptions.NotFound(_("Asset does not exist"))
16 changes: 12 additions & 4 deletions app/static/app/js/ModelView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import AssetDownloadButtons from './components/AssetDownloadButtons';
import Standby from './components/Standby';
import ShareButton from './components/ShareButton';
import ImagePopup from './components/ImagePopup';
import Utils from './classes/Utils';
import PropTypes from 'prop-types';
import * as THREE from 'THREE';
import $ from 'jquery';
Expand Down Expand Up @@ -300,7 +301,9 @@ class ModelView extends React.Component {
}

glbFilePath = () => {
return this.basePath() + '/textured_model/';
let url = this.basePath() + '/textured_model/';
if (Utils.isMobile()) url += "?platform=mobile";
return url;
}

mtlFilename = (cb) => {
Expand Down Expand Up @@ -682,9 +685,14 @@ class ModelView extends React.Component {
// Using opacity we can still perform measurements
viewer.setEDLOpacity(flag ? 1 : 0);

// for(let pointcloud of viewer.scene.pointclouds){
// pointcloud.visible = flag;
// }
// On mobile, for performance and because opacity doesn't
// seem to work consistently, we remove the ability to do
// measurements
if (Utils.isMobile()){
for(let pointcloud of viewer.scene.pointclouds){
pointcloud.visible = flag;
}
}
}

toggleCameras = (e) => {
Expand Down