Jump to content

PostMaterials in 2.15-beta


photo

Recommended Posts

Hi,

In 2.15-alpha, there was a function called Unigine::Render::getPostMaterials(). Apparently, this function got removed in 2.15-beta.

Is there an alternative to get the postmaterials in 2.15-beta+ ?

Thanks

Link to comment

Hi Karim,

Yeah, this method was removed. Now everything is called Scriptable material. So you need to use following methods:

You can find full API changeset in migration section: https://developer.unigine.com/en/docs/future/upgrade/migration_api?rlang=cpp

Thanks!

  • Thanks 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Ok thank you. I will try this out.

I have noticed that getName for materials has been removed. I think the best replacement is getGUID, right? But can getManualName be a temporary replacement for now?

Thanks

Link to comment

getManualName can only return name of the base material (for example, mesh_base) or manual material. If that's what you need - you can use it.

If you want to get the name of any material, it's now become a bit complicated (it's being taken directly from filename now):

const UGUID &file_mat_guid = Unigine::FileSystem::getGUID(mat->getPath());
const UGUID &asset_guid = Unigine::FileSystemAssets::resolveAsset(file_mat_guid);
const Unigine::String &virtual_path = Unigine::FileSystem::getVirtualPath(asset_guid);
const Unigine::StringStack<> material_filename = Unigine::String::filename(virtual_path);

Thanks!

  • Like 1
  • Thanks 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
3 hours ago, silent said:

If you want to get the name of any material, it's now become a bit complicated

Yeah, I too feel this should be in the migration guide, or better in the documentation... or even better a new API function that does exactly that. We too have code that search for a specific material name on a surface to tweak its parameters at run-time.

  • Like 1
Link to comment
×
×
  • Create New...