SketchUp Importer - Early Progress Report

ModelerMJModelerMJ Posts: 38
edited May 2017 in The Commons

Hello all,

I posted a little while ago about an idea I had for making a direct SketchUp-to-Daz transfer path, based on a set of tools I had previously implemented for the Trainz Railroad Simulator.  I am pleased to report that -- while I am by no means even close to being finished, and there is considerable work yet to be done -- I have made significant progress and it seems that this is going to be a viable project worth pursuing to the proper conclusion.

Here is a model from the SketchUp 3D Warehouse, displayed in SketchUp 2017 (free version).  It's the "Salty Dawg Saloon", the author is JCHarrist.

Here is the same model in Daz Studio.  It was exported from SketchUp using the Ruby plugin portion of my tool, then imported into Daz and reconstructed using a very early version of what will eventually be the Daz Script portion of my tool.

As you can see the model comes in already scaled properly -- note the human figure vs. the building (it looks correct to me, at least).

It took 27 seconds to export this model from SketchUp (screen snip from the export log created by the Ruby script).

It took less than 5 seconds to import it into Daz and reconstruct it (screen snip from the Daz Script output window).

So... the total transfer time for this model, direct from SketchUp to Daz Studio, was about 1 minute, including the time needed to switch between applications.  The PC used in this example is a Lenovo ThinkPad laptop running Windows 10 Pro 64-bit, with a Core-i7 at 2.5GHz, 16GB of memory and an SSD main drive.

As you can see, the model sems to have transferred with good fidelity (at least I think it looks acceptable so far).   I do realize that I still need to work on texture transparency; in Trainz we have the luxury of having the graphics engine create opacity maps automatically based on the alpha channel of the image, but in Daz it appears that I will need to generate true opacity maps as separate images.  For the moment, for my "does it even work at all" testing, I am simply using the same image as is used  for the texture, but will of course be pursuing the correct solution.

As I said: Lots more work to do, but it appears this is a feasible project worth pursuing.

Thanks for your attention... comments are welcome.

Regards,
Mike

Post edited by Chohole on
«1

Comments

  • CybersoxCybersox Posts: 6,064

    I'm really looking forward to seeing what comes of this.  There's an amazing variety of models already available for Sketch-up and, while they're not really detailed enough to use in closeups, it's one of the easier programs for creating unique background architecture.  As it is, though, the commercial version with all the export options is a bit too pricey so a simplified way to get those models into DAZ would be extremely useful. 

  • LIKLIK Posts: 103

    I'm really on interested in this when you have it done!!! ;-D

  • hacsarthacsart Posts: 1,079

    A very useful endeavour.. One thing I find is that a lot of Sketchup models have flipped normals (in Sketchup, swith the face view to monochrome, anyting that sgows as pale blue is flipped) Will your utility be able to handle ths? Nornally what I do, is flip the faces in Sketchup, then export as OBJ, Import the OBJ into Bryce, than export as a new oby and import into Daz.. That seems to work, save for the excessive scaling that importing from Bryce does..

  • Charlie JudgeCharlie Judge Posts: 7,442

    I'm really looking forward to seeing what comes of this.  There's an amazing variety of models already available for Sketch-up and, while they're not really detailed enough to use in closeups, it's one of the easier programs for creating unique background architecture.  As it is, though, the commercial version with all the export options is a bit too pricey so a simplified way to get those models into DAZ would be extremely useful. 

    I completely agree I am definitely interested in this.

    However, until a better option (such as your project) becomes available, I will point out that there are free Sketchup plugins for Sketchup anvailable to export the Sketchup models in obj format which can be imported into DAZ.

  • msam921msam921 Posts: 141

    This is looking great! I'm excited to see the finished product.

  • ModelerMJModelerMJ Posts: 38
    edited May 2017
    hacsart said:

    A very useful endeavour.. One thing I find is that a lot of Sketchup models have flipped normals (in Sketchup, swith the face view to monochrome, anyting that sgows as pale blue is flipped) Will your utility be able to handle ths? Nornally what I do, is flip the faces in Sketchup, then export as OBJ, Import the OBJ into Bryce, than export as a new oby and import into Daz.. That seems to work, save for the excessive scaling that importing from Bryce does..

    The Ruby plugin part of my tool looks at both front and back faces during export.  If a back face has a texture and the front does not, then it's assumed that this is an inside-out face, and the exporter auto-selects the back face.  Is that what you are asking?  The user does have control over this auto-selection algorithm, and can choose from several options for which geometry gets exported.

    In terms of scaling - as I noted above, my tool does translate SketchUp units (internally it uses inches) to CM as required by Daz, thus (hopefully) eliminating an additional step.

    HTH
    - Mike

    Post edited by ModelerMJ on
  • FSMCDesignsFSMCDesigns Posts: 7,532

    The scaling part I see as being very useful. You might want to include some kind of optimizer for the textures and/or mesh with the plugin as the majority of models in the warehouse use a ton of textures/are not UVMapped at all and are not properly modeled for other use. Looking forward to your progress.

  • hacsarthacsart Posts: 1,079

    yep.. thats the biggest issue I have with Sketchup models... Thanks

    ModelerMJ said:
    hacsart said:

    A very useful endeavour.. One thing I find is that a lot of Sketchup models have flipped normals (in Sketchup, swith the face view to monochrome, anyting that sgows as pale blue is flipped) Will your utility be able to handle ths? Nornally what I do, is flip the faces in Sketchup, then export as OBJ, Import the OBJ into Bryce, than export as a new oby and import into Daz.. That seems to work, save for the excessive scaling that importing from Bryce does..

    The Ruby plugin part of my tool looks at both front and back faces during export.  If a back face has a texture and the front does not, then it's assumed that this is an inside-out face, and the exporter auto-selects the back face.  Is that what you are asking?  The user does have control over this auto-selection algorithm, and can choose from several options for which geometry gets exported.

    In terms of scaling - as I noted above, my tool does translate SketchUp units (internally it uses inches) to CM as required by Daz, thus (hopefully) eliminating an additional step.

    HTH
    - Mike

     

  • ModelerMJModelerMJ Posts: 38
    edited May 2017

    The scaling part I see as being very useful. You might want to include some kind of optimizer for the textures and/or mesh with the plugin as the majority of models in the warehouse use a ton of textures/are not UVMapped at all and are not properly modeled for other use. Looking forward to your progress.

    The version of this tool for Trainz has about 5 years under its belt at this point, with almost 13,000 downloads so far, and I have indeed heard the same comments from my fellow Trainz community members.  After several attempts to automate the cleanup of SketchUp models, I finally concluded there was no single good way to do that which would suit everyone, and in the end I elected to simply transfer the models as they were, without any optimizations other than those that are standard for this type of work.  For example, my exporter can automatically eliminate unused faces; but you are right, there is no UV mapping and so textures are brought over in a fairly brute-force fashion.  If there are a lot of textures, and the creator used large images, then the model will be inefficient.  In fact the Salty Dawg Saloon is a terrible model - it has over 70 individual textures.  But it looks good; and if I want it (or something equally bad) for a backdrop in my scene, and am willing to take the performance hit in Daz, then I think that should be up to me.  By extension, I believe that same decision should apply to any potential user of this tool.

    Bottom line, my goal is simply to provide a means of transferrring data intact from one environment to the other, in a relatively fast and painless way, and leave the optimizing up to the user (and leave the arguments about the "goodness" or "badness" of SketchUp to others as well).  Hopefully that makes sense.

    Regards,
    Mike

     

    Post edited by ModelerMJ on
  • FSMCDesignsFSMCDesigns Posts: 7,532
    ModelerMJ said:

    The scaling part I see as being very useful. You might want to include some kind of optimizer for the textures and/or mesh with the plugin as the majority of models in the warehouse use a ton of textures/are not UVMapped at all and are not properly modeled for other use. Looking forward to your progress.

    The version of this tool for Trainz has about 5 years under its belt at this point, with almost 13,000 downloads so far, and I have indeed heard the same comments from my fellow Trainz community members.  After several attempts to automate the cleanup of SketchUp models, I finally concluded there was no single good way to do that which would suit everyone, and in the end I elected to simply transfer the models as they were, without any optimizations other than those that are standard for this type of work.  For example, my exporter can automatically eliminate unused faces; but you are right, there is no UV mapping and so textures are brought over in a fairly brute-force fashion.  If there are a lot of textures, and the creator used large images, then the model will be inefficient.  In fact the Salty Dawg Saloon is a terrible model - it has over 70 individual textures.  But it looks good; and if I want it (or something equally bad) for a backdrop in my scene, and am willing to take the performance hit in Daz, then I think that should be up to me.  By extension, I believe that same decision should apply to any potential user of this tool.

    Bottom line, my goal is simply to provide a means of transferrring data intact from one environment to the other, in a relatively fast and painless way, and leave the optimizing up to the user (and leave the arguments about the "goodness" or "badness" of SketchUp to others as well).  Hopefully that makes sense.

    Regards,
    Mike

     

    valid points, I was just looking out for other DS users as many have no idea of efficient modeling or UVMappiing, or how bad warehouse models are compared to other, more standard models. i develop for the MS flightsim community and there there have been numeruos attempts at using sketchup warehouse models in that game also from users that had no modeling experience and ran into these same issues. In the past with DS, performance wasn't as much of an issue as it is now with IRAY and models could be used that incorportaed inefficient modeling, but now vendors really should be looking at DS design the same way game develpers do with resources and performance in mind, but we are a long way off from that still.

    Thanks for the hard work on the plugin, looking forward to it.

  • ModelerMJModelerMJ Posts: 38
    edited May 2017

    FSMC, thanks for the feedback.  Sounds like this would be a good topic to include in the documentation when I get to that point.  Perhaps some pointers to "best practices" that are readily available as e.g. YouTube tutorials?  It is certainly possible to create effiicent models in SketchUp if you follow the rules.

    At the end of the export process my tool shows a summary that includes a polygon count.  Somewhere in my Googling I ran across polygon count recommendations for various object types in Daz; perhaps I can add some kind of check/warning about excessive polygon counts (if I can find those recommendations again).  In Trainz there is also a "polygon equivalent load" for each texture (about 300 polys, IIRC), that is also taken into account in determining the overall model load -- is there an equivalent in Daz?

    Regards,
    Mike

    Post edited by ModelerMJ on
  • ModelerMJModelerMJ Posts: 38
    edited July 2017

    UPDATE 22-MAY-2017

    Now with proper opacity maps applied.  Total conversion time still < 1 minute.

    Regards,
    Mike

    Post edited by Chohole on
  • RAMWolffRAMWolff Posts: 9,080

    What an awesome endeavor.  I hope it comes fully to fruition.  While I don't use Sketch UP I may pick this up in case that day ever comes.  I do have Sketch UP in my arsenal but too busy with more organic 3D projects currently. 

  • magnumdazmagnumdaz Posts: 261

    Cant wait! thank you for this!

  • ModelerMJModelerMJ Posts: 38
    edited May 2017

    UPDATE 23-MAY-2017

    Corrected an issue that was preventing the model from rendering properly; it looked great after initial import but, when rendered, it came out as a white blob.  This also occurred when saving the scene (to .DUF) and reloading it.  Turns out I was using the wrong function to apply the texture to the material used on the various faces; chalk it up to the learning curve.

    Using the correct function, I can now render the model successfully.  This render took about 29 minutes on my remarkably unremarkable laptop; I suspect it will go much faster on a machine with proper hardware, although the laptop does seem to support IRay.

    Next step is to develop the Daz-Script UI.

    Regards,
    Mike

    Post edited by ModelerMJ on
  • msam921msam921 Posts: 141

    I'm salivating over here.

  • ModelerMJModelerMJ Posts: 38
    edited May 2017

    (post removed by OP)

    Post edited by ModelerMJ on
  • MadbatMadbat Posts: 356

    Oh this looks tasty! If you need a tester at some point, I'll volunteer.

     

  • tj_1ca9500btj_1ca9500b Posts: 1,305

    Keep up the good work!

    Since you mentioned working with Trainz, I figured you'd appreciate this article.  It's a recent article about UP's 4-8-8-4 restoration.  Their goal is to get the Big Boy running again by 2019.

    http://cowcatchermagazine.com/union-pacific-big-boy-no-4014-restoration-coming-along-one-bolt-at-a-time-on-pace-for-2019-debut/

    Here's a pic of #4014 as she was being relocated from Pomona to Cheyenne a couple of years back.

    I look forward to seeing her function under her own power again!

    I'd love to see a Daz Studio version of the Big Boy...

  • ModelerMJModelerMJ Posts: 38
    edited May 2017

    This is the UI for the Daz portion of the SketchUp importer.

    A tip of the hat goes out to 'mCasual' whose great variety of scripts are an absolute gold mine in terms of learning how to do things in Daz Sudio.

    In the 'Import Model from Folder' section you can manually browse to the location to which you exported your model in SketchUp.  This is generally predeterrmined by the Ruby part of my tool based on the location of your SketchUp model (the SKP file); one of the requirements of my tool is that each model you want to export must be in a folder by itself.  You can also use 'Find Most Recent Export' to auto-detect the location of the data from the most recent run of the Ruby portion of the tool.

    The other options should be self-explanatory.  I expect that this dialog will have more things added to it when testing begins with users who are experienced in Daz.

    Comments welcome.

    The importer is essentially operational at this point.  I am now in the internal acid-testing / clean-up phase, and will be getting started on the documentation soon; typically I provide a PDF User's Guide as part of the download.  When these chores are done I will be looking for 3 or 4 beta testers.

    Regards,
    Mike

    Post edited by ModelerMJ on
  • ModelerMJModelerMJ Posts: 38
    edited July 2017

    It's not a UP Big-Boy, but it is a steam locomotive.  This is a UK 'Mallard' type.  Classic SketchUp... 298,000 polygons (does that qualify as an acid test?)

    Regards,
    Mike

    Post edited by Chohole on
  • ArtbyphilArtbyphil Posts: 87

    Looks good.  would be really useful.

  • How's this project coming along?

  • ModelerMJModelerMJ Posts: 38

    Still in process.  I've been traveling a lot for work lately and haven't had much time to devote to this, but I hope to get back to it soon.  I just need a solid chunk of time to be able to make my way through the process of getting it released on the Daz Store.

    Regards,
    - Mike

  • GreymomGreymom Posts: 683
    ModelerMJ said:

    Still in process.  I've been traveling a lot for work lately and haven't had much time to devote to this, but I hope to get back to it soon.  I just need a solid chunk of time to be able to make my way through the process of getting it released on the Daz Store.

    Regards,
    - Mike

    This will be awesome!   My attempts to import Sketchup models, either by some of the "tricks" people have suggested, or via the collada versions of the files, have resulted in strange but amusing results.  Flipped normals and the like, I guess.

     

  • hacsarthacsart Posts: 1,079

    Well. I do a lot of Sketchup imports , mostly for my automotive renders.. a lot get rejected as they don;t import properly no matter what I do.. Would be happy to apply as a tester, and being retried, I have tons of time...

    ModelerMJ said:

    This is the UI for the Daz portion of the SketchUp importer.

    A tip of the hat goes out to 'mCasual' whose great variety of scripts are an absolute gold mine in terms of learning how to do things in Daz Sudio.

    In the 'Import Model from Folder' section you can manually browse to the location to which you exported your model in SketchUp.  This is generally predeterrmined by the Ruby part of my tool based on the location of your SketchUp model (the SKP file); one of the requirements of my tool is that each model you want to export must be in a folder by itself.  You can also use 'Find Most Recent Export' to auto-detect the location of the data from the most recent run of the Ruby portion of the tool.

    The other options should be self-explanatory.  I expect that this dialog will have more things added to it when testing begins with users who are experienced in Daz.

    Comments welcome.

    The importer is essentially operational at this point.  I am now in the internal acid-testing / clean-up phase, and will be getting started on the documentation soon; typically I provide a PDF User's Guide as part of the download.  When these chores are done I will be looking for 3 or 4 beta testers.

    Regards,
    Mike

     

    ModelerMJ said:

    This is the UI for the Daz portion of the SketchUp importer.

    A tip of the hat goes out to 'mCasual' whose great variety of scripts are an absolute gold mine in terms of learning how to do things in Daz Sudio.

    In the 'Import Model from Folder' section you can manually browse to the location to which you exported your model in SketchUp.  This is generally predeterrmined by the Ruby part of my tool based on the location of your SketchUp model (the SKP file); one of the requirements of my tool is that each model you want to export must be in a folder by itself.  You can also use 'Find Most Recent Export' to auto-detect the location of the data from the most recent run of the Ruby portion of the tool.

    The other options should be self-explanatory.  I expect that this dialog will have more things added to it when testing begins with users who are experienced in Daz.

    Comments welcome.

    The importer is essentially operational at this point.  I am now in the internal acid-testing / clean-up phase, and will be getting started on the documentation soon; typically I provide a PDF User's Guide as part of the download.  When these chores are done I will be looking for 3 or 4 beta testers.

    Regards,
    Mike

     

  • JeremyDJeremyD Posts: 229

    Oh my god, I need this in my life. I enjoy using Sketchup for its simplicity and it also has a pretty good library of stuff.

     

  • hacsarthacsart Posts: 1,079

    I used that model in one of my renders - took a lot of tweaking to get it to work, and having your importer would have greatly helped...

     

    ModelerMJ said:

    It's not a UP Big-Boy, but it is a steam locomotive.  This is a UK 'Mallard' type.  Classic SketchUp... 298,000 polygons (does that qualify as an acid test?)

     

    Regards,
    Mike

     

  • kyoto kidkyoto kid Posts: 30,424

    ...there are a number of "real world" structures in the warehouse that I would love to use.  This would be great,

  • I sure hope the OP's project works out as it would make life SO much easier. I use SketchUp Pro 2016 a lot to make my own architectural models and to take advantage of the resources availble at 3D warehouse. Right now the workflow goes  from SketchUP through Cinema 4D and is quite tedious and time consuming. I don't render my scenes in DS as I just make references for 2D artwork, so at least I have no worries about lights and textures. But it can take hours just to get a model of a simple garden shed to work well enough in DS to use as a drawing reference.
     

Sign In or Register to comment.