Setting a default render environment automatically


I’m developing a plugin for visualization purposes. When a user loads a file, a default black render environment should be set (instead of the default grey environment). As I understand I can save a rendering environment to a document, but I need it for arbitrary documents a user loads.

It doesn’t really matter if there is a solution in the Rhino-settings, Brazil-settings or in code RhinoCommon. It just has to be portable to other workstations.

I tried to save an environment in Brazil settings, but after restarting Brazil can’t find the environment anymore.

I also tried to set rendering background to black in my plugin code like this

Rhino.Render.SimulatedEnvironment sim = new Rhino.Render.SimulatedEnvironment();
Rhino.Render.RenderEnvironment.CurrentEnvironment.SimulateEnvironment(ref sim, true);
sim.BackgroundColor = System.Drawing.Color.Black;

But this has no effect at all.

Maybe someone can point me in the right direction with this one?


@andy, is this something you can help with?


I don’t quite understand this request - it seems to be specific to Brazil, is that correct? Are you using Brazil as the renderer for your plug-in?

  • Andy

Hi andy!

Sorry for the confusion… I’m using the german version of rhino so unfortunatelly I don’t know the correct english terms.

When I start a new document in Rhino and just hit the render button the background of the scene, the whole 360 degree environment, is rendered default gray color. Any reflecting surface I add to the scene will reflect that gray color. What I want to do is to change that gray color to black, so that if I add a mirror to the document it will reflect that black color.

I’m looking for a way to automate this setting (gray -> black) either in Rhinocommon or a global Rhino setting. I guess this is independent from Brazil but I won’t care if it is stored in Brazil presets.

Our customer opens a document (*.igs, *.stp, or *.3dm) with a mirror geometry they want to visualize. They should not have to set the black render environmet manually.

Here are some images from the environment panel I’m refereing to:

Thank you!

That setting is a Rhino setting. The standard way to modify those kinds of settings for newly opened models is to use templates - ie, modify the template files on the user’s machine.

However - it’s also possible using RhinoCommon or the C++ SDK. The black color is stored in Rhino.Render.RenderSettings.BackgroundColorTop - it’s a property on RhinoDoc.