Jump to content
Roberto14

Material ID

Recommended Posts

Hi all guys,

 

i have a suggestion about materials in LE:

 

if a material can have a sort of ID ( a string for example ) that can be assigned in the editor and then used in a script or c++ code to quickly identify the material by coder without a path string manupulation.

 

For example using material "Materials\\Concrete\\concrete_clean.mat", ( if i don't mistake ) can be simplified into "concrete_clean" but first removing the path and then removing the extension.

 

With the user specified ID a material in c++ can be easly identified by using for example:

 

if ( pickinfo.surface->material->ID == "concrete" ( defined inLE editor ) ) {

...

}

 

This would be very useful for footsteps, bullet impact or other things..

Share this post


Link to post

I think he means more of something like

 

Material::LoadById("bullet_impact")

 

instead of

 

Material::Load("some\long\pathname\bullet_impact_d.mat")

Share this post


Link to post

If the point of wanting this is to Id later in code for a check like in his example then what josh said should work. If the point is to be able to make one change to point to what a name is pointing to instead of finding and changing each loading of said code then what he's asking for makes sense. Does that come up often is the question. Often enough to warrant the code to set this up in the editor. Seems lower on the priority of things.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...