About
An implementation of maxon::nodes::PreviewImageProviderInterface provides preview images of a node.
Methods
- Note
- Initialize() should not take long since it blocks the UI. One should create a clone of the given node graph and access that clone in ComputeIteration().
For accessing and searching for nodes in the node graph, see GraphNodes Manual.
Settings provided in Initialize() are:
- maxon::nodes::PREVIEWIMAGEREQUEST::TEXTURESIZE: Defines the requested preview size in pixels.
- maxon::nodes::PREVIEWIMAGEREQUEST::SUBJECT: Points to the node requested for preview.
- maxon::nodes::PREVIEWIMAGEREQUEST::PROGRESSIONTHRESHOLD: Constraints the iterative refinement.
- maxon::nodes::PREVIEWIMAGEREQUEST::URANGE: For 2D previews defines the horizontal range to be sampled.
- maxon::nodes::PREVIEWIMAGEREQUEST::VRANGE: For 2D previews defines the vertical range to be sampled.
- maxon::nodes::PREVIEWIMAGEREQUEST::SCENETYPE: The type of the 3D scene. See also maxon::nodes::NODESPACE::MATERIALPREVIEWIDS.
- maxon::nodes::PREVIEWIMAGEREQUEST::FLIPVERTICALLY: Defines whether a request was made for a flipped version
- maxon::nodes::PREVIEWIMAGEREQUEST::TEXTUREIDS: The set of attributes requested for preview.
- maxon::nodes::PREVIEWIMAGEREQUEST::PROVIDER: Defines the instance of a PreviewImageProviderRef that is used to compute the preview.
{
_imageSize = request.Get(maxon::nodes::PREVIEWIMAGEREQUEST::TEXTURESIZE,
maxon::IntVector2d());
{
}
maxon::nodes::NodesGraphModelRef graph = maxon::Cast<maxon::nodes::NodesGraphModelRef>(node.
GetGraph());
_graph = graph.GetManager().GetMainView().Clone()
iferr_return;
maxon::UseVariable(sceneType);
}
const NodePath & GetPath() const
Definition: graph.h:2366
Bool IsValid() const
Definition: graph.h:2327
const GraphModelRef & GetGraph() const
Definition: graph.h:2356
Int64 Int
signed 32/64 bit int, size depends on the platform
Definition: apibase.h:190
return OK
Definition: apibase.h:2620
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
#define MAXON_METHOD
Definition: interfacebase.h:942
SCENETYPE
Definition: previewimageprovider.h:89
@ MatPreviewDefault
Default (may be a user preference).
#define iferr_scope
Definition: resultbase.h:1374
#define iferr_return
Definition: resultbase.h:1465
{
{
{
}
}
_final = true;
}
{
return output;
}
private:
maxon::NodePath _nodePath;
maxon::nodes::NodesGraphModelRef _graph;
Definition: basearray.h:413
ResultMem Resize(Int newCnt, COLLECTION_RESIZE_FLAGS resizeFlags=COLLECTION_RESIZE_FLAGS::DEFAULT)
Definition: basearray.h:1124
Reference to a job (JobInterface).
Definition: job.h:1120
bool Bool
boolean type, possible values are only false/true, 8 bit
Definition: apibase.h:183
Vec4< Float32 > SampleFloat32
Convenience definitions for the immutable preview image.
Definition: previewimageprovider.h:134
#define NewObj(T,...)
Definition: newobj.h:108
A vector consisting of three components X, Y and Z.
Definition: vec.h:16
A vector consisting of four components X, Y, Z and W.
Definition: vec4.h:16
Definition: previewimageprovider.h:265
Int _iterationCount
Definition: previewimageprovider.h:281
Int _currentIterationIndex
Definition: previewimageprovider.h:273
Result< void > SetResult(const PreviewImageProviderOutputImage &image)
Definition: previewimageprovider.h:316
Definition: previewimageprovider.h:230
Bool _isFinal
Definition: previewimageprovider.h:249
SamplesFloat32ConstRef _samplesFloat32Linear
Definition: previewimageprovider.h:242
IntVector2d _imageSize
Definition: previewimageprovider.h:235