Render sample for RhinoCommon

Hello

I’ve found that C# wizard creates almost empty project for Render plugin.
I suppose it should be very similar to C++ but is there some example of custom render for C#?

@andy, can you help?

@jesterKing - could you package up a C# boilerplate render plug-in?

I see a lot of missing things for rendering even in Rhino.NET and it makes impossible to convert from c++ sample to c#
So some example is highly appreciated

@andy, @Mightywill I’ll have an example C# render plugin done soon.

@Mightywill, attached you can see a simple render plugin. Hopefully this gets you started.

When you open this in Visual Studio you need to add reference to RhinoCommon.dll. After you’ve done that make sure Copy Local is set to false by selecting RhinoCommon from the References list and selecting False for Copy Local in the Reference Properties.

CSTestRender.zip (8.2 KB)

2 Likes

P.S. I’m working on improving the wizard for the C# render plugin.

Thanks a lot, digging it

btw , I cant find how to do this in RhinoCommon:

	public override void OnSetCurrentRenderPlugIn(bool bCurrent)
	{
		if(bCurrent)
		{
			InsertPlugInMenuToRhinoMenu(menu);
		} 
		else
		{
			RemovePlugInMenuFromRhino(menu);
		}
		
		base.OnSetCurrentRenderPlugIn(bCurrent);
	}

and how to work with menus at all?

and also we need to work with environments, sun, groundplanes etc - is it available only in RhinoCommon or we can go with Rhino.NET too? And are there any limitations? Or we have to use c++ to get all we need?

Custom menus are implemented using RUI files in Rhino 5. If you run the toolbars command there are tools in that dialog to help define custom menu entries in the user interface.

I would recommend not using the older Rhino.NET SDK if possible. RhinoCommon should replace all of the older Rhino.NET SDK functionality and if we find a hole where RhinoCommon is not filling the functionality, we need to fill it.

We would be happy to go with RhinoCommon but just not sure that it exposes everything available in c++ sdk.
Our plugin is custom render and we need rdk functionality as well as other things
is there some place where I can read about RhinoCommon limitations in comparison with С++ and Rhino.NET?

And regarding menus,

  1. is there any way to show/hide RUI menu from the code?
  2. how to hide menu item icon?

As part of my job to integrate Cycles in Rhino V6 I’m working on adding the bits and pieces to RhinoCommon that are still missing. Just recently I added AsyncRenderContext, allowing for asynchronous rendering. If you find parts that are missing but you need, please notify me, so that I can put it on my list.

Asynchronous rendering is that what renders to viewport?
Actually we also need to render to a viewport - is it currently possible with RhinoCommon?

Viewport and non-modal RenderWindow. Currently with RhinoCommon (V5) it isn’t possible, but with V6 it will be.

It’s sad…and when is V6 going to be released?

bwt is viewport render available in Rhino,NET?

Hi,

I’ve started writing a simple exporter for Indigo Renderer using this interface. What is the procedure for adding / editing parameters in the render settings? I’ve got a basic grasp of where to put the export code and such, just your C# example doesn’t show any custom parameters (i.e. anti-aliasing settings, renderer-specific attributes, etc.).

Would appreciate any tips / help if you get a minute!

Best,

Tom

Actually, it is possible in Rhino 5, but just not using RhinoCommon. It’s exposed in the C++ interface.

Viewport rendering is possible, but it would be a lot of work to get it working correctly. We’re hoping to put a wrapper in place to allow this to happen much more simply in Rhino 6.

Hello, I’m trying to find how to make specific rendering that I can trigger from python script.
(I want to render DepthMap channel and save it)

Since there is few exemple for rendering plug-in, this sample interess me. I succeed to build it and add it to Rhino 5 through plugin manager.
When I type the command : CSTestRender, or CSTestRender_cs
nothing happens.
Do I need to change something in the code ?
Do I need to launch it through the debug mode of visual basic?