void EditorBodyControl::ProcessIsSolidChanging()
{
    Entity *selectedNode = scene->GetSelection();
    if(selectedNode)
    {
        KeyedArchive *customProperties = selectedNode->GetCustomProperties();
        if(customProperties && customProperties->IsKeyExists(String(Entity::SCENE_NODE_IS_SOLID_PROPERTY_NAME)))
        {
            bool isSolid = selectedNode->GetSolid();
            selectedNode->SetSolid(!isSolid);
            
            SceneData *activeScene = SceneDataManager::Instance()->SceneGetActive();
            activeScene->RebuildSceneGraphNode(selectedNode);
            
			/* #### dock -->
            KeyedArchive *properties = selectedNode->GetCustomProperties();
            if(properties && properties->IsKeyExists(String("editor.referenceToOwner")))
            {
                String filePathname = properties->GetString(String("editor.referenceToOwner"));
                activeScene->OpenLibraryForFile(filePathname);
            }
			<-- */
            
            sceneGraph->SelectNode(selectedNode);
        }
    }
}
Exemplo n.º 2
0
void GraphBase::NodesPropertyChanged(const String &forKey)
{
	SceneData *activeScene = SceneDataManager::Instance()->SceneGetActive();

	// For some properties rebuilding of selected node only is enough. For other ones,
	// the whole Scene Graph refresh is needed.
	if (IsRebuildSelectedNodeEnough(forKey))
	{
		Entity* selectedNode = activeScene->GetSelectedNode();
		activeScene->RebuildSceneGraphNode(selectedNode);
	}
	else
	{
		activeScene->RebuildSceneGraph();
	}
}