Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 261 times and has 3 replies Next Thread
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Using textures from default catalog after export import

How can I reference a texture from the default catalog after export/import of furniture?

When you export an object that uses a texture from the default catalog that texture is exported along with the object as a separate image file. No problem with that but when I import again the object uses the newly created texture file while that same texture could probably be more efficiently retrieved from the default catalog.

When I have a series of custom created objects that all use the same texture it adds up when each has to load and process their own copy of the texture while they could all have retrieved it from the default catalog. All objects are in a Furniture Libraries so having to use that is no problem. It's also no problem if I have to edit the library or MTL files manually.

Questions:
1. Is there a way to set this?
2. Does it really matter for efficency, especially with a lot of objects using the same textures?
3. Alternatively, is there a way to set all objects to use one single texture that is not from the default catalog instead of each using their own copy and would that increase load/display efficiency? (Like having a default set of textures for the project.)

I do understand the problem if a user has changed the default catalog and removed the texture but I consider that a problem for that user if it increases effiency significantly.
[Mar 7, 2024, 10:38:13 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9181
Status: Offline
Reply to this Post  Reply with Quote 
Re: Using textures from default catalog after export import

All texture images are unique in memory and when two files contain the same image, only one instance of the image is kept. It's easy to experience: apply a texture on an object, export it to OBJ format and quit the program. Then relaunch Sweet Home 3D, apply the same texture on an object in a new home, import the previously exported OBJ file, select the two objects, export them to OBJ format and you'll see that the exported files contain only one image.

It would be also nice to avoid multiple files containing the same image, but if it happens one day, it will probably only whithin a SH3F library file if multiple models it contains reference the same texture. It won't happen in a SH3D file which shall not depend on a given catalog for better portability, even if the model, icon and image attributes of its Home.xml entry may cite URLs instead of files within the SH3D file.
This is how 3D models and images are referenced in home data managed by the Online version to reduce the space on the server. But I prefer not to use this behavior in files saved by Sweet Home 3D installer version, again for portability reasons which shouldn't be an option.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 7, 2024, 7:09:57 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Re: Using textures from default catalog after export import

Thank you for the quick response.

If I understand this correctly:

1. Using the same texture for multiple objects is more efficient since only one image is kept in memory independent of the number of objects that use that texture.

2. Independent of the name of the texture file, identical texture images are recognized and only one copy is loaded in memory. In other words: different filenames in the MTL file map_Kd make no difference, the image is still recognized as one that is already in memory?

3. When opening a project every object texture (map_Kd) must still be read to see if there is already a copy in memory. Correct?
(This is where a reference to a catalog texture could be beneficial for efficiency and is how the online version works.)

It seems to me that I do save in memory usage with identical objects and textures but nothing in processing efficiency. Correct?

What if....
Objects and textures from the default catalogs (Furniture.jar & Textures.jar?) are added once and consecutive instances reference the objectID/textureID. If I added my custom objects and textures to those default catalogs will they work the same? Would that increase processing efficiency and most important, display speed in the htmlviewer?


After studying another home.xml file it looks like a reference is already used if you add the same object from a (custom) library.
Does this mean that the same object&texture in memory is used when the same ID is encountered when processing the .sh3d file?
----------------------------------------
[Edit 1 times, last edit by Keet at Mar 8, 2024, 7:23:15 AM]
[Mar 7, 2024, 9:18:20 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9181
Status: Offline
Reply to this Post  Reply with Quote 
Re: Using textures from default catalog after export import

A 3D model or texture with the same ID as an other 3D model or texture is ignored when libraries are loaded. IDs are not used elsewhere in the desktop version.
Hope this answered your question...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Mar 11, 2024, 1:51:33 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved