Commit a5b7442b authored by David E. DeMarle's avatar David E. DeMarle

constrain cinema exports to working combinations

cinema A does not yet support pose cameras and only the pose cameras
suppport tracking and roll. This change makes it harder for the user
to try those combinations and handles with a message invalid
combinations when they are made.

note: constraining the camera model GUI to only have static and phi
theta when in non-composite mode would be better but doing that would
require a custom decorator.
parent 49d4a3aa
......@@ -4707,6 +4707,20 @@
<Documentation>
Name of a pipeline object to orient the camera with. Only meaningful for Inward and Outward Pose Cameras.
</Documentation>
<Hints>
<PropertyWidgetDecorator type="CompositeDecorator">
<Expression type="and">
<Expression type="or">
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Deferred Rendering" value="1" />
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Deferred Rendering" value="2" />
</Expression>
<Expression type="or">
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Camera Model" value="2" />
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Camera Model" value="3" />
</Expression>
</Expression>
</PropertyWidgetDecorator>
</Hints>
</StringVectorProperty>
<IntVectorProperty name="Camera Phi Divisions"
number_of_elements="1"
......@@ -4731,6 +4745,20 @@
Specify number of roll divisions. Only meaningful for Inward and Outward Pose Cameras.
</Documentation>
<IntRangeDomain name="range" min="1" max="64" />
<Hints>
<PropertyWidgetDecorator type="CompositeDecorator">
<Expression type="and">
<Expression type="or">
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Deferred Rendering" value="1" />
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Deferred Rendering" value="2" />
</Expression>
<Expression type="or">
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Camera Model" value="2" />
<PropertyWidgetDecorator type="GenericDecorator" mode="visibility" property="Camera Model" value="3" />
</Expression>
</Expression>
</PropertyWidgetDecorator>
</Hints>
</IntVectorProperty>
<Hints>
<FormatOptions extensions="cdb"
......
......@@ -327,9 +327,29 @@ void pqCatalystExportReaction::onTriggered()
break;
}
int cameraLevel = vtkSMPropertyHelper(writerProxy, "Camera Model").GetAsInt();
if (renderingLevel == 0 && cameraLevel > 1)
{
cameraLevel = 1;
qWarning(
"Camera Type choice is not compatible with Cinema Spec A, falling back to phi-theta.");
}
int numPhis = vtkSMPropertyHelper(writerProxy, "Camera Phi Divisions").GetAsInt();
int numThetas = vtkSMPropertyHelper(writerProxy, "Camera Theta Divisions").GetAsInt();
int numRolls = vtkSMPropertyHelper(writerProxy, "Camera Roll Divisions").GetAsInt();
if (numRolls > 1)
{
if (renderingLevel == 0)
{
numRolls = 1;
qWarning("Roll is not compatible with Cinema Spec A, falling back to roll = 1.");
}
else if (cameraLevel < 2)
{
numRolls = 1;
qWarning("Roll requires pose based camera, falling back to roll = 1.");
}
}
QString camState;
QString phis = "";
QString thetas = "";
......@@ -401,6 +421,21 @@ void pqCatalystExportReaction::onTriggered()
}
QString trackedObject = vtkSMPropertyHelper(writerProxy, "Track Object").GetAsString();
if (trackedObject != "None")
{
if (renderingLevel == 0)
{
trackedObject = "None";
qWarning(
"Object tracking is not compatible with Cinema Spec A, falling back to no tracking.");
}
else if (cameraLevel < 2)
{
trackedObject = "None";
qWarning("Object tracking requires pose based camera, falling back to no tracking.");
}
}
cinema_options += ", 'tracking':{ 'object':'" + trackedObject + "'}";
vtkSMRenderViewProxy* rvp = vtkSMRenderViewProxy::SafeDownCast(viewProxy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment