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

Function parentSelection

radiantcore/selection/algorithm/Group.cpp:172–191  ·  view source on GitHub ↗

re-parents the selected brushes/patches

Source from the content-addressed store, hash-verified

170
171// re-parents the selected brushes/patches
172void parentSelection(const cmd::ArgumentList& args)
173{
174 // Retrieve the selection information structure
175 if (!curSelectionIsSuitableForReparent())
176 {
177 throw cmd::ExecutionNotPossible(_("Cannot reparent primitives to entity. "
178 "Please select at least one brush/patch and exactly one func_* entity. "
179 "(The entity has to be selected last.)"));
180 }
181
182 UndoableCommand undo("parentSelectedPrimitives");
183
184 // Take the last selected item (this is an entity)
185 ParentPrimitivesToEntityWalker visitor(
186 GlobalSelectionSystem().ultimateSelected()
187 );
188
189 GlobalSelectionSystem().foreachSelected(visitor);
190 visitor.reparent();
191}
192
193void parentSelectionToWorldspawn(const cmd::ArgumentList& args) {
194 UndoableCommand undo("parentSelectedPrimitives");

Callers

nothing calls this directly

Calls 6

reparentMethod · 0.80
_Function · 0.50
ultimateSelectedMethod · 0.45
foreachSelectedMethod · 0.45

Tested by

no test coverage detected