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
    • Login

    How to set a Falloff light for a plugin? [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 406 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 25/10/2014 at 17:06, xxxxxxxx wrote:

      Please forgive for such a newbie question, but I'm trying to set a light with the 'detail' parameter of 'LIGHT_DETAILS_FALLOFF_INVERSESQUARE CLAMPED ' but with no luck, please, can some one help me with this issue?
      This is part of my code...

      > myLight = c4d.BaseObject(5102)
      >
      > doc.InsertObject(myLight)
      >
      > myLight[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = 0
      >
      > myLight[c4d.LIGHT_BRIGHTNESS] = 0.7
      >
      > myLight[c4d.LIGHT_TYPE] = 8
      >
      > .......
      >
      > .......
      >
      > _
      >
      > _
      >
      > myLight[c4d.LIGHT_DETAILS_FALLOFF] = 3
      >
      > _
      >
      > _
      >
      > myLight[c4d.LIGHT_DETAILS_OUTERDISTANCE] = 800
      >
      > _
      >
      > _
      >
      >
      >
      >
      > _
      >
      > _
      I always get "SyntaxError: invalid syntax".

      Thanks for all your help guys!

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

        On 26/10/2014 at 07:23, xxxxxxxx wrote:

        Are you on Mac? Alt + Space inserts some other space character that
        Python can not interpret. Try deleting the whitespace after the ] and
        add a new one.

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

          On 26/10/2014 at 11:17, xxxxxxxx wrote:

          Yes, I'm on a Mac. I'm using PyChar IDE, no wrong spaces, I've already deleted the white spaces but same error.

          > myLight[c4d.LIGHT_DETAILS_FALLOFF]=3

          I've really frustrated! Hope there is one solution for this. I appreciate your help, many thanks!

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

            On 27/10/2014 at 03:38, xxxxxxxx wrote:

            Hello,

            When you look at the Olight.h header file you will see that LIGHT_DETAILS_FALLOFF_INVERSESQUARE_CLAMPED has the value of 7. But I suggest to not use such magic numbers but to use the actual symbol:

              
             op[c4d.LIGHT_DETAILS_FALLOFF] = c4d.LIGHT_DETAILS_FALLOFF_INVERSESQUARE_CLAMPED  
            

            best wishes,
            Sebastian

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

              On 28/10/2014 at 18:49, xxxxxxxx wrote:

              Once again sr. it works like a charm!! I have no word to thank you!

              Cheers!!!

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