• 0.956213558934492

    posted a message on [Texture, Model, Data] Texture Declarations, Texture Slots, and Texture by ID in Galaxy Editor (2021)

    Recently, I have tried changing a model's colors dynamically using the Tint Color event in the actors menu. Unfortunately, the model had a greenish color in it's underlying textures which was causing some conflicts with the actor event Tint Color preventing the model from changing colors and displaying correctly. For some colors it would work but for others it would not. The solution was simply replacing the existing textures with the same ones but in a different base color (white). This required many hours of research, trial and error, and attempting different approaches before finally discovering the best approach. To save others some of this headache and offer something back to the community, I've decided to make a updated 2021 write-up on how to do a texture swap in the SCII galaxy editor, fully compatible with battle.net online use.

    Disclosures:

    Performing a texture swap is not a task for beginners in the editor. It is going to be assumed in this tutorial's description that you know how to navigate the different areas within the editor.

    I have discovered that replacing textures using Blender or another modeling program only works locally. It will not work on battle.net.

    Proceeding onward, I will use the same model I was working on as an example for demonstration. The model moving forward is called "Challenge Shield". It is an aura-like circle with a glowing green platform, surrounded by a shield with circuit-like patterns rotating around the platform.

     

    Getting Started: Finding the used source Textures.

    First things first, we'd like to know what texture needs replacing. There are many ways to go about this, but we'll just use the method most convenient to do which is to use the cutscene editor.


    Open the cutscene editor. In the left hand panel, you'll find a few different tabs (Models, Sounds, Files, Conversations). Under the models tab, you'll want to find the model you are trying to do the texture swap on. Type "Challenge Shield" in the search bar, find the model, and add it to the scene. With it now selected in the editor, go to editor's tab Object and select Model Data or just press shift + D. This will bring up a new window showing you all the resources used within the selected model (including the textures).

    Model Data within the Cutscene Editor

    The textures should be located under the materials directory of the model's tree. There may be different multiple different textures used on different layers, but don't worry about that for now. If we expand the different directories under the Materials directories, we can see there are a few key terms Emissive, Diffuse that are referencing a .dds file. Now we know the names of the files we need to replace. We will be looking at the two textures "ChallengeBubbleTech.dds" and "AOE_SplatTerran2_Green.dds" in our example. Tip: you can leave this window opened while you continue forward which can be useful for referencing file names later on.

    Previewing Textures in the Editor:

    I found the easiest way to preview these texture images within the editor is to just use the editor's asset browser. Within the editor, go to to the tab Window->Console or just press Alt + `. In the console field, type "browse". It will open a new window that allows you to browse different assets within the game. Now search for the texture you are looking for and it'll allow you preview the image. Additionally you can right click the file, hit export and save it somewhere on your computer locally for editing.

    Previewing Textures within the Editor

    Importing new Texture assets:

    From this point forward it is going to be assumed that you have the replacement Textures you would like to use on the target model on your computer. It must be in .dds format. PNG, JPEG, or other image formats will not work. If your file is not  in this format there is a nifty little online image converter here that worked well for me.

    You will need to import the texture files into your project through the import manager in the editor. It must be noted that if you attempt moving the image files into the project directory outside of the editor's import manager, it will not be recognized or found. With the Import Manager open, right click a blank space and select Import Files. A new window will open up. From here you can navigate to different areas on your hard drive and select the new .dds texture files you would like to use for your model. As a tip, I recommend making a new folder in your project called "Resources" where you can place all custom files. It just makes your project and file structure a little bit more organized. Warning: Import Manager will automatically select all files within the directory by default. Un-check the root directory first, or you risk importing a ton of unnecessary files into your project incidentally.

    Importing files into your project

    In my example, you can see the texture I am going to use to use in place of the ChallengeShield.dds texture. It is white instead of green, which should allow me to use the Tint Color feature better later on.

    Example of newly imported texture.

    The order in which we proceed from here doesn't really matter now that we have our source texture names and the replacement textures imported. However, I am going to head over to the "Textures" tab within the Data Module because I think that makes the most sense for explaining how this all comes together.

    Creating Texture Entries:

    In this Tab, we'll want to create a new Texture entry. Right click -> click "Add Texture". Give it an appropriate name. I like to name things as the replacement texture name, so for in my example I'll call it "ChallengeBubbleTech". After naming the entry, it's important that you hit the "suggest" button next to the ID field. This will later be referenced by the model.

    On the panel to the right, under "Field" look for file. This is where we will target the replacement texture to be used for our model. Select the empty entry and navigate/search for the new imported file in your project.

    "Slots" and referencing models:

    Next we need to give the Texture entry a "slot". A slot is like somewhat of an arbitrary (yet, reserved) namespace for the texture to by referenced by the model. It'll make more sense later as we move forward in this tutorial. All you need to know for now, is that slots have specific names created by blizzard and need to be typed correctly in the field. Otherwise it may just reset the typed field to be what it was previously or revert back to being a blank field. These are the available slot names known currently (source):

    • Decal
    • Main
    • Reflection
    • Video
    • Campaign
    • Terran
    • Zerg
    • Protoss
    • Merc
    • Body
    • Head
    • Hair
    • Generic 01
    • Generic 02
    • Generic 03
    • Generic 04
    • Generic 05

    There are also some variations of these slots, such as "main.diffuse" or "main.emissive" which worked for me in testing. Some of these slots (like "Generic 01") did not work in my testing. This is where my research and tutorial falls a little short because there is not too much documentation on all the available slot names. If someone can add a more comprehensive list, I will update the post with it. The most important thing that we know how a slots relationship with the model works.

    In my example, I will be using the "decal" slot for linking the new texture to the model. It does not matter which one you use!! And has nothing to do with which texture layer you are trying to target on the original source model. 

     

    Texture Declarations and Adaptations:

    Now, we need to navigate to the Models tab within the data editor and track down the source model. Just type the model name we previously used in the cutscene editor to locate the model. With the model highlighted, on the right hand panel, find the Texture Declerations Field. This is where we specify what could be considered the "input" for the replacement texture. Double click this field entry and a new window will open.

    Texture Declarations preview


    Here we can create new Texture Declarations and "Adaptations". Each new Texture Declaration can be thought of as a new "search term" to target a texture filename from the model. Each Adaptation is the actual string to search for. 

    If we go back to the cutscene editor and take another look at the Modal Data, we can see that a single texture might be used multiple different times for an effect. A single Texture Declaration will replace all references of that source texture filename. The index of the Texture Deceleration does not matter and does not need to align with the directory of the Model Material for which the texture lies. It is the slot name that links the new texture to this Texture Deceleration, and the Texture Declaration which targets the Model's source texture to be replaced.

    Create a new Texture Deceleration with the + sign on the right. With the newly created declaration highlighted, create a new adaption in the section below. 

    Trigger on Substring targets the filename of the texture you want to replace on the model. If you don't know, a prefix is usually some sort of identifier delimited by an notator (like an underscore "_") within a filename. For the adaptation to work, the Prefix field is a requirement. You must include one even if the filename does not have a prefix in it. This is why I chose "ChallengeBubbleTech.dds" as an example instead of "AOE_SplatTerran2_Green.dds" which also exists in this example model. You can circumvent the issue of not having a prefix by just faking one for the entry:

    "ChallengeBubbleTech.dds" can be entered as an adaption term like so:

    Prefix: "Challenge"
    Trigger On Substring: "BubbleTech.dds"

    You can include the file extension in the substring or not. It does not matter. I like to include it as it is more explicit.

    The "slot" field is like a node to link a new Texture to the model. Remember how we first created a Texture entry in the data editor and gave it the "decal" slot? This is what we will use again here. Give the Adaption the slot name for the Texture you would like to replace with. After this, you can leave all remaining fields to their defaults and close the Texture Declarations window.

    Note that this single entry will only target the "ChallengeBubbleTech.dds" texture. If you also wanted to replace the other material textures, then you will need to create another Texture Deceleration with another adaption which utilizes a different slot corresponding to another Texture entry in the Data Module. 

    Actor Events and Texture by ID:

    Now that this is all configured, we can head on over to whatever actor is being used in your map. In the events field, create a new event "Actor Creation" and under that event use the "Texture by ID". We can search for the Texture name that we made earlier. This only looks for the ID name that was suggested earlier, instead of the editors name in the entry of the Textures panel.

    actor creation -> texture by ID

    Final Result:


    Now when the map starts, whenever the actor is spawned/created it will apply this new texture over the default ones. It will do so using the assets we imported to the project, which are also uploaded when published so this will be compatible and work on battle.net as well!

    And as for the finishing result, we now have the model with our new textures applied:
    ChallengeBubbleTech White Textures


    Performing this research, writing and editing the post, and gathering the image resources all took a great amount of time and effort. Did you find this helpful? If you did considering throwing your dog a bone ;)

    Posted in: Tutorials
  • 0.956223568407818

    posted a message on [Texture, Model, Data] Texture Declarations, Texture Slots, and Texture by ID in Galaxy Editor (2021)

    @mods

    I cannot seem to link images from google photos or another image hosting site like imgbb.com. 

    This was a rather long and descriptive post that I took many visual pictures for and I'd rather they be included than not.

    Could someone assist in troubleshooting this? I have tried using the share link, the "viewer link" the "html, full, viewer etc" as well. It just seems like nothing works!

    Posted in: Tutorials
  • To post a comment, please or register a new account.