April 18, 2024, 07:03
bigger smaller reset     1020px Wide width Full width Reset   * *

Gildor's Forums

  Homepage Facebook Read news on Twitter Youtube channel Github page
Welcome, Guest. Please login or register.
Did you miss your activation email?

« previous next »
Print
Author Topic: Material export props.txt question/request  (Read 1650 times)
fatihG_
Newbie
*
Posts: 7


View Profile
« on: November 06, 2019, 10:06 »

Heya,

I have been trying to figure out how to recreate some materials or even just the material instances.
I got it working to modify how some materials work in game, but I am not always able to make it work.

Obviously the Material Instance itself would not be the only place to change the exposed values. It can be done through blueprints and what not as well.
So if my basic mod, a Material Instance, only has references to parameters that are exported in the props.txt files, I am missing allot of other parameters that are in the Parent Material.

Would it be possible at all to export all of the ParameterValues, the ones that are unchanged in the Material instances as well?
When I looked at the uassets in a Hex Editor it lists a bunch of Values, but the problem is I am not exactly sure which is which.

I understand the Material Instance wouldnt neccesarily have the actual Values that are exported in the props.txt, but seeing which Parameter values get referenced alone should be a huge help with modding Materials.

For example, similar to the 'BasePropertyValues', the props.txt contains them, even though 99% of the time they are unchanged.

Thanks
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
« Reply #1 on: November 06, 2019, 10:14 »

Would it be possible at all to export all of the ParameterValues, the ones that are unchanged in the Material instances as well?
When I looked at the uassets in a Hex Editor it lists a bunch of Values, but the problem is I am not exactly sure which is which.
I've been asked about that already, so I did some research. No, it is not possible without doing full parsing of Material object, because default values of parameters aren't stored in MaterialInstance.
Logged
fatihG_
Newbie
*
Posts: 7


View Profile
« Reply #2 on: November 06, 2019, 10:23 »

Yeah, I realize that.

Im just wondering if it is possible at all to just read the Parameters itself, not the values of the parameters.
Like if it just lists out all of the parameters, that do not have any values stored.

Thanks.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
« Reply #3 on: November 06, 2019, 10:28 »

Parameters and their value are stored in Material, in a form of Material graph nodes. Non-default parameter values are in MaterialInstance, and you've got them already. UModel doesn't load a material graph.
Logged
fatihG_
Newbie
*
Posts: 7


View Profile
« Reply #4 on: November 06, 2019, 10:50 »

Hey,

Sorry, maybe I am not understanding correctly.
I am not interested , in the values of the Parameters. Just what they are. Is it a Scalar parameter, vector, 2dTexture, boolswitch, etc.?

I can read them through a Hex editor sure, but it does not tell me what they or how are being used and I can only guess.



As you can see the uasset has an additional 'Metallic4' that is not present in the props.txt.
Now that is fine in this case, I can figure out that metallic4 is most likely a ScalarParameter as well.

But if I encounter something that is 'random' i would have no idea what kind of parameter it is.

So is it not possible for UModel to spit out something like the following?
Code:
   ScalarParameterValues[6] =
    {
        ParameterName = Metallic4
        ParameterValue = undefined
        ParameterInfo = { Name=None }
    }

or even just

Code:
   ScalarParameterValues[6] =
    {
        ParameterName = Metallic4
    }

Thanks and sorry if this is becoming annoying =]
« Last Edit: November 06, 2019, 10:52 by fatihG_ » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
« Reply #5 on: November 06, 2019, 10:52 »

It is not possible to know what anything does exactly without analyzing full material graph. So you can only suppose. Props.txt file is intended to help with this "supposing process".
Logged
fatihG_
Newbie
*
Posts: 7


View Profile
« Reply #6 on: November 06, 2019, 11:07 »

Yeah I understand that what in a regular Material is not the same as a Material Instance.

I'm just asking you if there is a way to figure out what kind of parameter the unchanged parameters are.
Is it a 2dtexture? Scalar? etc. I dont care what the actual Values are, if that makes sense.


Maybe this will explain what I am trying to do:

Basically I am creating a Parent Material (not a Material Instance).
This Parent Material has a bunch of dummy nodes, corresponding to what is exported out to the props.txt.
For example I have Metallic1, Metallic2 and Metallic3 all multiplied together and plugged into the Metallic slot in the Material Graph.
This way when I compile the material, its material instances will have these Parameters exposed.

The way it is set up in the Parent Material is completely irrelevant as we do not know how the developers have set it up.
They are only there so the Material Instance has those Parameters, that we can then tweak in UE4 when we make our mods.
When we then make our mods, we only include the Material Instance with the exposed parameters. That way our Material Instance can 'tell' the original Parent Material what to do.

So I am not trying to recreate the Parent Material. Just trying to fool the game into accepting the Material Instance properly.

And knowing what kind of Parameters these unchanged ones are would help greatly.

I feel like we arent completely understanding each other. =P
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
« Reply #7 on: November 06, 2019, 11:19 »

Unchanged parameters are not stored anywhere. When engine displays a UI for changing a MaterialInstance, it polls a parent Material for list of all parameters, their grouping, and default values. Then applies things which are stored in MaterialInstance, and therefore getting a final data for UI. I understand what you want, but it is not possible to do with UModel.
Logged
fatihG_
Newbie
*
Posts: 7


View Profile
« Reply #8 on: November 06, 2019, 11:29 »

I see,

So when there is no value assigned to a Paremeter, the Material Instance simply doesn't know what the Parameter is?
It's just an array of 'names' untill it needs to access it and get a value assigned.

So are you basically just telling UModel that a paramater is a Scalar based on the data?
And if it is referencing a texture, you export it as a TextureParameter?

If that is the case... then, well that sucks.
As I was really thinking we were making progress.

Funny thing is this method worked on a few mods I tried, but doesnt on others.
Logged
Print 
« previous next »
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS