3ds Max USD API Reference
Loading...
Searching...
No Matches
IUSDStageProvider.h
1//**************************************************************************/
2// Copyright (c) 2019 Autodesk, Inc.
3// All rights reserved.
4//
5// Use of this software is subject to the terms of the Autodesk license
6// agreement provided at the time of installation or download, or which
7// otherwise accompanies this software in either electronic or hard copy form.
8//**************************************************************************/
9// DESCRIPTION: Description of an interface of a proxy holding a USDStage
10// AUTHOR: Autodesk Inc.
11//**************************************************************************/
12
13#pragma once
14
15#include <ifnpub.h>
16#include <ref.h>
17
18#include <pxr/usd/usd/stage.h>
19
21static const Interface_ID IUSDStageProvider_ID(0x6be93509, 0x325e2773);
22
23// No way to assign an obviously unique value. Let's hope this one is.
24constexpr const auto REFMSG__IUSDSTAGEPROVIDER_MSGBASE = REFMSG_USER + 9560;
25constexpr const auto REFMSG_IUSDSTAGEPROVIDER_STAGE_CHANGED = REFMSG__IUSDSTAGEPROVIDER_MSGBASE + 1;
26
27enum
28{
29 fnIdReload,
30 fnIdSetRootLayer,
31 fnIdGetUsdPreviewSurfaceMaterials,
32 fnIdSetPrimvarChannelMappingDefaults,
33 fnIdSetPrimvarChannelMapping,
34 fnIdGetPrimvarChannel,
35 fnIdIsMappedPrimvar,
36 fnIdGetMappedPrimvars,
37 fnIdClearMappedPrimvars
38};
39
43class IUSDStageProvider : public FPMixinInterface
44{
45 public:
46 // Function Publishing System
47 // Function Map For Mixin Interface
48 //*************************************************
49 BEGIN_FUNCTION_MAP
50 VFN_0(fnIdReload, Reload);
51 VFN_2(fnIdSetRootLayer, SetRootLayerMXS, TYPE_STRING, TYPE_STRING);
52 FN_1(fnIdGetUsdPreviewSurfaceMaterials, TYPE_MTL, GetUsdPreviewSurfaceMaterials, TYPE_BOOL);
53 VFN_0(fnIdSetPrimvarChannelMappingDefaults, SetPrimvarChannelMappingDefaults);
54 VFN_2(fnIdSetPrimvarChannelMapping, SetPrimvarChannelMapping, TYPE_STRING, TYPE_VALUE);
55 FN_1(fnIdGetPrimvarChannel, TYPE_VALUE, GetPrimvarChannel, TYPE_STRING);
56 FN_0(fnIdGetMappedPrimvars, TYPE_STRING_TAB_BV, GetMappedPrimvars);
57 FN_1(fnIdIsMappedPrimvar, TYPE_BOOL, IsMappedPrimvar, TYPE_STRING);
58 VFN_0(fnIdClearMappedPrimvars, ClearMappedPrimvars);
59 END_FUNCTION_MAP
60
62 virtual pxr::UsdStageWeakPtr GetUSDStage() = 0;
63
65 virtual void Reload() = 0;
66
68 virtual void SetRootLayer(const wchar_t* rootLayer, const wchar_t* stageMask) = 0;
69
71 virtual void SetRootLayerMXS(const wchar_t* rootLayer, const wchar_t* stageMask) = 0;
72
73 // Returns the multi-materials representing the UsdPreviewSurface materials in the stage.
74 virtual Mtl* GetUsdPreviewSurfaceMaterials(bool update) = 0;
75
76 // Sets defaults primvar to channels mappings.
77 virtual void SetPrimvarChannelMappingDefaults() = 0;
78
79 // Sets a primvar to channel mapping.
80 virtual void SetPrimvarChannelMapping(const wchar_t* primvarName, Value* channel) = 0;
81
82 // Gets the channel to which a primvar maps to.
83 virtual Value* GetPrimvarChannel(const wchar_t* primvarName) = 0;
84
85 // Gets the list of all currently mapped primvars.
86 virtual Tab<const wchar_t*> GetMappedPrimvars() const = 0;
87
88 // Checks if a primvar is currently mapped to a channel.
89 virtual bool IsMappedPrimvar(const wchar_t* primvarName) = 0;
90
91 // Clears all primvar mappings.
92 virtual void ClearMappedPrimvars() = 0;
93};
Exposes an interface for proxies able to provide a USDStage.
Definition: IUSDStageProvider.h:44
virtual void Reload()=0
Reload all layers of the stage held by this provider.
virtual void SetRootLayer(const wchar_t *rootLayer, const wchar_t *stageMask)=0
Set the root layer and mask of the stage held by this provider.
virtual END_FUNCTION_MAP pxr::UsdStageWeakPtr GetUSDStage()=0
Return a weak pointer to the stage held by this provider.
virtual void SetRootLayerMXS(const wchar_t *rootLayer, const wchar_t *stageMask)=0
Set the root layer and mask of the stage held by this provider. MXS function.