User Tools

Site Tools


02_user_tutorials:30_additional_interfaces:headless:01_startup-headless-model

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
02_user_tutorials:30_additional_interfaces:headless:01_startup-headless-model [2025/12/10 13:14] – removed - external edit (Unknown date) 127.0.0.102_user_tutorials:30_additional_interfaces:headless:01_startup-headless-model [2025/12/10 13:14] (current) – ↷ Page moved from 02_new_tutorials:30_additional_interfaces:headless:01_startup-headless-model to 02_user_tutorials:30_additional_interfaces:headless:01_startup-headless-model gaetan
Line 1: Line 1:
 +{{howhard>2}}
 +====== Headless in GroIMP ======
  
 +Find more information on the Headless implementation and functions [[01_user_documentation:10_additional_interfaces:headless|here]].
 +
 +===== Download example =====
 +
 +You can find an example 
 +[[https://wwwuser.gwdg.de/~groimp/grogra.de/gallery/Technics/renderHeadlessDemo.html|here]].
 +
 +Download the example project and run in with ''java -Xverify:none -jar core.jar --headless PATH/TO/THE/MODEL.gsz''.
 +The model will run in background, grow few steps of the plant model, and export several views for each step.
 +
 +
 +===== Create the model =====
 +
 +You can create the default RGG model from the GroIMP ''file> new> new RGG project''
 +You then need to add some methods in the model that will be called by GroIMP.
 +The ''startup()'' method is called when the project is open. We use it to call the ''runLater(Object)'' methods where the actual code is going to be processed. 
 +
 +<code java>
 +protected void startup()
 +{
 + super.startup();
 + if (de.grogra.pf.boot.Main.getProperty("headless") != null)
 + {
 + runLater(null);
 + }
 +}
 +
 +
 +protected void run(Object info)
 +{
 + // Stuff to do...
 + closeWorkbench();
 +}
 +</code>
 +
 +
 +==== Run headless ====
 +
 +Save the model, then run it with the command: ''java -jar core.jar --headless PATH/TO/THE/MODEL.gsz''.