Skip to content

feat: Support direct material property assignment from JSON params #120

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KlausUllrich
Copy link

Extended ApplyMaterialProperties to loop through all properties in the provided JObject and set them directly on the material if they match a known property (e.g., _Color, _MainTex, etc.). Now supports direct assignment of color, float, and texture properties using simple JSON structures, such as: { "_Color": [0, 1, 0, 1] } for albedo color
{ "_Glossiness": 0.5 } for smoothness
{ "_MainTex": "Assets/Textures/MyTex.png" } for textures Retained backward compatibility with the previous structured property format (color, float, texture objects). This change enables more flexible and user-friendly material creation and modification via automation and external tools. Fixes issues where material color and other properties could not be set from automation.

Extended ApplyMaterialProperties to loop through all properties in the provided JObject and set them directly on the material if they match a known property (e.g., _Color, _MainTex, etc.).
Now supports direct assignment of color, float, and texture properties using simple JSON structures, such as:
{ "_Color": [0, 1, 0, 1] } for albedo color
{ "_Glossiness": 0.5 } for smoothness
{ "_MainTex": "Assets/Textures/MyTex.png" } for textures
Retained backward compatibility with the previous structured property format (color, float, texture objects).
This change enables more flexible and user-friendly material creation and modification via automation and external tools.
Fixes issues where material color and other properties could not be set from automation.
@bhadrik
Copy link

bhadrik commented May 20, 2025

I have created agent inside of Unity instead of managing MCP, check it out here.
https://github.com/bhadrik/unity-autopilot

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

Successfully merging this pull request may close these issues.

2 participants