Skip to content

Commit 3c4d7f0

Browse files
authored
Fix particles (#16)
Fix particles showing under isosurface and resolve sim crashing with the particles.
1 parent 5e6ba4d commit 3c4d7f0

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

source/matterix/matterix/particle_systems/fluid_system.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
# Primvars / rendering
5858
PRIMVAR_DO_NOT_CAST_SHADOWS_NAME = "doNotCastShadows"
5959
PRIMVAR_DO_NOT_CAST_SHADOWS = True
60-
DEFAULT_INTERPOLATION = Usd.InterpolationTypeHeld
6160

6261
# Point instancer / particle flags
6362
ENABLE_SELF_COLLISION = True
@@ -174,8 +173,6 @@ def create(self, stage, scenePath: Sdf.Path, prim_path: str):
174173
PRIMVAR_DO_NOT_CAST_SHADOWS
175174
)
176175

177-
stage.SetInterpolationType(DEFAULT_INTERPOLATION)
178-
179176
# --- Particles grid & point instancer -----------------------------------
180177
self.particle_point_instancer_path = Sdf.Path(self.prim_path + "/particles")
181178

@@ -217,6 +214,7 @@ def create(self, stage, scenePath: Sdf.Path, prim_path: str):
217214
# Refresh handle and solver iterations
218215
self.instancer = UsdGeom.PointInstancer.Get(self.stage, self.particle_point_instancer_path)
219216
particle_system.CreateSolverPositionIterationCountAttr().Set(SOLVER_POSITION_ITERATION_COUNT)
217+
self.instancer.GetVisibilityAttr().Set("invisible")
220218

221219
# Optional: pause/resume to ensure transparent material visibility
222220
if PAUSE_RESUME_WORKAROUND:

source/matterix/matterix/particle_systems/powder_system.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
# Primvars / rendering
4949
PRIMVAR_DO_NOT_CAST_SHADOWS_NAME = "doNotCastShadows"
5050
PRIMVAR_DO_NOT_CAST_SHADOWS = True
51-
DEFAULT_INTERPOLATION = Usd.InterpolationTypeHeld
5251

5352
# Point instancer / particle flags
5453
ENABLE_SELF_COLLISION = True
@@ -152,8 +151,6 @@ def create(self, stage, scenePath: Sdf.Path, prim_path: str):
152151
PRIMVAR_DO_NOT_CAST_SHADOWS
153152
)
154153

155-
stage.SetInterpolationType(DEFAULT_INTERPOLATION)
156-
157154
# --- Particles grid & point instancer -----------------------------------
158155
self.particle_point_instancer_path = Sdf.Path(self.prim_path + "/particles")
159156

0 commit comments

Comments
 (0)