Jump to content

Material ID


Roberto14
 Share

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..

  • Upvote 1

I'm not english, so please sorry for my grammatical errors :)

 

I'm using Leadwerks and can programm in C++ and LUA

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...