My MoI3D Workflow Shortcuts
All  1-13  14

Previous
 From:  Michael Gibson
7695.14 In reply to 7695.11 
Hi yytssln, it looks like both Shift+F6 and Shift+P are duplicates of each other there.

I tested the script over here and it seems to be working ok for me.

I suspect that maybe your video card does not support rendering to that high of a resolution image and so the viewport .render() method is throwing an exception which the script is not expecting. When that happens the cleanup step (where the script restores viewport properties that it modified before making the screenshot image) does not happen.

Try putting in this updated version:

script: /* Save to PNG */ var vp = moi.ui.getLastClickedViewport(); if (!vp) { vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); } var filename = moi.filesystem.GetSaveFileName( 'Save', ' (*.png)|*.png' ); var st = [], settings = ["view.viewportBackgroundColor", "view.lineWidth", "grid.display", "grid.showXYAxes", "view.showAxisIcon", "view.meshAngle"]; for (var sv in settings) { st.push(moi[settings[sv].split('.')[0]][settings[sv].split('.')[1]] ); } moi.view.viewportBackgroundColor = 0xFFFFFF; moi.view.lineWidth = 3; moi.grid.display = false; moi.grid.showXYAxes = false; moi.view.showAxisIcon = false; moi.view.meshAngle = 3; try { vp.render( 4000, 2500 ).save(filename); } catch(e){} for (var sv in settings) { moi[settings[sv].split('.')[0]][settings[sv].split('.')[1]] = st.shift(); }


I think this version should now tolerate the viewport .render() method possibly failing.

But probably to get an image actually generated you'll have to modify the vp.render( 4000, 2500 ) to a lower resolution than 4000x2500, for your particular video card's limits.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-13  14