Texture assets

From HEWIKI
Revision as of 18:29, 4 October 2011 by BENNETT (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How do I load textures assets from the repository?

The path to the texture is embedded in the model's mesh file. And, yes, it is the DOS path, 3ds Max having no knowledge of the mysteries of our Repository system and all. So these paths are identified by a string prefix that is stripped to make it FQN friendly.

This prefix is configurable. So, for us, our Max paths are "\\journey\repository\HJ\..." And we search for "\HJ\" and strip everything up to and including that from the path and that makes it a valid FQN.

So, even "c:\myhappyfolders\repositoryfunthing\HJ\..." would work too, since it's "\HJ\" that is important.

The DOS path -> FQN remapping is done by a method in ClientConfigs.cpp:

HB::string ClientConfigs::ModifiedPath(const HB::string& aFQN) {
  HB::string newfn(StripRootPath(aFQN));

  if(newfn[0] != HB_T('/'))
     newfn = HB_T("/") + newfn;

  return HB::toLowerInPlace(newfn);
}

Typical usage:

 HB::string fqn = gConfig->ModifiedPath(aFQN);

The string used for the search is set by a the "Art Directory" Client Configuration Value. When configuring a world to run a game, the configuration value should be set to the root directory of your Art Server. Note that the default configuration value for a clean engine installation is "\HE\".

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox