princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.32k stars 455 forks source link

how to use the generated_surface_scripts.py? #103

Closed chongxian closed 1 year ago

chongxian commented 1 year ago

Hello, I have an problem about the node_transpiler,when I create a blend file only include geometry node, and I use the dev_script.py to convert node-graphs to python code, but noly get the generated_surface_scripts.py file. how to use the generated_surface_scripts.py and get some information like Figure.3 in your paper(eg. has some parameters like desinty?), could your kindly to teach me? image image

araistrick commented 1 year ago

Hello,

To get randomized values included in the Python code, you can give any Value node an annotated name like 'Density ~ U(5,20)' and a corresponding np.random call should appear in the Python. It won't be quite the format shown - the code in the figure is somewhat compacted and illustrative.

If you want to run the genwrated_surface_script.py, just open it up in the blender scripting panel, select some object (like the default cube etc) to apply the geonodes ontop of, then click play to run the script in the UI. Or, you can look at some of our code examples like flower.py or simple_greenery.py to see what it looks like running headless