Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Admin
    • Login

    dynamically using xpresso node in python

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 195 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 24/12/2015 at 10:37, xxxxxxxx wrote:

      Hi All,

      I have setup a simple scene using thinking particles and the PLight node. Everything works fine as long as I'm using only one light source. Is there any way to use the PLight node and feed in the influence of multiple light sources (number of lights grows dynamically) ?

      Is it possible to combine multiple light sources (like BOOLE or CONNECT object) in order to plug in the resulting light into the light input port of the PLight node ?

      Or can I accomplish this using a python node ? :

      Lets take this example (P Pass outputs 10 particles) :

      P Pass --> (Particle) PGetData (Position) --> (Position) PLight

      Each frame the position of particles 0-9 will be sent in the PLight node checking for the brightness at these positions. In the working scenario only one light is plugged in the PLight node.

      Now lets assume more light sources are generated during the animation all grouped under a null object.

      Is there any way to setup a python node to get this workflow : Each frame all 10 particle positions should first be sent in the PLight node checking light souce 1 and then (before stepping to the next frame) all 10 positions again checking light source 2 and so on ... ?

      If neither combining several lights to one resulting light nor alternating several lights on the input port of the PLight node is possible - is there any way to get similar PLight functionality by using ONLY python code (without any Xpresso) ?

      Thanks

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 04/01/2016 at 03:28, xxxxxxxx wrote:

        Hello,

        I'm not an Xpresso or TP expert so may not be able to help much. There are an Hierarchy and an Iteration node that might be used to iterate through the child objects of a parent object but I don't know if this might be combined with your case or not.

        Xpresso Python nodes are made for mathematical and local operations. So you could iterate through the child objects of a given object and calculate the sum of these operations in that node. To apply this result to a particle, you should use an output variable and a PSetData node.

        Best wishes,
        Sebastian

        1 Reply Last reply Reply Quote 0
        • First post
          Last post