Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Field Researcher
Original Poster
#1 Old 16th Jan 2022 at 12:43 PM Last edited by lizcandor : 16th Jan 2022 at 1:41 PM.
Default Texturing sculpture meshes
Hi all! Got another question - I've made a clone of the SculptSim interaction on the pottery wheel that lets you make sculptures of sims out of all the sculpting materials, not just ice, and it works fine for clay, wood, and stone but metal and topiary sculptures end up as texture-less matte black meshes. So my question is, does anyone have any idea how I might add textures to these meshes? I searched all day yesterday and wasn't able to find any reference to a specific resource in the code (I'm fairly certain the texture assignment happens in SetSculptureInfo, maybe in ObjectSetSculptureType, but I don't see how), and in DeltaBuild2 I've found what seem to be the textures for stone sculptures (mediaStone01, mediaStone02, mediaStone03) but not clay or wood.

Edit: I should add, the big chunk of material that the sculpture is carved out of (what I believe is referred to as the sculpture medium in the code) still has the correct texture, it's only the sculpture itself that's texture-less.
Edit: Ah wait I actually did find the textures for all the sculpture materials, in Fullbuild_p04 - I must have sorted weirdly and missed them last time I checked. Makes it even weirder that these textures don't get used for metal and topiary sculptures though?
Advertisement
Virtual gardener
staff: administrator
#2 Old 16th Jan 2022 at 2:51 PM
Quote: Originally posted by lizcandor
Hi all! Got another question - I've made a clone of the SculptSim interaction on the pottery wheel that lets you make sculptures of sims out of all the sculpting materials, not just ice, and it works fine for clay, wood, and stone but metal and topiary sculptures end up as texture-less matte black meshes. So my question is, does anyone have any idea how I might add textures to these meshes? I searched all day yesterday and wasn't able to find any reference to a specific resource in the code (I'm fairly certain the texture assignment happens in SetSculptureInfo, maybe in ObjectSetSculptureType, but I don't see how), and in DeltaBuild2 I've found what seem to be the textures for stone sculptures (mediaStone01, mediaStone02, mediaStone03) but not clay or wood.

Edit: I should add, the big chunk of material that the sculpture is carved out of (what I believe is referred to as the sculpture medium in the code) still has the correct texture, it's only the sculpture itself that's texture-less.
Edit: Ah wait I actually did find the textures for all the sculpture materials, in Fullbuild_p04 - I must have sorted weirdly and missed them last time I checked. Makes it even weirder that these textures don't get used for metal and topiary sculptures though?


Heya!

It might be the fact that EA made it so for those the material state changes in code? At least the ones you mention are set programmatically like so:

Code:
// From: Sims3.Gameplay.ObjectComponents.SculptureComponent
	public void SetShaderIfNeeded()
	{
		if (Material != 0 && Material != SculptureMaterial.Topiary && Material != SculptureMaterial.Metal)
		{
			World.ObjectSetSculptureType(base.mScriptObject.ObjectId, mSculptureMaterial);
		}
	}


i'm assuming because those have their own respectable shaders, whereas Wood and Ice and stuff simply use Phong?
Field Researcher
Original Poster
#3 Old 16th Jan 2022 at 3:05 PM Last edited by lizcandor : 16th Jan 2022 at 5:13 PM.
Hrm. Is there any other example of the shader for a mesh getting assigned in-game that I could reference? I'm not even sure if that's the right question to be asking, I've read a few threads about shaders but never really got it.

It does seem like SetShaderIfNeeded() is the critical method somehow - I just made my own version of AddSculptureAndMediumToStation so I could make it run World.ObjectSetSculptureType on Topiary and Metal sculptures, and now the sculpture is flashing bright red instead of being flat black, lol

Edit: Oh, here's an idea - maybe instead of figuring out how the shaders for the original sculptureSim object work, I could clone it and have the shaders for the clones be set in their MLOD resources (which sculptureSim doesn't seem to have) instead of programmatically? And then just have my version of SculptSim only ever create my sculptureSim clones instead of the original object.
...that actually seems to be much easier said than done and I'm very confused, so I may just table this part of the mod for now and only enable clay/wood/stone sim sculptures.
Back to top