MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getModel

Method getModel

plugins/script/interfaces/ModelInterface.cpp:137–145  ·  view source on GitHub ↗

"Cast" service for Python, returns a ScriptModelNode. The returned node is non-NULL if the cast succeeded

Source from the content-addressed store, hash-verified

135// "Cast" service for Python, returns a ScriptModelNode.
136// The returned node is non-NULL if the cast succeeded
137ScriptModelNode ScriptModelNode::getModel(const ScriptSceneNode& node) {
138 // Try to cast the node onto a model
139 model::ModelNodePtr modelNode = Node_getModel(node);
140
141 // Construct a modelNode (contained node is NULL if not a model)
142 return ScriptModelNode(modelNode != NULL
143 ? node
144 : ScriptSceneNode(scene::INodePtr()));
145}
146
147void ModelInterface::registerInterface(py::module& scope, py::dict& globals)
148{

Callers

nothing calls this directly

Calls 3

Node_getModelFunction · 0.85
ScriptModelNodeClass · 0.85
ScriptSceneNodeClass · 0.85

Tested by

no test coverage detected