MoI discussion forum
MoI discussion forum

Full Version: Iso view

Show messages: All  1-3  4-7

From: Michael Gibson
16 Nov 2017   [#4] In reply to [#3]
Hi matt, so for setting up buttons on the View tab in the side pane, you would need to edit the SidePane.htm file in a text editor like Notepad++ .

The existing view tab is this, do a find for "ViewTabContent":

code:
    <div id="ViewTabContent">
        <table>
            <tr>
                <td><moi:CommandButton icon="ViewReset.png" onclick="moi.view.resetAll();"><moi:Text textid="Reset all"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/ImageIcon.png" command="image"><moi:Text textid="Image"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/CPlaneIcon.png" onclick="if ( event.button == 2 ) { moi.view.resetCPlane(); } else { moi.view.setCPlaneInteractive(); }"><moi:Text textid="CPlane"/></moi:CommandButton></td>
            </tr>
            <tr>
                <td colspan="3" style="padding:0.1em 0.4em 0.2em 0.4em">
                    <moi:CheckButton style="text-align:left;" binding="value = moi.view.showHiddenLines"><moi:Text textid="Hidden lines checkbox"/></moi:CheckButton>
                </td>
            </tr>
        </table>
    </div>


So to add in a new row of buttons you'd need to add a new table row () and table cells (
) that have buttons in them (<moi:CommandButton). Which would look something like this - new lines added between the new stuff start and new stuff end markers and note the new stuff is added before the closing
:

code:
    <div id="ViewTabContent">
        <table>
            <tr>
                <td><moi:CommandButton icon="ViewReset.png" onclick="moi.view.resetAll();"><moi:Text textid="Reset all"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/ImageIcon.png" command="image"><moi:Text textid="Image"/></moi:CommandButton></td>
                <td><moi:CommandButton icon="icons/CPlaneIcon.png" onclick="if ( event.button == 2 ) { moi.view.resetCPlane(); } else { moi.view.setCPlaneInteractive(); }"><moi:Text textid="CPlane"/></moi:CommandButton></td>
            </tr>
            <tr>
                <td colspan="3" style="padding:0.1em 0.4em 0.2em 0.4em">
                    <moi:CheckButton style="text-align:left;" binding="value = moi.view.showHiddenLines"><moi:Text textid="Hidden lines checkbox"/></moi:CheckButton>
                </td>
            </tr>

            <!-- new stuff start -->
            <tr>
                <td><moi:CommandButton icon="SetView1.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View1</moi:CommandButton></td>
                <td><moi:CommandButton icon="SetView2.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View2</moi:CommandButton></td>
                <td><moi:CommandButton icon="SetView3.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View3</moi:CommandButton></td>
                <td><moi:CommandButton icon="SetView4.png" onclick="script:var vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); vp.projection = 'Parallel'; vp.setAngles( 90 - (Math.asin(Math.tan(30 * Math.PI/180)) * 180/Math.PI), 315 );">View4</moi:CommandButton></td>
            </tr>
            <!-- new stuff end -->

        </table>
    </div>


And also you'd need to add new images SetView1.png - SetView2.png in the icons folder if you want icons to show up there.

- Michael
From: mattj (MATTJENN)
16 Nov 2017   [#5] In reply to [#4]
Thanks! I will try
From: mattj (MATTJENN)
16 Nov 2017   [#6] In reply to [#4]
This worked perfectly :-)
When i update MOI will i lose the him changes?

Matt
From: Michael Gibson
16 Nov 2017   [#7] In reply to [#6]
Hi Matt, I'm glad that worked for you. Yes, when you get a new update it will come with the default SidePane.htm so you'll need to repeat this process again to get your customizations back. So you may want to keep a link to this thread so you can refer back to it then.

- Michael

Show messages: All  1-3  4-7