@@ -333,7 +333,7 @@ def add_entity(
333333 if surface .vis_mode is None :
334334 surface .vis_mode = "visual"
335335
336- if surface .vis_mode not in [ "visual" , "collision" , "sdf" ] :
336+ if surface .vis_mode not in ( "visual" , "collision" , "sdf" ) :
337337 gs .raise_exception (
338338 f"Unsupported `surface.vis_mode` for material { material } : '{ surface .vis_mode } '. Expected one of: ['visual', 'collision', 'sdf']."
339339 )
@@ -352,7 +352,7 @@ def add_entity(
352352 if surface .vis_mode is None :
353353 surface .vis_mode = "particle"
354354
355- if surface .vis_mode not in [ "particle" , "recon" ] :
355+ if surface .vis_mode not in ( "particle" , "recon" ) :
356356 gs .raise_exception (
357357 f"Unsupported `surface.vis_mode` for material { material } : '{ surface .vis_mode } '. Expected one of: ['particle', 'recon']."
358358 )
@@ -370,7 +370,7 @@ def add_entity(
370370 if surface .vis_mode is None :
371371 surface .vis_mode = "visual"
372372
373- if surface .vis_mode not in [ "visual" , "particle" , "recon" ] :
373+ if surface .vis_mode not in ( "visual" , "particle" , "recon" ) :
374374 gs .raise_exception (
375375 f"Unsupported `surface.vis_mode` for material { material } : '{ surface .vis_mode } '. Expected one of: ['visual', 'particle', 'recon']."
376376 )
@@ -612,11 +612,13 @@ def add_emitter(
612612 Parameters
613613 ----------
614614 material : gs.materials.Material
615- The material of the fluid to be emitted. Must be an instance of `gs.materials.MPM.Base` or `gs.materials.SPH.Base`.
615+ The material of the fluid to be emitted. Must be an instance of `gs.materials.MPM.Base`,
616+ `gs.materials.SPH.Base`, `gs.materials.PBD.Particle` or `gs.materials.PBD.Liquid`.
616617 max_particles : int
617- The maximum number of particles that can be emitted by the emitter. Particles will be recycled once this limit is reached.
618+ The maximum number of particles that can be emitted by the emitter. Particles will be recycled once this
619+ limit is reached.
618620 surface : gs.surfaces.Surface | None, optional
619- The surface of the emitter. If None, use `` gs.surfaces.Default(color=(0.6, 0.8, 1.0, 1.0))` `.
621+ The surface of the emitter. If None, use `gs.surfaces.Default(color=(0.6, 0.8, 1.0, 1.0))`.
620622
621623 Returns
622624 -------
@@ -631,12 +633,18 @@ def add_emitter(
631633 material , (gs .materials .MPM .Base , gs .materials .SPH .Base , gs .materials .PBD .Particle , gs .materials .PBD .Liquid )
632634 ):
633635 gs .raise_exception (
634- "Non-supported material for emitter. Supported materials are: `gs.materials.MPM.Base`, `gs.materials.SPH.Base`, `gs.materials.PBD.Particle`, `gs.materials.PBD.Liquid`."
636+ "Non-supported material for emitter. Supported materials are: `gs.materials.MPM.Base`, "
637+ "`gs.materials.SPH.Base`, `gs.materials.PBD.Particle`, `gs.materials.PBD.Liquid`."
635638 )
636639
637640 if surface is None :
638641 surface = gs .surfaces .Default (color = (0.6 , 0.8 , 1.0 , 1.0 ))
639642
643+ if surface .vis_mode is None :
644+ surface .vis_mode = "particle"
645+ if surface .vis_mode == "visual" :
646+ gs .raise_exception ("surface.vis_mode='visual' is not supported for fluid emitters." )
647+
640648 emitter = Emitter (max_particles )
641649 entity = self .add_entity (
642650 morph = gs .morphs .Nowhere (n_particles = max_particles ),
0 commit comments