All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
baseMaterialHelpers.h
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXRUSDKATANA_BASEMATERIALHELPERS_H
25 #define PXRUSDKATANA_BASEMATERIALHELPERS_H
26 
27 #include "pxr/pxr.h"
28 
29 PXR_NAMESPACE_OPEN_SCOPE
30 
31 class UsdAttribute;
32 class UsdPrim;
33 class UsdRelationship;
34 
35 // Methods for analyzing base/derived material structure
36 //
37 // XXX What we're trying to do here has been described as "partial
38 // composition" -- in the sense that we are trying to resolve
39 // attributes and relationships in a way that temporarily
40 // mutes any contributions from specialized classes, so that
41 // we can represent the specializes hierarchy in a way that
42 // exercises katana's namespace-style inheritance.
43 //
44 // It seems likely that with more time/experience, we may
45 // want to move some of this either into UsdShade API, or
46 // directly into Usd in some form. Consider this a first
47 // step to demonstrate that we have the functional pieces
48 // of a solution, leaving open the question of ideal API
49 // for this sort of thing.
50 
51 // Check if this attribute resolves from across a direct reference arc.
52 bool PxrUsdKatana_IsAttrValFromDirectReference(const UsdAttribute &attr);
53 
54 // Check if this attribute resolves from across a specializes arc.
55 bool PxrUsdKatana_IsAttrValFromBaseMaterial(const UsdAttribute &attr);
56 
57 // Check if this prim is defined across a specializes arc.
58 bool PxrUsdKatana_IsPrimDefFromBaseMaterial(const UsdPrim &prim);
59 
60 // Check if this relationship has targets provided across a specializes arc.
61 // (Usd doesn't provide a UsdResolveInfo style API for asking where
62 // relationship targets are authored, so we do it here ourselves.)
63 bool PxrUsdKatana_AreRelTargetsFromBaseMaterial(const UsdRelationship &rel);
64 
65 
66 PXR_NAMESPACE_CLOSE_SCOPE
67 
68 #endif
69 
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:131
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128