Modifying ParticleSystem modules from NC

Forums 💬 NodeCanvas ⚙️ Support Modifying ParticleSystem modules from NC

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16939
    timv
    Participant

      How can I change the values of modules of a ParticleSystem. I can’t seem to find the particle system modules as properties using Get Property. I also tried adding EmissionModule to the Preferred Types, but that doesn’t seem to help. How should this work?

      #16941
      Gavalakis
      Keymaster

        Hey,

        If you add ParticleSystem to the Preferred Types, you will be able to get the modules like EmissionModule with a ‘Get Property’ action from the ‘ParticleSystem’ type (“Get Emission() : EmissionModule” ).

        With that said though, getting or setting the module properties directly THROUGH a particle system reference is not really possible with the reflection tasks since they do not support “nesting” (at least as of now), thus you can’t do something like var rate = particle.emission.rate.

        Furthermore, modules are structs and unfortunately, reflection based tasks do not work with structs, thus it’s not really possible to store a module reference to a blackboard variable and then alter its properties.

        I believe that the best solution for that, would be to create a very simple custom Action Task to set the particle module properties that you need to set, at least until either reflection tasks are made to also work with “nested” properties, or tasks in general are made to work with structs as well.

        Thanks.

        #16940
        timv
        Participant

          Ok. That’s unfortunate. Thanks for the info though. It would be nice to see support for this in a future version.
          Thanks.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.