Change for solid material colour?

Hey guys.

In jme3 I used to be able to go :

    Material landingMat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        landingMat.setColor("m_Color", colour);

However that now null pointers.

What is the new version of that ^^?



No, that should work. Your colour variable is probably null.

sweet - right enough it was my own fault. :expressionless: :expressionless:

Hmm well there is something which I think might have changed.

This worked last week - and im using new nightly builds each day. Today this dosnt work :

  Quad box1 = new Quad(30, 31);
        Geometry blue = new Geometry("Box", box1);
            Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/SimpleTextured.j3md");
        TextureKey key = new TextureKey("Interface/cursor.png", true);//Locator must be set to root directory
        Texture texture = getAssetManager().loadTexture(key);
        mat1.setTexture("texture", texture);

It throws : java.lang.IllegalArgumentException: Material parameter is not defined: texture

on the setTexture line?

Yeah, everything is correct. The "texture" parameter is undefined inside the material. If you look inside SimpleTextured.j3md, you'll see that it has a m_ColorMap parameter that you should be using instead.

Ahhhhh! Now I understand what that actually refers to, thanks for clearing that up so quickly :slight_smile: