Skip to content

Commit

Permalink
fix: regression on loading object
Browse files Browse the repository at this point in the history
all file different from 3mf where not loaded
now it's loaded
  • Loading branch information
mboscolo committed Oct 7, 2024
1 parent 742d16b commit 3f0043b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions plm_web_3d/static/src/js/OdooCADApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ function init() {
/*
* Inizialize tree view search
*/
var input_document_tree = document.getElementById('input_search_document_tree');
input_document_tree.addEventListener("keyup", OdooCad.search_document_tree);
var input_document_tree = document.getElementById('input_search_document_tree');
input_document_tree.addEventListener("keyup", OdooCad.search_document_tree);
/*
* function to hide show all components
*/
var bnt_hide_all_parts = document.getElementById('hide_all_parts');
bnt_hide_all_parts.addEventListener("click", hide_all_scene_item);
var bnt_hide_all_parts = document.getElementById('hide_all_parts');
bnt_hide_all_parts.addEventListener("click", hide_all_scene_item);


var bnt_show_all_parts = document.getElementById('show_all_parts');
Expand Down Expand Up @@ -346,8 +346,10 @@ function epsilon( value ) {
function initcommand(){
var element = document.getElementById("fit_view");
element.onclick = function(event) {
fitCameraToSelection(OdooCad.tree_ref_elements,
fitCameraToSelectionEvent();
/* fitCameraToSelection(OdooCad.tree_ref_elements,
1.1);
*/
}
var selector = document.getElementById("webgl_background");
selector.onchange = function(event){
Expand Down Expand Up @@ -500,7 +502,11 @@ var change_object_explosion = function(event){
}

var fitCameraToSelectionEvent = function(e){
fitCameraToSelection(OdooCad.tree_ref_elements,1.1);
if (Object.values(OdooCad.tree_ref_elements).length>0){
fitCameraToSelection(OdooCad.tree_ref_elements,1.1);
return
}
fitCameraToSelection(OdooCad.items,1.1);
}

/**
Expand Down

0 comments on commit 3f0043b

Please sign in to comment.