Enscape open API

REMINDER! If you encounter any issues with Enscape (e.g. crashes, installation problems) or your subscription please reach out to our dedicated support team directly through the Help Center or by using the Support button as detailed HERE! Thank you for your understanding.
  • +1

    Sería genial poder programar desde dinamo o paiton y usar Enscape. Logré hacer un video animado con movimiento de los objetos. Pero tuve que renderizar una por una las imágenes en el Enscape. Si se pudiera llamar al Enscape con un comando podría hacer un simple programa de animación en Revit sin demasiado esfuerzo. Básicamente lo que hice fue colocar una variable tiempo en los objetos y luego cada uno hacia algo. Se movía rotaba. Cada objeto tenía eso. Cambiaba la variable tiempo de 1 a 2. Y volvía a hacer otra imagen. Pero bueno era de 1 en 1. Algo muy denso.

  • Please this is very much needed. Here is an example of a script that i would like to be able to use:

    This code is written in Python and it would use the Enscape API to export views in Rhino with Enscape. The code defines a list of views to export, each view is a dictionary that contains the following information:

    • "name": the name of the view in Rhino.
    • "clip_plane": the name of the clipping plane to be used in the view.
    • "layer_state": the state of the layers in the main Rhino file, 1 for on, 0 for off.
    • "worksession_layer_state": the state of the layers in the worksession, 1 for on, 0 for off.
    • "file_name": the name of the file to be exported.

    Then the code starts a session of Enscape using the enscape.Enscape() method, and loops through the views in the list of views to export. For each view, the script uses the following Enscape API methods:

    • session.set_view(view["name"]): sets the view in Enscape to the view specified in the "name" key of the view dictionary.
    • session.set_clipping_plane(view["clip_plane"]): sets the clipping plane in Enscape to the clipping plane specified in the "clip_plane" key of the view dictionary.
    • session.set_layer_state(view["layer_state"]): sets the state of the layers in the main Rhino file to the state specified in the "layer_state" key of the view dictionary.
    • session.set_worksession_layer_state(worksession, layer_state): sets the state of the layers in the worksession to the state specified in the "worksession_layer_state" key of the view dictionary.
    • session.screenshot(view["file_name"]): exports the current view to a file, the name of the file is specified in the "file_name" key of the view dictionary.

    Finally, the script closes the Enscape session using session.close() method.

    You can modify the list of views to export and the s

    • Official Post

    +1

    You can make your voice heard as well by submitting this as a request via our roadmap portal, just so you're aware. :)

  • For anyone interested and still waiting on a proper scripting capability from Enscape, I was able to devise a method to effectively dynamically select a different scripting path based on whatever conditions you may feel like testing.

    Enscape simple scripting (using config files) allows to load an external config file through the loadConfig() function. Leveraging that function, one can easily create a self loading config script that would recursively load itself. Loading that config file would effectively pause the scripting execution of Enscape. Any external managing code (e.g. C++, python, etc.) could then simply overwrite that pause script to load another config file of choice, based on its own dynamic conditional testing.

    I've tested this approach successfully by launching Enscape standalone executable, have it load a scene, perform some simple benchmarking then pause right after (simple pause.cfg that recursively loads itself indefinitely); driving app then parses the benchmarking results, generates a new config file to be executed next according to the results, then overwrites the pause cfg file to instead load that new script to be processed next.

    Hope this helps anyone while we all wait patiently for a proper scripting solution (e.g. python-based) :}...

  • Can you give a useful use case for this besides benchmarking?

    Automation in general would have many use cases (incl. benchmarking). Another example would be a user wanting to show a client w/ different interactive views of a project design, requiring them to load different scenes and/or camera paths in sequence. Without this, having to relaunch a different Enscape standalone executable is not the most efficient (sometimes takes longer to launch + init Enscape than the time it takes to render the whole animation sequence!). YMMV.

  • I used to be in the business of automating which is why im asking for clarification of what this potentially opens up to automate. Is this all viewing only or is there creation/render functionality?

    I've done this experiment exclusively for the standalone executable so in my case, yes, this would apply only to viewing use cases. Not sure if this may also be applicable to creation/render as well?