简体   繁体   中英

Forge viewer multi model view

I found this about the ModelLoader for Forge Viewer.

When I use Forge RCDB and Forge Boiler React, I get a viewer with a main window, displaying my 3D model, and on the right some "database" and "cost breakdown" windows. I would like to remove those to keep only the window displaying the model and to add the "Model Loader" window.

I searched through my files and in Forge RCDB i found a directory named Viewing.Extension.ModelLoader. Inside there are 3 files : index.js, MultiModelStructurePanel.js and Viewing.Extension.ModelLoader.js (and scss). Everything is in there .

The thing is, I do not known at all what I am supposed to change in these files (and if I am supposed to).

Does someone know what changes I am supposed to make to display the right things ?

Are you running your own version of forge-rcdb? This is a demo website not a supported API/feature. The extensions can be loaded based on the info placed in the database, for example if you want to create an entry which is loading the ModelLoader, you can create a record as below:

{ 
  "_id" : ObjectId("58fb4fb0f8b8e43f5cbfdd90"), 
  "name" : "Model Loader", 
  "env" : "AutodeskProduction", 
  "layout" : {
      "type" : "flexLayoutRight", 
      "rightFlex" : 0.3
  }, 
  "dynamicExtensions" : [
      {
          "id" : "Viewing.Extension.ModelLoader", 
          "options" : {
              "database" : "gallery", 
              "transformer" : {
                  "showFullModelTransform" : true
              }
          }
      }
  ]
}

I changed the gallery.models.json file and added informations about the files i want to display (I only have a path for them, I did generate an urn, but i'm not sure about it...). I did not touch the configurator.models.json file.

However, regarding Viewing.Extension.ModelLoader, I don't see what I could possibly change in modelSvc.getModels(). In the function getModels(), there is a case about the environment value, 'Local' and 'AutodeskProduction". I had already set the right environment parameters in gallery.models.json.

Moreover, in the function showModelDlg(), there is this call : this.modelSvc.getModels(this.options.database). What does 'this.options.database' refer to ? The database ? Then it should be fine, since I added the right paths to my folders !

Is there anything I could have forgotten to change in rcdb.models or gallery.models ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM