Jump to content
Official BF Editor Forums
Sign in to follow this  

If you are having problems with texture paths in cgfxShader:

Recommended Posts

I've just today discovered a little quirk in the cgfx shader:

In the cgfxShader, the path of your textures will always start one directory below what you have your project set to.

You set your path by selecting "File>project>Set..."

Here's what it means:

Suppose you are working on the car tutorial and you correctly place the tutorial files so that the color texture for the car is here:

C:Program FilesEA GAMESBattlefield 2bf2editorRawDataObjectsVehiclesLandMy_CartexturesMy_Car_c.dds

Now suppose that your project is set to here:

C:Program FilesEA GAMESBattlefield 2bf2editorRawDataObjects

When you open up Maya, create the cgfxShader as normal, and assign the above texture to the diffuse slot, the path that is stored in the shader will end up being this:


The trouble is that the importer always wants the texture paths to start with "Objects", so you will get "texture not found" or "Move failed" errors, and so on.

How to fix this:

In Maya, select "File>Project>Set..." from the main menu.

In the window that comes up, select your Rawdata folder and apply.

Now your textures should work.

To check it, just look at the texture path in the cgfxShader Attribute editor. It should always begin with "Objects..."

Note: this just deals with the textures. You still select StaticMesh, BundledMesh, or SkinnedMesh as presented in the tutorials and it is still an absolute path starting with "C:"

Sorry this is causing so much confusion, but I only discovered this "feature" myself today. Hope it helps.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this