Navigation

    • Register
    • Login
    • Search
    1. Home
    2. geese780
    G

    geese780

    @geese780

    2
    Reputation
    15
    Posts
    42
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    geese780 Follow

    Best posts made by geese780

    RE: Insert String Info Into AddStaticText dialog command

    Thanks Maxime, understood on the rules and regulations, sorry about that.

    I understand the group concept now, read up more on it and I have a better idea on how to approach the goal I'm trying to get to.

    I have another error I'm getting but I'll try to do another post and see if I tag it right!

    Thanks for your time!

    Cheers!

    MattG

    posted in Cinema 4D SDK •
    RE: OSC Plugin or simple Xpresso Script

    Hey Guys!

    Thank you very much for the insight! All of this makes sense, it helps me understand a little more about how the node part works! I really appreciate the time on this and thanks again for the help! I hope y'all are doing well!

    Cheers!

    MattG

    posted in General Talk •

    Latest posts made by geese780

    RE: Python Plugin Unicode Convert

    Hey Zipit!

    Thanks for the response, I actually completely overlooked the fact that I had to convert it to a string......(insert hammer on head here)

    Note to self hahaha!

    Stay safe out there!

    Cheers!

    MattG

    posted in General Talk •
    Python Plugin Unicode Convert

    Hey Y'all,

    I'm running into an issue with a JSON encoding bit, I'm getting a type error of this

    TypeError: unable to convert unicode to @net.maxon.interface.url-C

    I am trying to read a JSON file into cinema and make it a path in the plugin, below is the current code I have

    #----------------------------------------------------------------------------------------------------------------------------------------
    #  IMPORT OBJECTS
    #----------------------------------------------------------------------------------------------------------------------------------------
    import os
    from os import listdir
    from os.path import isfile, join
    def import_objs(OBJ_LIST):
        global SETTINGS
        LIBPATH         = SETTINGS["SETTING_ASSET_LIBRARY_FULLPATH"]
        FILES           = [f for f in listdir(LIBPATH) if isfile(join(LIBPATH, f))]
        for OBJ in OBJ_LIST:
            OBJ_FILENAME    = OBJ[0] + ".c4d"
            if OBJ_FILENAME in FILES:
                FILEPATH = os.path.join(LIBPATH,OBJ_FILENAME)
                c4d.documents.MergeDocument(doc, FILEPATH, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS, None)
                c4d.EventAdd()
        return True
    

    Any thoughts?

    Cheers!

    MattG

    posted in General Talk •
    RE: AttributeError: 'GUI' object has no attribute 'AddCheckBox'

    Well Uh.....Yea.....Guess I should take a break......Thanks for the point out of the lower case b........🙄

    This is solved. Thanks Plugin Student!

    Cheers!

    MattG

    posted in Cinema 4D SDK •
    AttributeError: 'GUI' object has no attribute 'AddCheckBox'

    Hey Guys,

    I'm getting the error " AttributeError: 'GUI' object has no attribute 'AddCheckBox' " in my console, and I believe I'm bringing in the right libraries, I think...But, I cannot seem to find anything that's helping searching through forums and the c4d.gui info pages.

    Maxime helped me understand the group concepts so thanks again for that. I commented out a lot of code to test things, but here's the current code that's throwing the error. Still a lot of learning to do, but I've been on this particular error for 2 hours now....oh fun haha

    import c4d
    from c4d import gui, plugins, bitmaps, documents
    
    class GUI(gui.GeDialog):
        """ Creates the main graphical user interface of the plug-in  """
        
        
        ResourceFileGroup = 101
        SettingFilegroup = 102
        Label_Folders = 201
        Label_Settings = 202
        Label_ObjectsImport = 203
        ResourceFolder = 301
        MVRFileLocation = 302
        AllCheckBox = 401
        HangingPosCheckBox = 402
        TrussCheckBox = 403
        FixturesCheckBox = 404
        GeometriesCheckBox = 405
        ComboBox_ID = 1003
        AddChild_1 = 1004
        TextEdit = 1005
        RadioGroup = 1006
        RadioText = 1007
        RadioChild = 1008
        
        def CreateLayout(self):
            
            self.SetTitle("My Dialog")
            
            self.GroupBegin(self.ResourceFileGroup, 0 | 0)
            self.AddStaticText(self.TextEdit, c4d.BFH_SCALEFIT | c4d.BFV_TOP, 100, 25, "Source Files", 1)
            self.AddButton(self.ResourceFolder, c4d.BFH_LEFT | c4d.BFV_TOP, 125, 25, "Resource Folder")
            self.AddButton(self.MVRFileLocation, c4d.BFH_LEFT | c4d.BFV_TOP, 125, 25, "MVR File")
            self.GroupEnd()
    
            self.GroupBegin(self.ResourceFileGroup, 0 | 0)
            self.AddStaticText(self.TextEdit, c4d.BFH_SCALEFIT | c4d.BFV_TOP, 100, 25, "Settings", 1)
            self.AddCheckBox(self.AllCheckBox, c4d.BFH_LEFT | c4d.BFV_TOP, 125, 25, "All")
            self.GroupEnd()
    
            # if self.GroupBegin(self.SettingFilegroup, 0 | 0):
            #     self.AddStaticText(self.TextEdit, 0 | 0, 100, 25, "Settings", 1)
            #     self.AddCheckBox(self.AllCheckBox, c4d.BFH_LEFT | c4d.BFV_TOP, 125, 25, "All")
            
            # self.GroupEnd()
    
    
            # self.SetTitle("CAV MVR IMPORTER")  # Set dialog title
            # self.AddRadioText(self.Label_Folders, c4d.BFH_LEFT | c4d.BFV_TOP, 0, 0, "Source Files")
            # self.AddRadioText(self.Label_Settings, c4d.BFH_CENTER, 0, 0, "Settings")
            # self.AddRadioText(self.Label_Settings, c4d.BFH_RIGHT, 0, 0, "Objects To Import")
            # self.AddButton(self.ResourceFolder, c4d.BFH_LEFT | c4d.BFV_TOP, 125, 25, "Resource Folder")
            # self.AddButton(self.MVRFileLocation, c4d.BFH_LEFT | c4d.BFV_TOP, 125, 25, "MVR File")
            # self.AddComboBox(self.ComboBox_ID, 0 | 0, 100, 25, True, True)
            # self.AddChild(self.ComboBox_ID, self.AddChild_1, "Drop Down 1")
            # self.AddRadioGroup(self.RadioGroup, c4d.BFH_SCALE | c4d.BFV_SCALE, 1, 3)
    
            # Create a Group, its usefull because here we adds the StaticText Gadget and to make it appears again
            # LayoutChanged needs to be called, which work only a group.
            # if self.GroupBegin(self.TextEditGroup, c4d.BFH_SCALEFIT | c4d.BFV_TOP):
            #     self.AddStaticText(self.TextEdit, c4d.BFH_SCALEFIT | c4d.BFV_TOP, 100, 25, "", 1)
            #     self.HideElement(self.TextEdit, True)
            # self.GroupEnd()
            
    
    
        # def Command(self, id, msg):
        #     # RESOURCE FOLDER BUTTON
        #     if id == 201:
        #         fn_ResourceFolder = c4d.storage.LoadDialog()
        #          # Unhides the Text element
        #         self.HideElement(self.TextEdit, False)
                
        #         # Checks if its a str, then display the file path
        #         if isinstance(fn, str):
        #             # Unhides the Text element
        #             self.HideElement(self.TextEdit, False)
        #             # SET THE STRING
        #             self.SetString(self.TextEdit, fn)
                    
        #         # If its not a string, the user cancelled
        #         else:
        #             self.SetString(self.TextEdit, "User cancelled")
                    
        #         # Notify the layout of the group changed, this will invalidate the group and it will be then redraw
        #         # This is needed because the UI was hidden, if the Ui is not hidden then there is no need for it
        #         self.LayoutChanged(self.TextEditGroup)
    
        #     # MVR FILE BUTTON
        #     if id == 202:
        #         fn_MVRFileLocation = c4d.storage.LoadDialog()
    
    
        #         # Unhides the Text element
        #         self.HideElement(self.TextEdit, False)
                
        #         # Checks if its a str, then display the file path
        #         if isinstance(fn, str):
        #             # Unhides the Text element
        #             self.HideElement(self.TextEdit, False)
        #             # SET THE STRING
        #             self.SetString(self.TextEdit, fn)
                    
        #         # If its not a string, the user cancelled
        #         else:
        #             self.SetString(self.TextEdit, "User cancelled")
                    
        #         # Notify the layout of the group changed, this will invalidate the group and it will be then redraw
        #         # This is needed because the UI was hidden, if the Ui is not hidden then there is no need for it
        #         self.LayoutChanged(self.TextEditGroup)
    
    
    
        #         print fn_MVRFileLocation
    
    
        
            
    def main():
        # Test dialog
        diag = GUI()
        diag.Open(dlgtype=c4d.DLG_TYPE_MODAL, defaultw=1000, defaulth=400)
    
        
    
    
    # Execute main()
    if __name__ == '__main__':
        main()
    

    Thanks again for any insight.

    Cheers!

    MattG

    posted in Cinema 4D SDK •
    RE: Insert String Info Into AddStaticText dialog command

    Thanks Maxime, understood on the rules and regulations, sorry about that.

    I understand the group concept now, read up more on it and I have a better idea on how to approach the goal I'm trying to get to.

    I have another error I'm getting but I'll try to do another post and see if I tag it right!

    Thanks for your time!

    Cheers!

    MattG

    posted in Cinema 4D SDK •
    Insert String Info Into AddStaticText dialog command

    AddStaticText Insert String defined by variable as text name in Python

    Hey guys,

    I'm having a hard time trying to figure out the right order in which I'm trying to use a string obtained by a variable andu use the string infomation as a StaticText. Here's my current working code minus the AddStaticText part which works under the CreateLayout Definition, but it would run that before obtaining the information I would want it to, so I moved it under my Command Definition. Any small insight would be very grateful!

    import c4d
    from c4d import gui, plugins, bitmaps, documents
    
    class GUI(gui.GeDialog):
        """ Creates the main graphical user interface of the plug-in  """
        BUTTON_ID = 1001
        Checkbox_ID = 1002
        ComboBox_ID = 1003
        AddChild_1 = 1004
        TextEdit = 1005
        def CreateLayout(self):
            self.SetTitle("CAV MVR IMPORTER")  # Set dialog title
            self.AddButton(self.BUTTON_ID, c4d.BFH_LEFT | c4d.BFV_TOP, 100, 25, "Close Dialog")
            
            self.AddCheckbox(self.Checkbox_ID, c4d.BFH_LEFT | c4d.BFV_TOP, 25, 25, "Checkbox")
            self.AddComboBox(self.ComboBox_ID, 0 | 0, 100, 25, True, True)
            self.AddChild(self.ComboBox_ID, self.AddChild_1, "Drop Down 1")
            #self.AddStaticText(self.TextEdit, 0 | 0, 100, 25, "Test Text", 1)
        def Command(self, id, msg):
            if id == 1001:
                fn = c4d.storage.LoadDialog()
                print fn
                if fn == str:
                    self.AddStaticText(self.TextEdit, 0 | 0, 100, 25, fn, 1)
               
    
    
        
            
    def main():
        # Test dialog
        diag = GUI()
        diag.Open(dlgtype=c4d.DLG_TYPE_MODAL, defaultw=1000, defaulth=400)
    
        
    
    
    # Execute main()
    if __name__ == '__main__':
        main()
    

    Cheers!

    MattG

    posted in Cinema 4D SDK •
    RE: Beginner Programmer C++ Libraries Needed for starting first plugin?

    Hey Richard!

    Thank you for the response, I have VS2017 version 15.9 all set up now, I think..... haha. I can see all the solutions in VS as well, but I ran the powersheel commands without having 2017 installed and I could see them in 2019, do I need to re-run the command or is it on the compile side that 2017 is the right version?

    I've been reading through all that documentation and I have seen the resources on Git as well so thanks for helping me understand I'm looking in the right spots haha! Thanks for the help so far, I'm sure I'll be back soon with more questions haha!

    Cheers!

    MattG

    posted in General Talk •
    RE: Beginner Programmer C++ Libraries Needed for starting first plugin?

    Thanks for the replies guys! For VS2017, do I need version 15 or 15.9?

    b75b8cd2-e181-41fa-9ae2-acdf0fe65c92-image.png

    Thanks for the introduction page Plugin Student! I'll look over those again to see if there's anything that I'm not really understanding!

    posted in General Talk •
    RE: Beginner Programmer C++ Libraries Needed for starting first plugin?

    So, quick update, I found a blog to help go through the initial process, which I was doing TOTALLY wrong, which gave me the solutions file for VS. https://vonpb.de/blog/cinema-4d-c-plugins-getting-started/

    From what I understand this is where I source the right header files needed for what I'm looking for. Hopefully I'm in the right direction.

    posted in General Talk •
    Beginner Programmer C++ Libraries Needed for starting first plugin?

    Hey Everyone,

    I hope y'all are doing well. I've been trying to learn how start my first plugin which I want to make superbasic for a starter project, I have taken classes on C++ but I will not say I'm an experienced programmer by any means. The goal is to insert a cube and give it dedicated coordinates from a CSV file. I believe I have found all the functions that I need to make this happen minues some C++ functions, but my quesiton is, are there certain libs that I need to include in my header file? Also, plugin's from what I'm seeing are uncompiled lines of code...? Maybe? I see a lot of c4d_resource.h files in example files, I see a lot of c4d_plugin.h files, so I guess I'm trying to make sure I have the bare libs needed to pull from the SDK.

    Any insight would be more than great, but thank you for your time and I'm looking forward to learning more about this!

    Cheers!

    MattG

    posted in General Talk •