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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    KillTag Grass/Architectural crashes c4d

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 605 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 19/07/2017 at 03:16, xxxxxxxx wrote:

      Hi all!
      Been fighting with an issue for more than a day now, maybe one of you sees the light I'm not seeing.

      I've got one object with the Architectural Grass tag on it, and want to delete it from Python code.
      'grassObject' is a direct link to the object in the python node in xpresso.

      print (grassObject.GetTags() ) gives me in console:
      [<c4d.BaseTag object called 'Grass/Architectural Grass' with ID 1028463 at 0x0000020295497E30>]

      BaseObject.KillTag(type[, nr=0]) 
      Killtag expects an int as type (asuming that is the ID I've got from the print)

      Executing 'grassObject.KillTag(1028463)' crashes cinema4D. R17 as well as R18.

      Anyone got a clue what I'm doing wrong?
      Thanks!
      Jur

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

        On 19/07/2017 at 05:53, xxxxxxxx wrote:

        Testing with R17 and R18 everythings work fine here.

        Make sure to calle KillTag from the object and not the tag.
        But you can also do

        op = doc.GetActiveObject()
        op.GetTag(1028463).Remove()
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 20/07/2017 at 05:34, xxxxxxxx wrote:

          Hi,

          the actual problem is, that you try to use KillTag() from within a Xpresso Python node. That's not going to work. Xpresso Python node shouldn't delete things from the scene or create stuff therein.

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

            On 20/07/2017 at 05:56, xxxxxxxx wrote:

            Hi, Thank you for your responses!

            Not a daily python developer so struggling a bit with the SDK and documentation.
            I did not see anywhere that that piece of script can't be run from a xpresso node. Not did I got any warnings on it (limited compiler I guess).

            Made a workaround at the moment by making an instance from the LOFT surface I want the grass to be generated on. I set it to invisible with a compositing tag so only the grass gets rendered if the instance is 'enabled'.

            Cheers,
            Jeroen

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

              On 20/07/2017 at 05:59, xxxxxxxx wrote:

              Hi Jeroen,

              unfortunately our docs are lacking such notes.
              Generally a Xpresso Python node shouldn't alter the scene directly, but instead just process inputs and provide results on outputs.

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