Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add another way to override materials that isn't based on attributes #5652

Open
CarsonKompon opened this issue Jun 14, 2024 · 5 comments
Open

Comments

@CarsonKompon
Copy link

For?

S&Box

What can't you do?

There are a few models on asset party that I have encountered over the years and have wanted to use in certain use cases but have not been able to since the models creators didn't add any attributes. But the creators of every single model every should not HAVE to put attributes on anything, I should be able to go through a list of all materials and override just the one im looking for.

Examples of models that have screen materials that COULD be overwritten given there was a way to achieve this:
https://asset.party/randkassets/r_k_monitor
https://asset.party/trend/arcade1
https://asset.party/facepunch/tv

How would you like it to work?

Ideally there would just be another SetMaterialOverride function on ModelRenderer that looked something like this:

void SetMaterialOverride(Material previousMaterial, Material newMaterial);

or like this:

void SetMaterialOverride(int materialIndex, Material material);

What have you tried?

I looked around ModelDoc to see if there was any way I could override the different materials of an existing model so i could replace the screens with my own screen material containing an attribute but there was no option. Even when setting a Base Model.

Additional context

No response

@Gmod4phun
Copy link

Its doable, you can add your own attributes for each material and override it that way. Refer to this #3435

I don't know why garry closed the issue, as I think it would still be very useful to have that exposed nicely in the API somehow, instead of having to do your own implementation.

@CarsonKompon
Copy link
Author

Its doable, you can add your own attributes for each material and override it that way. Refer to this #3435

I don't know why garry closed the issue, as I think it would still be very useful to have that exposed nicely in the API somehow, instead of having to do your own implementation.

Appreciate the workaround. I hope he doesn't mark this issue as completed too because this isn't an elegant workaround imo. Simple things like this should be accessible really easily (and as Nebual says in the linked issue it really shouldnt be a challenge to add to the engine)

@MrBrax
Copy link

MrBrax commented Jun 14, 2024

pretty sure before the scene system you could just replace by index?

@garrynewman
Copy link
Member

I like the index method better

@Gmod4phun
Copy link

Since we now have Camera.RenderTarget, this would be also nice to have. Would be pretty easy to setup RT cameras and monitors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

5 participants