UI-neutral controller for coalesced material edits and revision-safe live previews. 更多...
#include <EditorMaterialStudio.h>
Public 成员函数 | |
| MaterialStudioController (DocumentId document, MaterialPublishingTarget &target, IEditorTransactionBackend &transactions, MaterialPreviewService &previews, IMaterialPreviewRenderer &renderer) | |
| Material studio controller. | |
| Result< void > | setPreviewSettings (MaterialPreviewSettings settings) |
| Replace preview geometry, camera, resolution, and environment settings. | |
| Result< void > | beginInteraction (PropertyPath path) |
| Start one coalesced property gesture from the current live document revision. | |
| Result< void > | updateInteraction (EditorValue value) |
| Update the owned draft and mark its isolated preview dirty. | |
| Result< TransactionReceipt > | commitInteraction () |
| Atomically publish the final draft value as one undoable transaction. | |
| Result< void > | cancelInteraction () |
| Abandon the draft without changing the live material. | |
| Result< void > | tick (std::uint64_t monotonicMilliseconds) |
| Render a dirty preview when the injected monotonic time reaches the rate limit. | |
| Result< void > | refreshPreview () |
| Force an isolated preview of the current draft or live document. | |
| Result< void > | setPreviewRate (double framesPerSecond) |
| Set the maximum preview rate; valid range is 1 to 240 Hz. | |
| MaterialStudioState | state () const |
| Return an owning snapshot suitable for any developer or in-game UI host. | |
详细描述
UI-neutral controller for coalesced material edits and revision-safe live previews.
A host begins an interaction when a slider, color control, or asset picker becomes active, sends every intermediate value to updateInteraction(), and calls commitInteraction() once. Intermediate values are applied only to an owned draft and may be previewed at a bounded rate; the live material changes atomically once, so one gesture produces one undo record.
@ownership The target, transaction backend, preview service, and renderer are borrowed and must outlive this controller. The draft and all presentation state are owned by this controller. @threadaffinity Owner thread only; preview rendering and transaction callbacks are synchronous. @reentrancy Do not call this controller again from renderer or transaction callbacks.
在文件 EditorMaterialStudio.h 第 40 行定义.
构造及析构函数说明
◆ MaterialStudioController()
| eve::editor::MaterialStudioController::MaterialStudioController | ( | DocumentId | document, |
| MaterialPublishingTarget & | target, | ||
| IEditorTransactionBackend & | transactions, | ||
| MaterialPreviewService & | previews, | ||
| IMaterialPreviewRenderer & | renderer | ||
| ) |
Material studio controller.
在文件 EditorMaterialStudio.cpp 第 15 行定义.
成员函数说明
◆ beginInteraction()
| Result< void > eve::editor::MaterialStudioController::beginInteraction | ( | PropertyPath | path | ) |
Start one coalesced property gesture from the current live document revision.
在文件 EditorMaterialStudio.cpp 第 30 行定义.
引用了 eve::editor::IEditorTransactionBackend::active(), eve::material_editing::MaterialPublishingTarget::authoringTarget(), descriptor, eve::editing::PropertySchema::find(), path, eve::material_editing::MaterialDocumentTarget::schema() , 以及 eve::UuidIdAdapter< Tag >::value().
◆ cancelInteraction()
| Result< void > eve::editor::MaterialStudioController::cancelInteraction | ( | ) |
Abandon the draft without changing the live material.
在文件 EditorMaterialStudio.cpp 第 104 行定义.
引用了 eve::material_editing::MaterialPublishingTarget::authoringTarget() , 以及 eve::material_editing::MaterialDocumentTarget::validate().
◆ commitInteraction()
| Result< TransactionReceipt > eve::editor::MaterialStudioController::commitInteraction | ( | ) |
Atomically publish the final draft value as one undoable transaction.
在文件 EditorMaterialStudio.cpp 第 66 行定义.
引用了 eve::editor::IEditorTransactionBackend::append(), eve::material_editing::MaterialPublishingTarget::authoringTarget(), eve::editing::TransactionSpec::baseRevision, eve::editor::IEditorTransactionBackend::begin(), eve::editor::IEditorTransactionBackend::commit(), eve::editor::IEditorTransactionBackend::discard(), eve::Result< T >::failure(), eve::editing::TransactionSpec::id, eve::editing::TransactionSpec::label, eve::material_editing::MaterialDocumentTarget::makeSet(), eve::editing::TransactionSpec::mergeKey, operation, eve::editor::IEditorTransactionBackend::preview(), eve::material_editing::MaterialPublishingTarget::revision(), eve::editing::TransactionSpec::target , 以及 eve::material_editing::MaterialPublishingTarget::targetId().
◆ refreshPreview()
| Result< void > eve::editor::MaterialStudioController::refreshPreview | ( | ) |
Force an isolated preview of the current draft or live document.
在文件 EditorMaterialStudio.cpp 第 127 行定义.
引用了 eve::material_editing::MaterialPublishingTarget::authoringTarget().
被这些函数引用 tick().
◆ setPreviewRate()
| Result< void > eve::editor::MaterialStudioController::setPreviewRate | ( | double | framesPerSecond | ) |
Set the maximum preview rate; valid range is 1 to 240 Hz.
在文件 EditorMaterialStudio.cpp 第 131 行定义.
◆ setPreviewSettings()
| Result< void > eve::editor::MaterialStudioController::setPreviewSettings | ( | MaterialPreviewSettings | settings | ) |
Replace preview geometry, camera, resolution, and environment settings.
在文件 EditorMaterialStudio.cpp 第 24 行定义.
引用了 settings.
◆ state()
| MaterialStudioState eve::editor::MaterialStudioController::state | ( | ) | const |
Return an owning snapshot suitable for any developer or in-game UI host.
在文件 EditorMaterialStudio.cpp 第 139 行定义.
引用了 eve::editor::MaterialStudioState::activeProperty, eve::editor::MaterialStudioState::diagnostics, eve::editor::MaterialStudioState::documentRevision, eve::editor::MaterialStudioState::interactionActive, eve::editor::MaterialStudioState::previewArtifact, eve::editor::MaterialStudioState::previewDirty, eve::editor::MaterialStudioState::previewRevision , 以及 eve::material_editing::MaterialPublishingTarget::revision().
◆ tick()
| Result< void > eve::editor::MaterialStudioController::tick | ( | std::uint64_t | monotonicMilliseconds | ) |
Render a dirty preview when the injected monotonic time reaches the rate limit.
- 参数
-
monotonicMilliseconds Host-provided monotonic time; wall-clock time is not read.
- 返回
- Applied when rendered, NoOp when clean or rate-limited, otherwise a diagnostic.
在文件 EditorMaterialStudio.cpp 第 112 行定义.
引用了 refreshPreview().
◆ updateInteraction()
| Result< void > eve::editor::MaterialStudioController::updateInteraction | ( | EditorValue | value | ) |
Update the owned draft and mark its isolated preview dirty.
在文件 EditorMaterialStudio.cpp 第 46 行定义.
引用了 eve::Result< T >::failure(), operation , 以及 value.
该类的文档由以下文件生成:
- src/modules/graphics/material/editor/EditorMaterialStudio.h
- src/modules/graphics/material/editor/EditorMaterialStudio.cpp