Skip to content

Commit

Permalink
Show settings section when active view has Raytraced running.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesterKing committed Oct 7, 2016
1 parent 0aaf56a commit dd37be0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Commands/ChangeSamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected override Result RunCommand(RhinoDoc doc, RunMode mode)
Plugin.InitialiseCSycles();
if (doc.Views.ActiveView.ActiveViewport.DisplayMode.Id == Guid.Parse("69E0C7A5-1C6A-46C8-B98B-8779686CD181"))
{
var rvp = doc.Views.ActiveView.RenderedDisplayMode as RenderedViewport;
var rvp = doc.Views.ActiveView.RealtimeDisplayMode as RenderedViewport;

if (rvp != null)
{
Expand Down
29 changes: 28 additions & 1 deletion CyclesForRhino/RenderEngineSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Eto.Drawing;
using Eto.Forms;
using Rhino;
using Rhino.UI;
using Rhino.UI.Controls;
using RhinoCyclesCore.Core;
Expand All @@ -16,6 +17,8 @@ public class RenderEngineSettings : EtoCollapsibleSection
private Label _seedLabel;
private NumericUpDown _seedInput;

private Label _activeViewIsRaytraced;


public RenderEngineSettings()
{
Expand Down Expand Up @@ -57,6 +60,11 @@ private void InitializeComponents()
MaximumDecimalPlaces = 0,
Value = RcCore.It.EngineSettings.Seed
};

_activeViewIsRaytraced = new Label()
{
Text = "..."
};
}

private void InitializeLayout()
Expand All @@ -68,7 +76,8 @@ private void InitializeLayout()
Rows =
{
new TableRow(_sampleLabel, _sampleInput),
new TableRow(_seedLabel, _seedInput)
new TableRow(_seedLabel, _seedInput),
new TableRow(_activeViewIsRaytraced),
}
};

Expand All @@ -90,6 +99,24 @@ public override bool Hidden
{
_hidden = true;
}
var raytraced = RhinoDoc.ActiveDoc?.Views.ActiveView.RealtimeDisplayMode;
if ( raytraced == null)
{
_hidden = true;
_activeViewIsRaytraced.Text = "...";
}
else
{
if (raytraced.HudProductName() == "Raytraced")
{
_hidden = false;
_activeViewIsRaytraced.Text = $"raytraced {raytraced.HudProductName()} {raytraced.HudRendererPaused()}";
} else
{
_activeViewIsRaytraced.Text = "...";
_hidden = true;
}
}

return _hidden;
}
Expand Down

0 comments on commit dd37be0

Please sign in to comment.