Developing a SketchUp Importer

Hi, everyone.  I'm new here, so please bear with me as I try to get my bearings.

I come here from the Trainz Railroad Simulator world, where I am the author of several software tools that community members have found useful over the past several years.  One of these is a plugin for SketchUp that allows models to be easily ported into the Trainz environment with just a few mouse clicks.  This tool works by creating an XML file that is then passed to a Trainz import utility, which in turn creates the necessary Trainz-format geometry files.  My plugin also creates all the other files needed by Trainz (configuration and so on).  After exporting from SketchUp, the user switches to Trainz Content Manager and imports the generated files directly, where they become immediately usable in the Trainz world-building application.  The models that transfer into Trainz are very high-fidelity and carry all the original textures, transparencies, and so on.

I am interested in doing something similar for Daz.  To that end I am considering writing a script in Daz that will read the XML files produced by my SketchUp Ruby plugin, and render the geometry and materials directly in Daz, after which they could be saved in a native Daz format and become useful in that environment.  I found the geometry pipeline example, which seems to show most of the functionality needed to do this, but I am having a hard time with what seems to be a lack of comprehensive documentation for Daz scripting.  I have consulted the Scripting API web pages, but have also found that many of the functions used in the pipeline example do not appear to be documented at all.

I am a professsional software engineer by trade, 33 years in the business, so writing the code is not the issue.  What I would kindly request is some pointers to places where I can find more information related to what I am trying to accomplish, and/or some script examples that might send me in the right direction.

Any help would be appreciated, and of course comments on the idea of a SketchUp-to-Daz pipeline are welcome.

Thanks for your attention.  If anyone would like to see what I've been able to accomplish for Trainz, please feel free to visit the relevant page of my web site at http://www.dhobh.net/trainz/GoogleSketchUp/RubyTMIX.htm.

Regards,
Mike

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,842
    edited May 2017

    The old DS3 scripting docs are still a useful reference for the basics http://docs.daz3d.com/doku.php/public/software/dazstudio/3/start The scrpting forum is also a good resource https://www.daz3d.com/forums/categories/daz-script-developer-discussion

    Post edited by Richard Haseltine on
  • ModelerMJModelerMJ Posts: 41

    Thank you.  I have the DS3 docs but the functions I am interested in appear to be no longer valid in DS4.9.  Specifically I'm looking for documentation about DzFacetMesh, DzFacetShape, and related items; these do not appear the in Objects list in the current online Scripting help pages.

    I will copy my post to the Developer forum and see if I get any bites there.

    Regards,
    Mike

  • Richard HaseltineRichard Haseltine Posts: 100,842

    I was going to merge this with the other copy, but it may be better to edit this down to just the scripting questions (and bring in the specific areas you mention in your second post to the other thread.

  • ModelerMJModelerMJ Posts: 41
    edited May 2017

    @Richard, Thanks for the pointer.  I think that if I could just find some documentation about DzFacetMesh and associated elements it would help considerably.  I notice in the post you pointed me to that the OP there seems to have found this... any idea where?

    Regards,
    Mike

    UPDATE: I found the C++ SDK documentation and it appears to be substantially complete, in terms of listing all the functions and describing their methods and so on.  Based on a few code examples I have seen, I am assuming that Daz Script implements the same functionality, so perhaps this reference will give me the information I need to push ahead.

    Post edited by ModelerMJ on
  • ModelerMJModelerMJ Posts: 41
    edited May 2017

    Post deleted, duplicate information.

    Post edited by ModelerMJ on
  • Richard HaseltineRichard Haseltine Posts: 100,842
    edited May 2017

    I've moved the comments on development from your other thread to this one.

    The SDK classes and script objects soemtimes match and sometimes don't. One way to get a quick list of what methods and members are in the DS version is via something like:

    var n;for ( n in DzFacetMesh )  {	print ( n ) ;}

     

    Post edited by Richard Haseltine on
  • ModelerMJModelerMJ Posts: 41

    Cool, thanks, I will use that.

    Regards,
    Mike

  • ModelerMJModelerMJ Posts: 41

    UPDATE:

    A progress report has been posted in The Commons at https://www.daz3d.com/forums/discussion/169576/sketchup-importer-early-progress-report

    Comments are welcome (moderators, please let me know if I should be posting this kind of thing here instead - thanks).

    Regards,
    Mike

Sign In or Register to comment.