Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > PYTHON Development
  New Posts New Posts
  FAQ FAQ  Forum Search

Script Write to Annotation Tag on Save

Author
Message
  Topic Search Topic Search
dmp View Drop Down
Member
Member


Joined: 2015 Jun 10
Online Status: Offline
Posts: 5
Direct Link To This Post Topic: Script Write to Annotation Tag on Save
    Posted: 2018 Aug 31 at 7:42am
I can't seem to figure out how to get
MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE
to trigger.

I would like to save some info to an Annotation tag, but only right before the user saves the document.

Tried to put it in Message() but couldn't figure out if Message can stand by itself or if it has to be in a NodeData class?

class SampleClass(plugins.NodeData):
    def Message(self, node, type, data):
        if type == c4d.MSG_DOCUMENTINFO:
            if data['type'] == c4d.MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE:
                print "Document is about to save"
                return True
            return True

Thanks


Back to Top
dmp View Drop Down
Member
Member


Joined: 2015 Jun 10
Online Status: Offline
Posts: 5
Direct Link To This Post Posted: 2018 Sep 02 at 9:23am
Do I need to AddEventNotification to my plugin in order to receive 
MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE messages?
Or can I receive them in PluginMessage? 
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Sep 03 at 8:23am
Hi,

first of all, this forum is going into read-only mode soon. We are currently preparing the new Plugin Café forum, it's supposed to go live today. So I suggest to go over there, register and continue the discussion in a new thread.

I'm afraid, what you have in mind is not possible, at least not in Python.
But first of all, are you writing a script in Script Manager (sounds a bit like) or some kind of plugin? In Script Manager it is impossible, as a script is basically a CommandData plugin with no instance to receive messages.
In then end MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE is received by SceneHooks, but such can not be implemented in Python.

Cheers,
Andreas
SDK Support Engineer
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.