Page 1 of 1

change particle set based on bounce

PostPosted: Wed Feb 15, 2017 3:36 pm
by Scott Turner
is it possible? my particle bounces and i pump it into Pchangestyle or Pspawn which recognizes the recent bounce event? or anything like that

Re: change particle set based on bounce

PostPosted: Wed Feb 15, 2017 7:46 pm
by Okke Verbart
Hey Scott - depending on the complexity of your needs, you may be able to get away with just using the same region for both the pbounce and pChangeStyle. I made a quick comp illustrating it below. In essence, just an emitter followed by a pChangestyle set to change the style when intersecting with a region: I then set the region to mesh and I fed a 3dshape into that. I then followed this by a pBounce node and got it to bounce based on the same 3dshape (i.e. set to mesh and feeding the same 3dshape into it).

As you can see in the example, it changes style (colour changes to red) when bouncing off the cube.

Code: Select all
{
   Tools = ordered() {
      Shape3D1 = Shape3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = 1.49266748157668, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 1.08453606290421, },
            ["Transform3DOp.Translate.Z"] = Input { Value = -0.0459958944711915, },
            Shape = Input { Value = FuID { "SurfaceCubeInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 3, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            ["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 4, }
         },
         ViewInfo = OperatorInfo { Pos = { 435, 37 } },
      },
      pBounce1 = pBounce {
         ID = 21,
         CtrlWZoom = false,
         Inputs = {
            Input = Input {
               SourceOp = "pChangeStyle1",
               Source = "Output",
            },
            Region = Input { Value = FuID { "MeshRegion" }, },
            ["MeshRegion.MeshInput"] = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 514, 179 } },
      },
      pRender1 = pRender {
         Inputs = {
            ["_MotionBlurWarning"] = Input { Disabled = true, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            OutputMode = Input { Disabled = true, },
            IntegrationMethod = Input { Value = FuID { "RK4" }, },
            ["MaterialID.MaterialID"] = Input { Value = 2, },
            ["ObjectID.ObjectID"] = Input { Value = 2, },
            Input = Input {
               SourceOp = "pBounce1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 729, 176 } },
      },
      pChangeStyle1 = pChangeStyle {
         ID = 24,
         Inputs = {
            NewSet1 = Input { Value = -1, },
            NewSet2 = Input { Value = -1, },
            NewSet3 = Input { Value = -1, },
            NewSet4 = Input { Value = -1, },
            NewSet5 = Input { Value = -1, },
            NewSet6 = Input { Value = -1, },
            NewSet7 = Input { Value = -1, },
            NewSet8 = Input { Value = -1, },
            NewSet9 = Input { Value = -1, },
            NewSet10 = Input { Value = -1, },
            NewSet11 = Input { Value = -1, },
            NewSet12 = Input { Value = -1, },
            NewSet13 = Input { Value = -1, },
            NewSet14 = Input { Value = -1, },
            NewSet15 = Input { Value = -1, },
            NewSet16 = Input { Value = -1, },
            NewSet17 = Input { Value = -1, },
            NewSet18 = Input { Value = -1, },
            NewSet19 = Input { Value = -1, },
            NewSet20 = Input { Value = -1, },
            NewSet21 = Input { Value = -1, },
            NewSet22 = Input { Value = -1, },
            NewSet23 = Input { Value = -1, },
            NewSet24 = Input { Value = -1, },
            NewSet25 = Input { Value = -1, },
            NewSet26 = Input { Value = -1, },
            NewSet27 = Input { Value = -1, },
            NewSet28 = Input { Value = -1, },
            NewSet29 = Input { Value = -1, },
            NewSet30 = Input { Value = -1, },
            NewSet31 = Input { Value = -1, },
            NewSet32 = Input { Value = -1, },
            Input = Input {
               SourceOp = "pEmitter1",
               Source = "Output",
            },
            RegionMode = Input { Value = FuID { "Intersecting" }, },
            Region = Input { Value = FuID { "MeshRegion" }, },
            ["ParticleStyle.ColorControls"] = Input { Value = 1, },
            ["ParticleStyle.Green"] = Input { Value = 0, },
            ["ParticleStyle.Blue"] = Input { Value = 0, },
            ["ParticleStyle.ColorOverLife"] = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 1, 1, 1 }
                  }
               },
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pChangeStyle1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pChangeStyle1BluroverLife2D",
               Source = "Value",
            },
            ["MeshRegion.MeshInput"] = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 320, 181 } },
      },
      pChangeStyle1SizeoverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pChangeStyle1BluroverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      pEmitter1 = pEmitter {
         ID = 17,
         Inputs = {
            Lifespan = Input { Value = 1000, },
            VelocityControls = Input { Value = 1, },
            Velocity = Input { Value = 1, },
            Angle = Input { Value = 49.0140845, },
            ["ParticleStyle.ColorOverLife"] = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 1, 1, 1 }
                  }
               },
            },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pEmitter1SizeoverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pEmitter1BluroverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 176, 181 } },
      },
      pEmitter1SizeoverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 0 },
         NameSet = true,
      },
      pEmitter1BluroverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 0 },
         NameSet = true,
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "pRender1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 983, 188 } },
      }
   }
}

Re: change particle set based on bounce

PostPosted: Wed Feb 15, 2017 10:24 pm
by Scott Turner
..thats a great solution i guess. i wasnt thinking of sharing mesh colliders ...doh i always link up the properties of the primitive collder shapes which is so time consuming and annoying. so this is WAY more workeable. cant help thinking it would be useful to have access to bounce events in the conditions tab though...