Clever coder wanted control layer visibility to suit ortho view?

Hi,
V5
I use PictureFrame to place raster images in orhto views.

If I place one in Top view, I wish not to see it in Bottom View,
Can I make Rhino turn it off when in a different ortho view such as example ?

Its a pain to keep having to turn layers on and off and work out which layer is the one to turn off each time I change views.

Cheers

Steve

There is the BackgroundBitmap command that you could use.
BackgroundBitmap is only visible in one viewport so you can set up different viewports with different views and then switch viewports.

Also BackgroundBitmap always stays in the backround.
With PictureFrame if you set up the picture so that it is behind the geometry when you are working on in Top view and then switch to Bottom view then the picture will be in front of the geometry. BackgroundBitmap will never do that. If you switch from Top view to Bottom view (in the same viewport) the BackgroundBitmap tied to the viewport won’t obscure your view of the geometry.

Hi,

THIS NEED HAS JUST GOT DESPERATE.
trying to finish something before dec 25th !

I have just started a project and need front and back ortho views running at same time,
I AM DESPERATE TO GET front view raster only vis in front ortho view. PictureFrame in use and vital,.
I am seeing double and one is messing with my brain.
CAN ANYONE DO ME A CODE ETC ?
V5

I have never used background Bitmap,
I replied recently to a Pascal post saying I use it, as it has so much unintelligence I cant use it.
I can have hundreds of images in my project.
PictureFrame enables me to do what I need, in fact without PictureFrame Rhino would be completely useless to me.
It is the most vital thing of all. I even move them to and vfro, middle of an object, behind etc.

I need it though to be told to hide when I am in the ortho view not featuring its view.

If I am tracing a car and have the nearside of the car as a photo, in ortho left, I dont want to have it visible in ortho right.

Is there not a way of telling Rhino this ?

To have to fathom out what images are red herrings when I see them in left/right or top/bott or front/back views is bad.

surely other folk have experienced this ?

A fundamental need is this.

Can a script or code be made by some clever soul to tell a picture frame placed raster when not to appear ?
( I dont use grasshopper)

Steve

No, there isn’t.

No. There is no way to control the visibility of a Picture object per-viewport (in model viewports). They are simply designed to show up in all viewports and ignore any display mode settings. You might be able to figure out a way to do this with Layout views, using HideInDetail (I have never tried this).

BackgroundBitmap is the only per-viewport image method available. (Well, there is Wallpaper, but that is something completely different).

Unfortunately since Picture has been available, BackgroundBitmap hasn’t been developed further. For example one cannot rotate the image once it is placed. At one time they wanted to remove BackgroundBitmap entirely, deeming it no longer useful, having been replaced by Picture. This is one instance where it would be useful.

Hi,
I rotate, scale 1d, scale 2d, move about, position to suit, etc PictureFrame.

Can a layer be made to turn off or on per viewport , by referencing a word in its name prefix or suffix. ?

so a layer with TOP in its name is only visible in ortho view ‘TOP’

I can suffix or prefix their layers if so.

I use one raster per layer.

any other ideas anyone ?

I could place a surface a gnats whisker behind the raster, make it white, so in rear view I see white. trouble is I then cant see the grid.

What about making transparency 0% ?

Any boffins out there ?

Steve

No. Not in model viewports. You can show or hide layers in Layout details.

It may be technically possible: The DisplayPipeline’s DrawBitMap and PreDraw methods were apparently available in V5 and so is the ViewPort property to tell which view you’re currently drawing. I think you should be able to use that to temporarily hide things.

You’d still have to mark them somehow (if not layers, by name or something) to indicate which ones show up in which views.

I wasn’t scripting or developing for Rhino until V7 so I don’t even know what the Python facilities were for scripting in or what dev tools you’d need to build plugins for V5.

Hi,
Perhaps when I get V8 after Christmas, I hope, someone can solve this ?

Steve

BackgroundBitMap is what i use when I want to place reference images that show views from front, back, side, top, etc. Each ortho viewport has its own view and image. And the features I like best is that the image connected to one viewport cannot be accidentally moved and the image is always behind all geometry so it will never obscure the geometry.

Why on earth would you want to do that to a reference image?
If you need to modify the image before you use it as a reference for creating geometry do it in image processing software that is designed for that purpose.

BackgroundBitmap is exactly what I would use to avoid that headache.

I have a toolbar button with these macros:

leftclick = backgroundbitmap visible=yes
rightclick= backgroundbitmap visible=no enter

Leftclick on the button will bring up the dialog to open an image file if no Backgroundbitmap is currently set for the active viewport so it can be used to set-up the image as well as turning it on after its set-up.

PictureFrame exists as a 3D object (a Plane) so it has X,Y and Z coordinates. When you create one the centre is always at 0,0,0 ; but if you move a Top view PictureFrame upwards slightly and create a Bottom view PictureFrame (even if it’s just white) then from the Top you’ll see the Top PictureFrame on top of the Bottom PictureFrame (because the Top Frame is nearer). Conversely if you view from the Bottom you’ll see the Bottom Frame then the Top Frame (because the Bottom Frame is nearer).

here’s something sort of like that

based on this

so the right viewport uses “my-shaded-hide-locked” display mode with these locked objects settings, and the left one doesn’t

the plane is just a surface with picture material assigned, and is not made with the picture command, since the surface made with the picture command appears to have some special data associated with it, which keeps it from being hidden

You may want to look into the Display Mode options for backface settings. I just tested in V5, seems like there two ways about it:

  1. Simple one, if using PictureFrame : set your Rendered display mode backface setting to Cull Backfaces:

Looks like for PictureFrame objects/material, Rhino pays attention to Rendered mode setting for this one, so once this is changed, the “back” of your PictureFrame will be hidden, and not visible in the Bottom View. Limitation: if you wanted to use Rendered mode and not cull backfaces anywhere else, changing this setting will be a problem.

In that case:

  1. You will need to use a regular surface object created in place of your PictureFrame, you can do PicutreFrame first, then match the proportions using _Plane command, then either via its Layer or object, match material to the PictureFrame. Now you can delete PictureFrame. The difference is, now you can set custom Per-object-display modes with the surface, so you can use a copy of your Rendered mode that culls backfaces on that one. You will need to use _SetObjectDisplayMode in each of the viewports you would like to work.

Here is my custom mode:
RenderedCulled.ini (11.4 KB)
( you can import via Options > View > DisplayModes),

and a quick preview of how it works over here:

hth,

–jarek

1 Like

Have you tried clipping planes to near clip away the pictureframes for each view? V5 is old, but I think it supports it.

Hi
@Jarek
I like the idea of the cull backface.

I need this for shaded view, so go to the settIngs and hope its there, it is, select cull backfaces for the settings as per your image, ok and then make right view left view but the images still show.

why is that ?

As I have over 200 images (guess) such a setting would be easy to do and solve this.

but it fails.

also need it for ghosted and x ray modes,
I dont create and draw in rendered mode.

Cheers

Steve

See my explanation above. You will need to use method #2 - create custom display mode (or import mine) with culled backfaces, and follow option #2 in my post (redoing picture frames, assigning custom object display mode to them). If you have 200 of them it probably would be easier to convert all of them via script than manually. But please try with one and see if it works on your end. Work fine here.