Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    CustomDataType/Gui like CUSTOMGUI_SPLINE

    SDK Help
    0
    27
    14.4k
    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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 18/11/2008 at 14:15, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R9-R11 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      I'd like to design a custom AM description using CustomDataType and CustomGui that is similar to the stock CUSTOMGUI_SPLINE but it works on different spline principles (continuous spline as well as other types of spline) and has other features (such as load/save of custom splines into an external file).

      Where to begin? The example datatype is way, way too simplistic for what needs to be done here (as in way, way, way). 😉 How do I draw the grid? How do I impart user edit of the grid? Is the grid a GeUserArea? How do I use it in a CustomGUI in the AM? How do I make it usable with Xpresso? (you get the point - many, many questions, few answers.)

      Basically, it looks like I may need some dedicated help in designing and building this interface since no such information exists outside of the stock custom spline - which is mostly hidden away.

      Thanks,

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 18/11/2008 at 15:08, xxxxxxxx wrote:

        Coincidentally I am currently working on a SDK example that shows how to create a custom description gui element. It will be not as advanced as the spline element but should show the necessary steps to create a custom gui element.

        Basically you need:

        - own UserArea for the fancy graphics stuff.
        - from iBaseCustomGui derived own class for the element's gui. This is basically the elements dialog.
        - from CustomGuiData derived own class for creating the elements plugin data.

        I can't say yet when I will post the example.

        Stay tuned.

        cheers,
        Matthias

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 18/11/2008 at 16:07, xxxxxxxx wrote:

          Thanks, Matthias!

          I'll start trying to get something and add topics if (when) I run into problems.

          Look forward to this example. Post back here when it is available (if I don't catch beforehand).

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 18/11/2008 at 17:57, xxxxxxxx wrote:

            Now, when you say 'own UserArea' is this different than using a GeUserArea? I can't find any way (here or in docs) to set a GeUserArea in the AM description. There is no CUSTOMGUI_'USERAREA' nor anything remotely similar in the Resource folder. Nor is there any info on how to use the GeUserArea outside of a dialog.

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 19/11/2008 at 00:49, xxxxxxxx wrote:

              Sorry, I meant of course a GeUserArea. You use it in a similar way as you can find in the AsyncTest example, only with a iBaseCustomGui instead of a GeDialog.

              cheers,
              Matthias

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 19/11/2008 at 20:04, xxxxxxxx wrote:

                So you add it to the iCustomGui using the AttachUserArea() method, right? 🙂

                I'm going to have to see how far I can get this as I haven't quite figured out the integration of the CustomGuiData with the CustomDataTypeClass (et al).

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

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 19/11/2008 at 21:04, xxxxxxxx wrote:

                  Do I actually need a Custom data type to go with this or can I just use the available descriptions for buttons and checkboxes and so on showing my custom spline interface in the GeUserArea of the CustomGui (storing the spline data as class variables or maybe in a sub-BaseContainer so that it gets read/written).

                  Again, I'm not too clear on how these two (CustomGui and CustomDataType) work together and if the data type is actually necessary (except maybe so that it can be included in the .res file). This is more or less a complex custom gui for my own data - but it, of course, needs to be loaded/saved with the document.

                  Yours truly confused, 🙂

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

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 20/11/2008 at 03:22, xxxxxxxx wrote:

                    Hey Rob,

                    here is some code provided by Mikael back then which shows how to include a dialog (you can even use dialog resources) :
                    CustomDataType

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

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 20/11/2008 at 10:28, xxxxxxxx wrote:

                      That one seems to have slipped by in my searchs. I had a couple others from Mikael that were just the CustomGui without the CustomDataType.

                      This may be very useful.

                      Thanks, Samir! 🙂

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

                        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                        On 22/11/2008 at 12:13, xxxxxxxx wrote:

                        Incidently im trying to make a CustomDataType/Gui, too and the link mentioned by 3D Designer helped me a lot, but i have the same problem mandrake77 described: AllocData is actually never called.

                        I cant get much info out of his solution ("BaseContainer->InsData ! =)" and "And SetData seems to bew the better choice...."), so im counting on you guys 🙂

                        The GUI part works fine btw and im really happy you discovered this thread, thanks 3D Designer!

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

                          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                          On 23/11/2008 at 04:30, xxxxxxxx wrote:

                          ok, maybe i should go a bit more into detail.
                          i kept very close to the example code (i just changed a few variables and resource ids) and my problems (just like mandrake77's) are:

                          - in MSASplinePosDialog::SetData(const TriState<GeData> &tristate;) tristate.GetValue().GetType()==DA_NIL and tristate.GetValue().GetCustomDataType(MSA_SPLINEPOS_DATATYPE_ID) returns NULL
                          - MSASplinePos::AllocData() is never called

                          please help 🙂

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

                            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                            On 27/11/2008 at 10:45, xxxxxxxx wrote:

                            I think that I'm in the same boat here. My tristate.GetValue().GetCustomDataType() returns NULL as well and mandrake77's information is uninformative. The best guess that I can give is that he creates the customdata in his plugin's GetDDescription() and inserts it into the BaseContainer there (?). In my case, though, I'm adding my customdatatype/customgui via the resource description file (.res) specifically to avoid GetDDescription() (unless otherwise required).

                            Here's hoping for Matthias' example soon! 😉

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

                              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                              On 27/11/2008 at 11:30, xxxxxxxx wrote:

                              Okay, it may be this (seems to work) :

                              > // NodeData.Init \> //\*---------------------------------------------------------------------------\* \> Bool MyNodeData::Init(GeListNode\* node) \> //\*---------------------------------------------------------------------------\* \> { \>      // Initialize container \>      if (!node)                    return FALSE; \>      BaseContainer\*     bc =     ((BaseObject\* )node)->GetDataInstance(); \>      if (!bc)                    return FALSE; \>      // The InsData ID is the one specified in your .h/.res for this plugin object. \>      //     GeData(YOUR_CUSTOMDATATYPE_ID, ...) \>      bc->InsData(MAGNETUDE_ZONE_GRAPH, GeData(CUSTOMDATATYPE_KDZFALLOFF, DEFAULTVALUE)); \>      return TRUE; \> } \>

                              Still not getting things working fully yet - like interactive setting my combobox using the customgui isn't sticking. I have everything in place.

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

                                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                On 28/11/2008 at 00:45, xxxxxxxx wrote:

                                Now onto the juicy bits.

                                Using Mikael's MSA_SPLINEPOS example, the customgui is using a copy of the customdatatype. But how does one set the actual customdatatype from the copy - especially since the main data is a Vector array? So far, anytime that the AM is switched from then back to this, the data is reset to the customdatatype default information (because the copy hasn't been 'written' to the original). It looks like messaging from the stock SplineData might be the answer (?). I don't know.

                                Undos. How to do undos on my spline edits? Since the internals of SplineData are hidden, I can only suspect that either real undos are stored for the object with the customdatatype or that it has its own undo history (?). Would a simple AddUndo() setup do the trick here?

                                Progress is moving forward but at a snail's pace. 🙂

                                Thanks,

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

                                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                  On 28/11/2008 at 01:02, xxxxxxxx wrote:

                                  Afaik, undos are handled automatically by Cinema 4D for custom descriptions.

                                  cheers,
                                  Matthias

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

                                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                    On 28/11/2008 at 01:09, xxxxxxxx wrote:

                                    Not here. If I add the object and then edit the spline points, an undo removes the object and doesn't undo changes to my spline points. The CUSTOMDATATYPE_INFO_UNDOSAMECUSTOMGUI flag is set for the RegisterCustomDataTypePlugin().

                                    Realize that what I have in my iCustomDataType is the spline 'type', 'count' (number of nodes or knots), and a Vector array containing the nodes/knots. type and count are handled as description resources but the Vector array only exists as such and isn't stored in a Description or BaseContainer.

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

                                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                      On 28/11/2008 at 01:18, xxxxxxxx wrote:

                                      You have to set the CUSTOMDATATYPE_INFO_UNDOSAMECUSTOMGUI flag for your CustomDataType plugin. Here is the register call of the gradient for instance.

                                      > \> RegisterCustomDataTypePlugin(GeLoadString(IDS_DATATYPE_GRADIENT), CUSTOMDATATYPE_INFO_LOADSAVE | CUSTOMDATATYPE_INFO_UNDOSAMECUSTOMGUI | CUSTOMDATATYPE_INFO_HASSUBDESCRIPTION|CUSTOMDATATYPE_INFO_NEEDDATAFORSUBDESC, gNew GradientDataTypeClass,1)); \>

                                      Only use CUSTOMDATATYPE_INFO_UNDOSAMECUSTOMGUI for elelments like the gradient or spline. Simple types don't need and shouldn't use this.

                                      cheers,
                                      Matthias

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

                                        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                        On 28/11/2008 at 01:20, xxxxxxxx wrote:

                                        Hmm, maybe I am missing something but isn´t that just the same what he said he already does? :-?

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

                                          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                          On 28/11/2008 at 01:33, xxxxxxxx wrote:

                                          oops, indeed, I missed Robert's last post.

                                          cheers,
                                          Matthias

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

                                            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                                            On 30/11/2008 at 12:02, xxxxxxxx wrote:

                                            Any idea on how to get the customgui data to the customdatatype? I see that iCustomGui::SetData() is called often whereas iCustomGui::GetData() is never called - so my customgui gets the datatype but can never update it. I have found no way to do this. The only real example that I have for my type of datatype/gui is SplineData/SplineCustomGui but its underlying workings are hidden (as expected).

                                            Come on here. It's coming up on TWO WEEKS since I started this request and I'm still groping in the dark. I can't run a business on R&D; and T&E; in this dismal economic situation. I need support here.

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