void Scene_BrushConstructPrefab(scene::Graph& graph, EBrushPrefab type, std::size_t sides, const std::string& shader) { if(GlobalSelectionSystem().countSelected() != 0) { const scene::INodePtr& node = GlobalSelectionSystem().ultimateSelected(); Brush* brush = Node_getBrush(node); if(brush != 0) { AABB bounds = brush->localAABB(); // copy bounds because the brush will be modified Brush_ConstructPrefab(*brush, type, bounds, sides, shader, TextureTransform_getDefault()); SceneChangeNotify(); } } }
void Scene_BrushConstructPrefab(scene::Graph& graph, EBrushPrefab type, std::size_t sides, const char* shader) { if(GlobalSelectionSystem().countSelected() != 0) { const scene::Path& path = GlobalSelectionSystem().ultimateSelected().path(); Brush* brush = Node_getBrush(path.top()); if(brush != 0) { AABB bounds = brush->localAABB(); TextureProjection projection; TexDef_Construct_Default(projection); Brush_ConstructPrefab(*brush, type, bounds, sides, shader, projection); SceneChangeNotify(); } } }