Skip to content

'pysplishsplash.Exec.SimulatorBase' object has no attribute 'getScene' #188

Answered by janbender
chunleili asked this question in Q&A
Discussion options

You must be logged in to vote

getScene is not a function of base. The correct code should look like this:

import pysplishsplash
import pysplishsplash.Utilities.SceneLoaderStructs as Scene

def main():
    base = pysplishsplash.Exec.SimulatorBase()
    args = base.init()
    gui = pysplishsplash.GUI.Simulator_GUI_imgui(base)
    base.setGui(gui)
    scene = pysplishsplash.Exec.SceneConfiguration.getCurrent().getScene()
    scene.fluidBlocks.append(Scene.FluidBlock(id='Fluid', box=Scene.Box([0.0, 0.0, 0.0], [1.0, 1.0, 1.0]), mode=0, initialVelocity=[0.0, 0.0, 0.0]))
    base.run()

if __name__ == "__main__":
    main()

Also take a look at the example: complex_scene.py

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@chunleili
Comment options

@BoyuanTang331
Comment options

@BoyuanTang331
Comment options

@janbender
Comment options

Answer selected by chunleili
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #186 on June 17, 2022 06:43.