MCPcopy Create free account
hub / github.com/carbonengine/trinity / OnModified

Method OnModified

trinity/Tr2InstancedMesh.cpp:105–136  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Implements INotify interface. Allows the mesh to respond to parameter changes generated in Python. Loads instance geometry resource when geometry path is modified or when deferred flag is reset. Passes control to Tr2Mesh. Arguments: value - The Blue-exposed parameter that changed Return Value: tru

Source from the content-addressed store, hash-verified

103// true always
104// --------------------------------------------------------------------------------------
105bool Tr2InstancedMesh::OnModified( Be::Var* value )
106{
107 if( IsMatch( value, m_instanceGeometryResPath ) )
108 {
109 if( !m_deferGeometryLoad )
110 {
111 if( !m_instanceGeometryResPath.empty() )
112 {
113 TriGeometryResPtr res;
114 BeResMan->GetResource( m_instanceGeometryResPath.c_str(), "", res );
115 SetInstanceGeometryRes( res );
116 }
117 else
118 {
119 SetInstanceGeometryRes( nullptr );
120 }
121 }
122 }
123 else if( IsMatch( value, m_deferGeometryLoad ) )
124 {
125 if( !m_deferGeometryLoad && !m_loadedGeometryResource )
126 {
127 Initialize();
128 }
129 }
130 else if( IsMatch( value, m_instanceMeshIndex ) || IsMatch( value, m_meshIndex ) )
131 {
132 CreateVertexDeclaration();
133 }
134
135 return Tr2Mesh::OnModified( value );
136}
137
138// --------------------------------------------------------------------------------------
139// Description:

Callers

nothing calls this directly

Calls 4

IsMatchFunction · 0.85
emptyMethod · 0.80
InitializeFunction · 0.50
GetResourceMethod · 0.45

Tested by

no test coverage detected