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!
Test Subject
Original Poster
#1 Old 6th Apr 2015 at 7:58 AM
Referencing textures for objects?
Hi, sorry if this is in the wrong forum category! I would like to know how you reference textures from objects for your new object, I don't plan on changing the textures so it seems unnecessary to clone the same textures.. If that makes any sense xD I think Plasticbox has some uploads that do this, I could be wrong though! If anyone could tell me it would be very much appreciated
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 6th Apr 2015 at 4:41 PM
This is the right forum =)

What I do most often is import textures with the same resource key as the original ones (and delete them from the package afterwards); this will make the material definitions reference the correct instance ID. E.g. when there's a dds with ID 0x0000000000001234 you want to reference, just import any random texture, then change its instance to 0x0000000000001234 (in TSRW this is in top menu: Edit > Project Contents > right-click on the resource and select "Renumber"). This will make your object load that DDS no matter whether it's in your package, in some other package (like when you already have an override for it), or in the game files.

TSRW also leaves the original material definitions intact when you clone an object, so if you want to use these you just need to name your material variants accordingly (in Maxis objects the first three are almost invariably set1, set2, set3, the rest can vary) and they will be referenced automatically.


Sometimes I also C+P the instance ID into the material definitions in s4pe: Select the MODL and MLODs group 0x00000000, hit "Grid", then in the window that opens click on the three little dots next to "ChunkEntries". It helps to C+P the entire list from the preview panel into your favourite text editor first since you can browse/search it in parallel then (like to be able to see which ChunkEntries are the ones you want to change).


That said, when you already know you're not going to change the textures of your object, what is it that you want to do with it? It's often not necessary to clone the mesh either when you just want to change say the price or something like that (an override for the COBJ and OBJD would be enough for that).


(I'm referring to a TSRW version from early/mod March above, I d/led the current one but haven't used it yet -- just in case something is different in that one)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
Original Poster
#3 Old 6th Apr 2015 at 8:30 PM
Thankyou for replying! Sorry if this is a stupid question but how do I know the original resource instance? Also I'm not sure if this matters but i've been using Sims4Studio to clone. I am editing the rig to make the object larger
Test Subject
#4 Old 6th Apr 2015 at 9:37 PM
I'm a bit confused. Let's say Object A has 20 recolors. I want to "slave" object B to object A (they share the same mapping). Do I have to import 20 textures to object B? Because if that's the case, then what's the point of texture referencing if I still have to add the 20 textures? Unless I'm missing something? I'm new to texture referencing D: That's what I miss from ts2, slaved objects lol, makes recoloring so much easier.

Thanks.
Pettifogging Legalist!
retired moderator
#5 Old 6th Apr 2015 at 10:14 PM
Quote: Originally posted by Snozzberry
Do I have to import 20 textures to object B? Because if that's the case, then what's the point of texture referencing if I still have to add the 20 textures?

No you don't actually add them -- that's just what I do to add the references. I just import them temporarily, so that all of the models will have a reference to "picture 0000001234" .. once that's done I delete those textures.

But, again, what is it that you want to change about your object? Is this a new mesh at all? If it isn't there may very well be more efficient methods to reference stuff.


Quote: Originally posted by lucy65710
how do I know the original resource instance?


I either look up the key of the object name in the string resource and search for that in s4pe (filter for COBJ -- the OBJD with the same instance is the one you want, with a reference to the original MODL, rig, rslt, etc), or it's also listed in the material definitions when you clone an object with TSRW. I believe S4S has an option to make overrides, that will probably also give you a copy of the original material definitions.


Quote: Originally posted by lucy65710
I am editing the rig to make the object larger


Then you might not need to clone the mesh at all -- try making a custom rig and referencing that in your OBJD. Or if you want to make the actual Maxis object larger, override the rig.

This does not work for all objects (in a lot of Maxis objects the dropshadows won't change size/position when the rig is changed, I believe that's because they have no bone assignments) but it's worth a try.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
#6 Old 6th Apr 2015 at 10:45 PM
Quote: Originally posted by plasticbox
No you don't actually add them -- that's just what I do to add the references. I just import them temporarily, so that all of the models will have a reference to "picture 0000001234" .. once that's done I delete those textures.

But, again, what is it that you want to change about your object? Is this a new mesh at all? If it isn't there may very well be more efficient methods to reference stuff.


Well the object(s) in question are Veranka's newly released Ikea Lack Set. They're all mapped the same, so instead of importing my recolors (30 recolors for each object), which would be very time consuming, I just wanted to "slave" each object to a "master" object (ie; the end table). That's it. There's probably a more easier way? I never did any kind of slaving when I was playing ts2 either, so this is very new to me. I use s4s too, can't seem to get tsw working for me >.>

Thank you.
Lab Assistant
#7 Old 13th Apr 2015 at 2:24 PM
Sadly, this does not work for Sims 4, because the materials are included in the mesh resource (MODL/MLOD).
So you can´t simple link to another mesh package and all recolors are automatically available like we did in Sims 2.
You have to create the 30 recolors for each object manually, rename the instance numbers as described above and remove the textures from the package with s4pe afterwards (except of the master package, of course).

Fairy Forest - Downloads for the Sims
Part-time Hermit
#8 Old 21st Apr 2015 at 3:58 PM
I tried the manual linking in S4PE, replacing the Diffuse Map references in MODL and MLOD group 0x00000000 to an original Maxis texture. However, something is wrong. In the catalog the color options show correctly, but on the actual object it only displays the first color option, no matter which one you choose.
Pettifogging Legalist!
retired moderator
#9 Old 21st Apr 2015 at 5:36 PM
The first option is often the one used as a fallback in Maxis objects (i.e. the one that gets displayed when all else fails). If the correct textures appear in the catalog, you must have done something right though -- without knowing what object this is, I suspect maybe you just forgot to change the references in MLOD 0x00000001 perhaps?

(You probably know this already, but when fiddling with objects one should make sure to frequently nuke localthumbscache .. it can become rather confusing when that is out of sync with the actual objects in game)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Part-time Hermit
#10 Old 21st Apr 2015 at 5:46 PM Last edited by IgnorantBliss : 21st Apr 2015 at 6:23 PM.
Quote: Originally posted by plasticbox
The first option is often the one used as a fallback in Maxis objects (i.e. the one that gets displayed when all else fails). If the correct textures appear in the catalog, you must have done something right though -- without knowing what object this is, I suspect maybe you just forgot to change the references in MLOD 0x00000001 perhaps?

(You probably know this already, but when fiddling with objects one should make sure to frequently nuke localthumbscache .. it can become rather confusing when that is out of sync with the actual objects in game)


It's a wall shelf. At first I hadn't changed the MLOD 0x00000001, but then I tried doing that, and it still didn't work. I suppose there isn't anything special about objects created with Sims 4 Studio that would prevent texture referencing? I will have to double check everything, but my eyes were starting to glaze over from all the instance numbers.

OK, and now that I cleared the thumbnail cache, the thumbnails don't display the correct colors, either.

Added the file as an attachment in case someone wants to take a look. The swatches don't correspond to what the colors actually should be.

Edited to remove attached file.
Pettifogging Legalist!
retired moderator
#11 Old 21st Apr 2015 at 5:57 PM
Quote: Originally posted by IgnorantBliss
now that I cleared the thumbnail cache, the thumbnails don't display the correct colors, either.


Oh, then the thumbs you were seeing were probably a leftover from some earlier state of that object. That's what I meant above =)

I wouldn't know about anything in an object that would prevent this kind of reference from working -- it works the same in all objects I have seen so far. If you post the package (you can also PM me a link if it's a WIP that you don't want published yet) I can take a look at it later. -- didn't see you have already attached it. I will take a look!

One other thing you could check in the meantime: make sure you don't just replace the actual instances, but that the groups also match. You might have given your custom textures a group ID of 0x80000000, Maxis textures always have 0x00000000. If this is wrong the game won't find a texture either.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Pettifogging Legalist!
retired moderator
#12 Old 21st Apr 2015 at 6:08 PM
Double posting to make sure you see this: your actual references seem correct (at least the ones I looked at) but the MTST at least in the MODL is broken. It goes

--- ChunkEntries[06] ---
--- 0x02019972-0x00E58689-0xE0DC8BAB56234207 - MTST ---
Version: 0x00000300
NameHash: 0x341F6150
DefaultMaterialIndex: (unset)
--- Type300List: Type300Entries (0x10) ---
[00]: Index: 0x0000000B (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[01]: Index: 0x0000000C (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[02]: Index: 0x0000000D (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[03]: Index: 0x0000000E (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[04]: Index: 0x0000000F (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[05]: Index: 0x00000010 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[06]: Index: 0x00000011 (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[07]: Index: 0x00000012 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[08]: Index: 0x00000013 (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[09]: Index: 0x00000014 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[0A]: Index: 0x00000015 (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[0B]: Index: 0x00000016 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[0C]: Index: 0x00000017 (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[0D]: Index: 0x00000018 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[0E]: Index: 0x00000019 (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[0F]: Index: 0x0000001A (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
---

"MaterialVariant: 0x00000000" is the fallback -- normally, this list would have the hashes of the names of your material variants (that are listed in the OBJD), like 0xF4BD1CE9 for "set1-materialVariant". I don't know how you ended up with them all being zero but if you want to repair your object you'd need to replace all but the first one (that is usually the actual default) with the hashes of those material variant names. It might be a bit hairy to figure out which is which though. There's always two for each one (burnt and not burnt, in this case -- dirtyable objects would have three each), like so:

--- Type300List: Type300Entries (0x10) ---
[00]: Index: 0x0000000B (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0x00000000
[01]: Index: 0x0000000C (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0x00000000
[02]: Index: 0x0000000D (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0xBA5CC973
[03]: Index: 0x0000000E (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0xBA5CC973
[04]: Index: 0x0000000F (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0xDE5CF5D6
[05]: Index: 0x00000010 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0xDE5CF5D6
[06]: Index: 0x00000011 (0x01 (Private)); MaterialState: 0x00000000 (0); MaterialVariant: 0xF4BD1CE9
[07]: Index: 0x00000012 (0x01 (Private)); MaterialState: 0xC3867C32 (Burnt); MaterialVariant: 0xF4BD1CE9

etc etc

(That's for set1, set2, set3 -- those are what Maxis always seem to be using, the rest varies ("noir01" and so on).

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Part-time Hermit
#13 Old 21st Apr 2015 at 6:21 PM
Thank you so much! This seems doable. I will get into it as soon as my eyes (or rather my brain) unglaze from the previous tinkering.
Part-time Hermit
#14 Old 21st Apr 2015 at 7:20 PM
For some reason the changes I try to make to these entries won't take. I've filled in the hashes several times, committed and saved, but yet they remain in their default state.
Pettifogging Legalist!
retired moderator
#15 Old 21st Apr 2015 at 7:35 PM
That's .. weird. Which version of s4pe do you have there? Off the top of my head I don't know if anything was ever changed with regards to MODL/MLOD -- I mostly use 0.2d with Inge/Snaitf wrappers and never had any issues with this kind of thing. The links to those wrappers should be in the sticky in Tools.

Other than that I can only think of broken permissions (not sure exactly how that works in Windows), but that would result in you being unable to edit the package at all, which you obviously aren't.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Part-time Hermit
#16 Old 21st Apr 2015 at 7:44 PM Last edited by IgnorantBliss : 21st Apr 2015 at 7:58 PM.
I'm using the latest version, I believe, with Inge's wrappers.

How frowned upon would it be to upload an object that contains unedited Maxis textures from the base game? I'm just thinking that if I can't make this referencing thing work with reasonable effort, is it better to not upload at all, or upload an object with the textures included? I may take a look at this again tomorrow with a fresh brain, but right now I'm starting to feel like maybe I'm wasting too much time on something that's not going to work. But, in any case, thanks for your help .

Edited to add: When I look at any objects cloned with Sims 4 Studio, they all have the same kind of MTST with only the default, fallback hashes. So it is probably something to do with Sims 4 Studio that the textures can't be linked.
Pettifogging Legalist!
retired moderator
#17 Old 21st Apr 2015 at 8:22 PM
Quote: Originally posted by IgnorantBliss
How frowned upon would it be to upload an object that contains unedited Maxis textures from the base game?


It's of course way less problematic than with EP/GP objects! You would only be redistributing content that everyone already has, so there is no problem in that regard =). It's still unnecessary from a technical standpoint, but I know you know that already (I still remember your nifty referencing stuff from TS2 =) ..

Quote: Originally posted by IgnorantBliss
When I look at any objects cloned with Sims 4 Studio, they all have the same kind of MTST with only the default, fallback hashes. So it is probably something to do with Sims 4 Studio that the textures can't be linked.


Huh. I wasn't aware of that at all .. shows how much I download. How are those objects even working, then?

It's still weird that you cannot edit that MTST. Because I can -- see the attached screenshot (I saved it under a different name and re-opened, to make sure it's not perhaps breaking when saving, that's why it's named differently .. but this is your object). I honestly don't remember why I decided to stick with s4pe 0.2d at some point, but there probably was a reason, so if you still got some nerve ends left, maybe try using that version? The only thing I use 0.3b for (or was it a?) is exporting dds since it has that helper tool.


Also, I dunno, I don't use TSRW because I love it so much, but maybe you should give that a try if you're not keen on having unneeded stuff in your package. In that regard it does the opposite of what S4S is apparently doing: it only imports files when the user explicitely says so, everything else keeps the references of the object you clone from. It also keeps all of the material definitions intact which is sometimes unneeded but sometimes extremely handy (because it means that for any Maxis edits / add ons, one only needs to make the first colour variant in TSRW and can copy+paste the rest in s4pe -- all of the remaining COBJ/OBJDs I mean, which for me is a lot faster than adding materials the clickypointy way).
Screenshots

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Alchemist
#18 Old 21st Apr 2015 at 11:45 PM
IgnorantBliss, I think the problem you're having is that without the correct wrappers s4pe is not able to read the Variant ID. Kuree never updated it to do so natively. Here is a table mesh cloned with Studio and opened in the Warehouse. All the Variant ID's are there:



Here is the same .package opened in s4pe without whatever wrappers are making this work currently...the version I have is 0.3a and it is not able to read the variant ID, instead changing the number to all 0's:



The situation is the same in the Grid view:



And if I make no changes to the LOD at all but commit and save using s4pe and reopen it in Studio all the Variant ID's have been stripped off:



While Studio is able to do the edit you want to do, if you feel more familiar with this type of edit in s4pe and prefer to use that, you should update to the wrapper set that will allow s4pe to function correctly. It won't matter if you clone the item with TSRW or with Studio...if you open the .package in a version of s4pe that isn't updated with the right wrappers it will strip the Variant ID's off.
Part-time Hermit
#19 Old 22nd Apr 2015 at 3:17 AM
Thank you for the explanation. I have to say I'm a bit confused by the wrappers, because I don't quite understand what they are and if I've installed them correctly. But I've been using S4PE for this kind of editing because I haven't been able to find these same resources in Sims 4 Studio. Where exactly do you get to edit the Material Variants in Sims 4 Studios? I've been trying to click through things looking for them, but I haven't found them.
Part-time Hermit
#20 Old 22nd Apr 2015 at 3:21 AM Last edited by IgnorantBliss : 22nd Apr 2015 at 3:51 AM.
Quote: Originally posted by plasticbox
Also, I dunno, I don't use TSRW because I love it so much, but maybe you should give that a try if you're not keen on having unneeded stuff in your package. In that regard it does the opposite of what S4S is apparently doing: it only imports files when the user explicitely says so, everything else keeps the references of the object you clone from. It also keeps all of the material definitions intact which is sometimes unneeded but sometimes extremely handy (because it means that for any Maxis edits / add ons, one only needs to make the first colour variant in TSRW and can copy+paste the rest in s4pe -- all of the remaining COBJ/OBJDs I mean, which for me is a lot faster than adding materials the clickypointy way).


Is it possible to make design tool compliant objects with TSRW? Because that's an important issue to me. If so, I will probably give it a try. Sims 4 Studio does that automatically, and they have awesome tutorials available, which is why I've been sticking with it so far. I also vastly prefer Blender to Milkshape, and I appreciate the easy export and import of meshes.
Alchemist
#21 Old 22nd Apr 2015 at 4:14 AM
Quote: Originally posted by IgnorantBliss
Thank you for the explanation. I have to say I'm a bit confused by the wrappers, because I don't quite understand what they are and if I've installed them correctly. But I've been using S4PE for this kind of editing because I haven't been able to find these same resources in Sims 4 Studio. Where exactly do you get to edit the Material Variants in Sims 4 Studios? I've been trying to click through things looking for them, but I haven't found them.
Wrappers extend the tool's ability to read specific resource types. S4pe was designed as a project that people could contribute extra wrappers to that would allow it to increase its power.

To edit the Material Variants using Studio first open the .package and when you're on the Model Viewer page click the Warehouse tab. Once you're on the Warehouse screen click the Model line. Scroll down on the right side until you see the Lods and click Edit Items:



The editing Lods box will pop up and it has a list of all the LOD groups in the model. Click on the High Detail group. Scroll down and click the Edit Items box on the Meshes line:



When the Editing Meshes box pops up it will have a list of all the Meshes in the Lod. Choose the Phong group - it's the main (non-shadow) mesh for this Lod. Click the Edit Items box on the Entries line:



The editing Entries box will pop up and it has a list of all the Material Variants on the left. To edit them click on the one you want to change and, on the right side, click the Edit Items box on the Items line in the Materials section:



The Editing Items box will pop up and it has a list of all the shader fields in this Mesh. The diffuse map is usually a little way down on the list.



I'm glad you've found the Studio tutorials helpful. If the current list of tutorials for it is lacking I'm happy to write more if I know what topic people need covered.
Part-time Hermit
#22 Old 22nd Apr 2015 at 4:34 AM Last edited by IgnorantBliss : 22nd Apr 2015 at 4:54 AM.
Thank you, this extremely helpful! For some reason with this particular object, which is a wall shelf cloned from The Immaculate, the meshes link doesn't show anywhere else but with the low detail LOD. Is it perhaps because all the LODs are the same in this case? It's such a low detail mesh to begin with that I imported the same version for all three detail levels, as had Maxis done.

And thank you for your awesome, detailed tutorials!

Edited to add: Actually this seems to be the case with every wall shelf from the base game, that the link to edit meshes is only with the lowest detail LOD. And this is whether the same detail mesh is used for all of them or not.
Alchemist
#23 Old 22nd Apr 2015 at 5:15 AM Last edited by orangemittens : 22nd Apr 2015 at 5:25 AM.
Quote: Originally posted by IgnorantBliss
Thank you, this extremely helpful! For some reason with this particular object, which is a wall shelf cloned from The Immaculate, the meshes link doesn't show anywhere else but with the low detail LOD. Is it perhaps because all the LODs are the same in this case? It's such a low detail mesh to begin with that I imported the same version for all three detail levels, as had Maxis done.

And thank you for your awesome, detailed tutorials!

Edited to add: Actually this seems to be the case with every wall shelf from the base game, that the link to edit meshes is only with the lowest detail LOD. And this is whether the same detail mesh is used for all of them or not.
The way EA has object .packages structured the Model resource always contains the lowest LOD (at least for all the objects I've seen so far) while the others are in the LOD resource. The table I cloned had only a single LOD so it was in the Model. The Immaculate has 3 LODs as you say. It then has 2 LODs, one for the high and one for the medium LODs, and the Model which contains the lowest LOD. It also has 3 shadow LOD groups which you can ignore for your purpose here. Those always have a Group number beginning with 0001 so it's easy to pick them out. Below the LODs and Model you need are indicated in black while the shadow lods are indicated by red:



Each of the LOD resources also has access to the Material Variant.

eta: correct link for picture
Part-time Hermit
#24 Old 22nd Apr 2015 at 6:00 AM
Thank you, I'm grateful for the clarification! I think I can reference the textures via Studio now .
Part-time Hermit
#25 Old 22nd Apr 2015 at 3:58 PM
OMG, it finally works! Some of the entry names on the lists were different from the example, but I was eventually able to figure out where the Diffuse Map references were. The next time referencing textures is going to be signifigantly less painful. I can't thank you enough!
Page 1 of 2
Back to top