[Solved] Workspace Name

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Hilarius86
Halfling
Posts: 51
Joined: Thu Feb 14, 2019 11:27 am
x 8

[Solved] Workspace Name

Post by Hilarius86 »

2.1

Hi,
is there a way to extract the "name" of a CompositorWorkspace or its defintion?
I use

Code: Select all

Ogre::CompositorManager* compMan = ...->getCompositorManager2();
Ogre::CompositorWorkspace* compWork = compMan->addWorkspace(..., ..., ..., "WorkspaceName", ...);
I am after this: "WorkspaceName".
This is used as mDefinition in compWork, but I can't find a method to extract the information from the workspace or the CompositorWorkspaceDefinition. Is there any reason not to provide this?

I want to create a new workspace from the current workspace definition to render to texture for a high res screenshot.
Last edited by Hilarius86 on Wed Sep 09, 2020 9:00 am, edited 1 time in total.
Lax
Gnoll
Posts: 659
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 63

Re: Workspace Name

Post by Lax »

Hi,

there is no method of getting out the stored compositor name. Its internally used in a map. You have to store your compositor name as a member variable for identification.

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5446
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1348

Re: Workspace Name

Post by dark_sylinc »

This is an oversight.

The name of the workspace is stored in workspace->mDefinition->getName() but there is no way to access it.

Update: Fixed. Call workspace->getDefinition()->getName() (getNameStr() to get the human-readable version)
Hilarius86
Halfling
Posts: 51
Joined: Thu Feb 14, 2019 11:27 am
x 8

Re: Workspace Name

Post by Hilarius86 »

Wonderful, I would have provided a PR as well.
To remove a CompositorWorkspace from my manager I already had a member pointing to it. Just felt strange to also add "string lastestCompositorWorkspaceName" as a second member.