-------------------------------------------------------------------------------------- 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
| 103 | // true always |
| 104 | // -------------------------------------------------------------------------------------- |
| 105 | bool 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: |
nothing calls this directly
no test coverage detected