Hi - when rendering a Sun Study inside the following method…
override protected Result Render(RhinoDoc doc, RunMode mode, bool fastPreview)
…how do you determine the Viewport that was specified in the One Day Sun Animation panel? ie. The sun animation might be for the Perspective window, but the use has activated the Top view, so checking the doc.Views.ActiveView.ActiveViewport will be the Top view, not the Perspective view.
Hi Dale - perhaps I am missing something here…how can a Rhino.PlugIns.RenderPlugIn plugin render without knowing the camera position? The camera position comes from the View - but there doesn’t seem any way to determine what View was specified for the sun study.
If you put a breakpoint in your plug-in’s Render() override, you will see that this method is called, if your plug-in is the current render plug-in. In this case, just get the active view (as set by AnimationTools) using RhinoDoc.Views.ActiveView.
protected override Result Render(RhinoDoc doc, Commands.RunMode mode, bool fastPreview)
{
var view = doc.Views.ActiveView;
if (null != view)
{
// TODO...
}
return Result.Success;
}
Thanks Dale - that’s exactly what I am doing, however it does not work. The doc.Views.ActiveView returns the currently selected viewport rather than the viewport selected in the SunStudy panel. The same problem exists for fly-thrus and Bongo animations. It’s an issue for all Rhino.PlugIns.RenderPlugIn’s.
The reason is that this is a bug in the animation tools. If you use RhinoRender, set the viewport to render in the sun study dialog to “Perspective”, select the “Front” viewport and record the animation, RhinoRender renders the view in the Front viewport.
It seems like the animation tools are not pre-setting the viewport correctly. This is something @rajaa will have to look into.
I don’t believe this happens for Bongo though - I certainly can’t repeat it here.