Features

Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Help  | 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: 2
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2462 times and has 1 reply Next Thread
mazoola
Advanced Member
Member's Avatar

USA
Joined: Mar 25, 2015
Post Count: 153
Status: Offline
Reply to this Post  Reply with Quote 
Import/Export issue #2

Emmanuel -

I knew I'd forgotten something! wink

When exporting a Lightwave model, under some circumstances SH3D will change texture files. Seemingly, this most often is in order to reduce image resolution, but I've also found instances where resolution was increased (unfortunately, not always very attractively).

For instance, the model on which I am presently working contains 7 texture image files, 4 of which are used as traditional, tiled textures, with the remaining 3 used as 'one-off' textures, mapped against an object component of the same size as the texture -- for instance, to represent a nameplate or control panel. Here are image resolutions as exported from Sketchup in Collada format (DAE) and as imported into SH3D from DAE and exported in Lightwave format (OBJ):

image file DAE OBJ
=================================================================
calibratedDialArt.png 706 x 706 512 x 512
castIron.jpg 256 x 256 256 x 256
emergencyStopDisk1.png 400 x 400 512 x 512
mirrorShiny.jpg 500 x 500 512 x 512
motor-control-fs.png 1328 x 697 1024 x 512
nickel.png 374 x 372 256 x 256
shiny2.jpg 500 x 500 n/a

Clearly, the export routine resizes images to the nearest factor of 256; unfortunately, it does so without regard for aspect ratio or image quality. In the example above, upscaling 'emergencyStopDisk1.png' from 400x400 to 512x512 introduced jaggies; downscaling 'calibratedDialArt.png' did the same. In the case of 'motor-control-fs.png', image resolution was reduced and image distortion introduced as the result of downscaling with aspect ratio change.

(Interestingly, I notice the application realized at some point the texture files for the 'mirrorShiny' and 'shiny2' textures were identical, exported only a single texture, and updated the .MTL file accordingly. In the final model, I edit the .OBJ file to append 'sweethome3d_window_mirror' to the name of all instances that use the 'mirrorShiny' texture.)

In a quick glance through OBJWriter.java, I don't see any explicit resizing of images, so I guess it might actually take place during import of the Collada object. (Actually, that might make more sense, as I've noted instances where replacing an imported texture with an identical texture -- that is, using the same image file -- within SH3D results in a different texture, possibly because the user can bypass resizing when importing textures individually.)

At the moment, I'm not sure how much of an issue this is, as I'm only now experimenting with workarounds. Both possible approaches seem to be moderate pains-in-the-cul: namely, replace exported texture files with appropriately named files at the correct resolution, or, if SH3D insists upon resizing textures during OBJ import, as well, replacing imported textures with ones imported directly into SH3D without resizing.

Thanks,
maz
[Jun 25, 2016 12:15:59 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
mazoola
Advanced Member
Member's Avatar

USA
Joined: Mar 25, 2015
Post Count: 153
Status: Offline
Reply to this Post  Reply with Quote 
Re: Import/Export issue #2

BTW, during my scan through OBJWriter.java, I couldn't find any obvious reason for the incorrect illumination model to be exported, as mentioned in my earlier thread.
[Jun 25, 2016 12:18:30 AM] 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-2017 eTeks - All rights reserved