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

    Dialog code in CoreMessage on new scene.

    SDK Help
    0
    2
    538
    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
      Helper
      last edited by

      On 26/01/2018 at 03:51, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello.

      I have a dialog that implements CoreMessage. Whenever a user creates a new scene via File > New, I need this dialog to run some initialization code if it is still open.
      EVMSG_DOCUMENTRECALCULATED is not triggered. How can I do that ?

      Thank you for your time.

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

        On 30/01/2018 at 06:27, xxxxxxxx wrote:

        Hi,

        you can check BFM_CORE_UPDATECOMMANDS, but you'll receive this not only when a new document is created. So you need to check yourself, if the document changed.

        Int32 MyDialog::Message(const BaseContainer& msg, BaseContainer& result)
        {
        	switch (msg.GetId())
        	{
        		case BFM_CORE_MESSAGE:
        		{
        			const Int32 coreId = msg.GetInt32(BFM_CORE_ID);
        			switch (coreId)
        			{
        				case BFM_CORE_UPDATECOMMANDS:
        					GePrint("    BFM_CORE_UPDATECOMMANDS");
        					break;
        				default:;
        			}
        			break;
        		}
        		default:;
        	}
        	return SUPER::Message(msg, result);
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post