Reference image management

Next
 From:  Viewbyte
10532.1 
Michael,
I thought it was better to split this topic out from the general V5 wishlist.

So I've re-pasted my original request - and your initial script below. While the script swaps out images for the alternative view, I still have the issue of the 'auto reversal' of the image itself. MOI seems to flip the image when it's loaded.

It should be noted at this point that I set up my models so a car, for example, is facing negative Z, ie you'd see the front of the car in the default front view.
Looking at the default MOI layout I'd assume MOI uses 'third angle projection'. So 'Right view' is looking ** from the right ** - back towards to origin. So from that view you'd actually be viewing the ** left side ** of the car in my case.

So...
In right view I would load an image of the left side of the vehicle, facing left.
In left view I would load an image of the right side of the vehicle, facing right.

The issue I'm still having is the the program seems to want to 'auto-flip' the reverse view image. Is there a way to switch that off?


======================
Here's my original request:
======================
Suggestion: auto swap of template images for ortho views - top/bottom, left/right, front/back.
----------------------------------------------------------------------------------------------------------------------------------------
I'm currently working on a model for which I have 2D drawings. I have image planes set up for top, left/right, front/back.

It would be super helpful if, when switching ortho views - left/right or front/back - the relevant image plane was shown and the 'reverse view' image plane was hidden.
Currently the same image just gets automatically reversed in direction ('auto-flipped'). That's pretty confusing and an invitation to make mistakes when your object is not symmetric.

The current set up makes working round this problem equally confusing, because if you set up drawings for left/right, front/back you have to reverse one of them because of the 'auto-flip'.

It's a flippin' nuisance : )

Thanks for any consideration this may get : )


=================================
Here's your original response and script
=================================
re: images and view reversing, please try setting up the following script on a keyboard shortcut. Then when you push the shortcut key, the view under the mouse will reverse and it will also handle hiding and showing the associated images at the same time:

script: /* Reverse view under mouse and switch images */ var vp = moi.ui.getActiveViewport(); if ( vp && vp.name != '3D' ) { var toshow = ''; switch( vp.name ) { case 'Top': toshow = 'bottom'; break; case 'Bottom': toshow = 'top'; break; case 'Left': toshow = 'right'; break; case 'Right': toshow = 'left'; break; case 'Front': toshow = 'back'; break; case 'Back' : toshow = 'front'; break; } var images = moi.view.getBackgroundImages(); for ( var i = 0; i < images.length; ++i ) { var img = images.item(i); var imgname = moi.filesystem.getFileNameFromPath(img.fileName).toLowerCase(); if ( imgname.indexOf( toshow ) != -1 ) img.hidden = false; if ( imgname.indexOf( vp.name.toLowerCase() ) != -1 ) img.hidden = true; } moi.ui.mainWindow.viewpanel.reverseView( vp.name ); }

It seems that this is only an issue when images are set to display above objects with transparency. Maybe I should look for images stacked directly on top of each other in the view in this case and not draw the one further away.

==================================

PS: There is a definite possibility this is brain fade / user error on my part! So if that;s the case, please excuse me.
I'm in the middle of a high pressure project and am not an experienced MOI user.

Many thanks for your assistance and work on this! It's very much appreciated.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10532.2 In reply to 10532.1 
Hi Mike A, yes if you draw in an image in say the Front view, then when you reverse that view so it is a Back view then you'll see the image reversed. That's normal and it's how regular geometry works too.

For example this drawn in the Front view:


Will look like this when switching to the Back view:


Background images just behave this same way, if you place an image in the Front view when you switch to the back view you'll see it flipped just the same as the geometry shown above. If they didn't then it would be weird because if you traced some lines and curves over an image in the Front view when you switched to the Back view your geometry would not be aligned with the image anymore.


If you don't want it to be flipped in the reverse view you can either switch to the reverse view when you initially place it so that it will be oriented to that view, or you can mirror an image while in the Image command by grabbing a corner grip and dragging it to the opposite side like this:



- 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

Previous
Next
 From:  Viewbyte
10532.3 
The issue I have is maybe a niche case. In the project I'm doing I have detailed tech drawings of all sides of the vehicle apart from the bottom. The vehicle is not symmetrical - there are some features on one side, but not on the other.

The drawings have been correctly scaled and positioned and all common geometry I'm creating aligns correctly in either left or right views when I'm viewing the appropriate template. The problem is that unless I'm very careful to switch image plane visibility manually when reversing views the auto-flip of the image can make the * left side look like the right side * or vice versa because the image has been auto-flipped to face in the reverse direction.

I didn't know about reversing the image in view using the corner gripper - that's handy.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Viewbyte
10532.4 
Here is an updated version of the 'MOI car' example with just left and right images set up.
This clearly demos the problem. Despite there being both left and right views set up, the reverse view just uses the 'flipped version' of the other view. That looks correct in orientation - but shows the wrong side of the vehicle.

EDITED: 20 Dec 2021 by VIEWBYTE


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

Previous
Next
 From:  Michael Gibson
10532.5 In reply to 10532.3 
Hi Mike A,

re:
> The problem is that unless I'm very careful to switch image plane visibility manually when
> reversing views the auto-flip of the image can make the * left side look like the right side *
> or vice versa because the image has been auto-flipped to face in the reverse direction.

This is the problem that the script that I posted previously was supposed to address.

But it looks like it wasn't quite set up how you need it, it was assuming that the image meant to be turned on in the Right view would have "right" in its name but you have it the other way around.

Please try this updated version instead:

script: /* Reverse view under mouse and switch images */ var vp = moi.ui.getActiveViewport(); if ( vp && vp.name != '3D' ) { var toshow='', tohide=''; switch( vp.name ) { case 'Top': toshow = 'top'; tohide='bottom'; break; case 'Bottom': toshow = 'bottom'; tohide='top'; break; case 'Left': toshow = 'left'; tohide='right'; break; case 'Right': toshow = 'right'; tohide='left'; break; case 'Front': toshow = 'front'; tohide='back'; break; case 'Back' : toshow = 'back'; tohide='front'; break; } var images = moi.view.getBackgroundImages(); for ( var i = 0; i < images.length; ++i ) { var img = images.item(i); var imgname = moi.filesystem.getFileNameFromPath(img.fileName).toLowerCase(); if ( imgname.indexOf( toshow ) != -1 ) { img.hidden = false; } if ( imgname.indexOf( tohide ) != -1 ) { img.hidden = true; } } moi.ui.mainWindow.viewpanel.reverseView( vp.name ); }

Set that up on a shortcut key and when you want to reverse a view use that shortcut key to do it. That should reverse the view and also handle hiding/showing the correct images this time so that you don't have to do any manual image visibility management.

Please let me know if that still isn't what you needed.

- 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

Previous
Next
 From:  Michael Gibson
10532.6 In reply to 10532.4 
So with that updated shortcut key, if you load your _03 file posted above it starts out like this:


Then if you push the keyboard shortcut with the updated script on it you should get this:


- 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

Previous
Next
 From:  Viewbyte
10532.7 In reply to 10532.6 
SOLVED! That does exactly what I need : )
Thanks for the updated script and amazing service.

As an aside... I've been using MOI for about 50 hours so far on the project I'm working on - and I'm really impressed with what you've created. One of the things I love about it - rock solid stability.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
10532.8 In reply to 10532.7 
Thanks Mike I'm glad you are liking it! :)

- 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