Control Enscape through Ruby

  • Hi!

    I wanted to know if there was a way to control Enscape through Ruby? I didn't find any mention of that.

    I think it would be nice to at least allow the export of current view through ruby. I find the batch render limited, and not fitting some of my office project requirements (file naming + file format).

    I could easily make it work for us if I could ask Enscape to export the current view at a given location, with the given file format.


  • Voulz , I'm afraid, at the moment there is no ruby support for this specific procedure. I can forward it for you as a feature request, but you can also let me know what you'd like to see improved when it comes to our batch rendering specifically, then I can also forward that too. :)

  • Hi Demian Gutberlet , thank you for getting back to me.

    I think it would generally be great to let us use the basic features through scripting as it can help automate things on our sides and make our lives easier, so forwarding it as a feature request would be great.

    Our 2 main issues with Batch Rendering are the file format and the naming.

    • When working with clients, we have sometimes to prepare many images to discuss options for example, so we prefer exporting as jpg for smaller file sizes. This is available through the screenshot hot key but not through the batch export.
    • For the file naming, this would depend a lot on file setup and individual preferences, but at least letting us name it with a constant name and the name of the current view would be great.
      Ex: I would be able to type somewhere "Current Option_%CURRENTSCENENAME%_2020_06_01.jpg", then the batch exporter would export each selected scene, replacing %CURRENTSCENENAME% with the name of the current view, like "Current Option_Scene1_2020_06_01.jpg"


    For the sake of your understanding, I'll also try to explain our typical case here. It would be great if an update could help achieve this in the future, but it might be really specific to the way we work, so implementing what I talked about before would probably be enough.

    In our Sketchup Files, we have:
    - View Scenes (scenes only saving camera position, maybe section planes, hidden geometry). ex: View 1, View 2, View 3
    - Setup Scenes (scenes only saving common settings like the shadow settings, usually excluded from animation). ex: Morning, Noon, Sunset
    - Design Options (Layers holding one design option). Our project might have 10 layers + 5 layers named "Option 1", "Option 1b", "Option 2", "Option 3"
    So what we were trying to achieve through Ruby was to let the user:
    - select the View Scenes to export from a list (similar to the batch render ),
    - but also select one or many (or none) Setup Scene (in our case, setting up the shadows). The script, when launched, would first go to the first Setup Scene selected (to set the right shadow settings), then loop through the selected Views and export them, then go through the next Setup Scene and so on.
    This would export View 1 to 3 with Morning Sun, then View 1 to 3 with Noon Sun, etc.
    - finally, allowing the user to select one or many (or none) Design Option. Before exporting, the script would turn all the Selected Design Option Layers off, then turn the first one on, export, turn it off, turn the second one on export, etc.
    This would export Option 1 to 3, with the View 1 with Morning Sun, then Option 1 to 3, with the View 2 with Morning Sun, etc.

    in pseudo code, that would look something like this:

    2. activate SCENE #sets the shadow settings, do not export yet
    3. for each VIEW in SELECTED_VIEW_SCENES:
    4. activate VIEW #sets the camera settings
    6. turn OFF all layers in SELECTED_DESIGN_OPTIONS
    7. turn LAYER_OPTION ON
    8. export with given name and file format (ex: "Project_%VIEW%_%LAYER_OPTION%_%SCENE%.jpg")


    Anyway, my reply ended up way longer than expected (sorry for that). Feel free to not bother about our specific case, but at least allowing file format + custom export name in the batch render would be great, allowing to export through Ruby would be awesome.

    Thank you for your time!

  • +1

    There is currently ruby being used by Enscape for Sketchup which a skilled scripter could make use of. It would be great if we could at least get a rough list of current methods, etc. In some cases what is currently exposed would be useful.

    I will also add... I have continued to evaulate other rendering options mainly because of the lack of interest in user customization, community development, scripting, etc. There is no way for the Enscape team to anticipate or respond to all needs. The Sketchup scripting community is a perfect example of that process. They are what make Sketchup a great tool to use and would greatly improve usability for Enscape if encouraged.