Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Custom Gui - How to hide the label?

 Post Reply Post Reply Page  12>
Author
Message
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Topic: Custom Gui - How to hide the label?
    Posted: 2015 Jan 09 at 9:00am

User Information:

Cinema 4D Version:   R15,R16 
Platform:   Windows  ;   Mac OSX  ; 
Language(s):     C++  ;   

---------

Hello,

How can you hide the Label of a Parameter in the Attributes Manager for your Custom Gui? Like the
Button Gui, it displays the name on the Button itself and the label to the left is hidden. I want this
for my Custom Gui, too. How can I do it?



Thanks in advance

Niklas


Edited by NiklasR - 2015 Jan 09 at 9:27am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 9:13am
Hi Niklas,
not completely sure, yet. But as I won't have the time to look into it any deeper today, I thought, I'd post nevertheless.
I think, the label is part of the user data part and does not belong to your custom gui. For example, if yopu add your custom gui to a GeDialog, there will be no label. Using a space (an empty string is not possible) for the name and unchecking "Animateable" may be a workaround.
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 9:32am
Hello Andreas,

thanks for your (very) quick reply. Unfortunately, it's not as easy as to just turn off animateable
and make the name a whitespace. See below



I thought it must be possible because there are no options that you have to specify for the Button
to work this way. And I think I have seen some plugins that use a banner in their descriptions which
don't have this problem either.

Best

Niklas
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 9:34am
I'll look into it more deeply, as soon as I find a minute.
Cheers,
Andreas
SDK Support Engineer
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 10:09am
Stupid question... how did you get that button in user data? Or is it part of your custom gui?
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 10:22am
You can add buttons to User Data since R16 (due to the new message() callback in Python Tags and
Generators and the Interaction Tag). Before R15, it was possible to create a User Data button from
Python code. Smile (but not really register the press)


Edited by NiklasR - 2015 Jan 09 at 10:22am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 11:23am
And me stupid an R15 open...
Cheers,
Andreas
SDK Support Engineer
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 1:24pm
Can you try to use ## for the name of your custom gui user data?

I know, this is still not the final solution.
I'm only slowly getting there...

It's got something to do with DescriptionCustomGui

In the DESCRIPTION_CUSTOMGUISETTINGS there's a DESCRIPTION_SHOWTITLE flag, which I guess will do the trick in the end.

If it weren't you, I wouldn't have posted such an incomplete clutter, but I thought, you may want to have something to chew on for the weekend Wink



Edited by Andreas Block - 2015 Jan 12 at 3:29am
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 09 at 2:29pm
Thanks Andreas, I'm going to try that. Don't worry, I really welcome even small hints, because it might
help me already to find a solution. :)

Btw, just a small question which is sort of related: How do you specify Custom GUI properties in a
description resource file? It doesn't work if I do it like this:

LONG MYBANNER { ICON_ID 1232024; BGCOLOR_ID 1001; CUSTOMGUI BANNER; }

nor 

LONG MYBANNER {CUSTOMGUI BANNER { ICON_ID 1232024; BGCOLOR_ID 1001; }; }

Thanks,

Niklas

Update: Regarding the original question, it seems like it is as simple as to put the item into its own
group and not give it a name at all (which is not possible with user data). It would still nice to be able
to make it similar to the Button Gui, without the need to encapsule it into a Group.



Update

It's got something to do with DescriptionCustomGui

In the DESCRIPTION_CUSTOMGUISETTINGS there's a DESCRIPTION_SHOWTITLE flag, which I guess will do the trick in the end.

I think that these flags are only for the DescriptionCustomGui, which is the Custom Gui to display a
complete Description of a node (ie. the complete Attributes Manager is a DescriptionCustomGui) and 
a CustomGui plugin has probably no influence on these settings, and if it would, it would have
global effects for all parameters displayed.

But thanks :)


Edited by NiklasR - 2015 Jan 09 at 5:56pm
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 12 at 3:28am
Hi Niklas,
regarding DescriptionCustomGui you are right. I got carried away by the DESCRIPTION_SHOWTITLE flag...

What I don't understand is your group workaround... I thought your question was about using the custom gui in user data. Now, your screenshot seems to show a tag with its own description resource. Where on my side, there never was a problematic label...

Custom GUI properties:
My first thought was CustomGuiData and implementing all needed properties in there. On the other hand, I think, I learned this from one of your examples... so I'm probably wrong again.
To be honest, I have no idea, if there's an automatic mechanism making properties of custom guis propagate through other customguis, where they are used in.
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 12 at 5:35am
Hello Andreas,

Yes, it seems to work fine in descriptions by putting it into a group. It would still be nice if the Custom
Gui would function the same in User Data.

Also, what I have not yet mentioned, is that I had posted a very similar question in the beta forums
months ago where I was trying to implement my own Button Custom Gui. There is the problematic
label again. I will send you the link in a private message as I don't know whether I am allowed to post
it here or not, even though non-beta users won't have access.

About Custom Gui Properties: I think you can set them in a dialog resource, but I have not found
out how you can specify them in description resources, apart from manually creating the custom GUI
in NodeData::GetDDescription() (which would not be available for Python, and this custom GUI should
be used for a Python plugin.

Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 13 at 8:01am
Andreas, were you gather more information or ask the developers?
And should I start a separate topic about the Custom GUI Properties in Description Files?

Thanks
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 13 at 8:29am
Hello Niklas,

yes, I have had some time to read the code and also get some developer feedback, but I was lacking the time to answer...
And you won't like the answer... the behavior of the normal button in user data is hard coded. And so is the behavior for other custom guis. There's currently no way to emulate the behavior of the button with a custom gui. Sorry.

So there's currently no option in the implementation of a custom gui to hide the label of a custom gui in user data. Only option is to name the user data (short name) ##. Then the label will be hidden.

Regarding the Custom GUI Properties in description resource files, I did some research as well. I have not found any place this is done in C4D. May be an indicator, this is not possible either. I'll discuss this with the rest of the team tomorrow. Until then there's no need to open another topic.
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 13 at 9:29am
Hello Andreas,

I highly appreciate the time you have invested on finding answers, thank you.

 the behavior of the normal button in user data is hard coded. And so is the behavior for other custom guis. There's currently no way to emulate the behavior of the button with a custom gui. Sorry.
This was my biggest fear. Well, one must admit that parts of Cinema are very old that might have been
designed different by today. It would be nice if such old, even seemingly small things, would be adjusted
any time in the future. :)

So there's currently no option in the implementation of a custom gui to hide the label of a custom gui in user data. Only option is to name the user data (short name) ##. Then the label will be hidden.
Sorry I haven't tested it before, and I still had hope it could be configurable from the plugin, but this
is a solution and that is fine. :) Wondering where this is documented though?

Regarding the Custom GUI Properties in description resource files, I did some research as well. I have not found any place this is done in C4D. May be an indicator, this is not possible either. I'll discuss this with the rest of the team tomorrow. Until then there's no need to open another topic.

This would be highly unfortunate. The only way to bring custom user interfaces to the Attributes
Manager is via Custom GUIs. Now, if you can not specify their properties in description resources, 
the only way to configure them is via GetDDescription(). And this is all not possible from Python.

Kind regards

Niklas

Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 15 at 9:33am
Hi Niklas,

forget what I wrote before about CustomGUI properties. It's done all over the place, I simply didn't recognize.

For example a slider:
LONG myID { CUSTOMGUI LONGSLIDER; MINSLIDER 1; MAXSLIDER 1000;}

I think, the problem in your case is, that you expect such properties to propagate through. You'd like to set the properties of a BITMAPBUTTON CustomGUI, which is embedded in your own CustomGUI BANNER. And this won't work.

You will have to implement CustomGuiData for your BANNER and define the needed properties in there. And then you will have to use these to configure the embedded BITMAPBUTTON.

Sorry, for the confusion and that this took a bit longer. I needed some time to unravel the knots in my head.



Edited by Andreas Block - 2015 Jan 15 at 9:34am
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 15 at 10:45am
Hello Andreas,

Are you sure these properties are not part of the datatype instead of the Custom GUI? I think MINSLIDER and MAXSLIDER sare part of the LONG datatype, implemented in CustomDataTypeClass::GetProperties(). When creating user-data, you can specify these values not in the "Details" Tab (where the properties are listed) but in the "Properties" Tab (where you change the datatype of the parameter, etc. [Yes, confusing]).

I think, the problem in your case is, that you expect such properties to propagate through. You'd like to set the properties of a BITMAPBUTTON CustomGUI, which is embedded in your own CustomGUI BANNER. And this won't work.

Actually, no. I only have a GeUserArea in my CustomGui dialog and I define the properties in the CustomGuiData subclass.

class BannerGuiCustomGuiData : public CustomGuiData
{
  typedef CustomGuiData super;
public:

  // CustomGuiData Overrides

  virtual Int32 GetId() override
  {
    return CUSTOMGUI_BANNER;
  }
  virtual CDialog* Alloc(const BaseContainer& settings) override
  {
    BannerGui* dlg = NewObj(BannerGui, settings, this->GetPlugin());
    if (dlg) {
      return dlg->Get();
    }
    return nullptr;
  }
  virtual void Free(CDialog* dlg, void* userdata) override
  {
    if (userdata) {
      BannerGui* gui = static_cast<BannerGui*>(userdata);
      DeleteObj(gui);
    }
  }
  virtual const Char* GetResourceSym() override
  {
    return "BANNER";
  }
  virtual CustomProperty* GetProperties() override
  {
    static CustomProperty props[] = {
      { CUSTOMTYPE_LONG,   BANNERGUI_ICONID,         "ICON_ID" },
      { CUSTOMTYPE_LONG,   BANNERGUI_BGCOLOR_ID,     "BGCOLOR_ID" },
      { CUSTOMTYPE_VECTOR, BANNERGUI_BGCOLOR_VECTOR, "BGCOLOR_VECTOR" },
      { CUSTOMTYPE_FLAG,   BANNERGUI_TRANSPARENT,    "TRANSPARENT" },
      { CUSTOMTYPE_STRING, BANNERGUI_HALIGN,         "ALIGN_H" },
      { CUSTOMTYPE_LONG,   BANNERGUI_WIDTH,          "WIDTH" },
      { CUSTOMTYPE_LONG,   BANNERGUI_HEIGHT,         "HEIGHT" },
      { CUSTOMTYPE_FLAG,   BANNERGUI_LOCKSCALE,      "LOCKSCALE" },
      { CUSTOMTYPE_END, 0, "" },
    };
    return props;
  }
  virtual Int32 GetResourceDataType(Int32*& table) override
  {
    static Int32 _table[] = { DA_LONG, DA_LLONG, DA_STRING, DA_FILENAME };
    table = _table;
    return 4;
  }
};

Best,
Niklas


Edited by NiklasR - 2015 Jan 15 at 10:47am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1812
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 15 at 1:02pm
To be honest, I'm not sure at all. Wink

This entire CustomGUI/CustomDataType/resource description/dialog description/dynamic description stuff confused and is still confusing me. No promises made, but sometime I will write an article for the SDK docs, to get this sorted.

On the other hand I tried it here in one of my private plugins.
I just double checked (the plugin contains indeed a CustomDataType as well).
Here's my code:
Int32 ColorHarmonyCustomGuiData::GetId() { return CUSTOMGUI_HARMONY; }

CDialog* ColorHarmonyCustomGuiData::Alloc(const BaseContainer& settings)
{
  m_pDlg = NewObj(ColorHarmonyCustomGuiWheel, settings, GetPlugin());
  if (!m_pDlg) {
    return nullptr;
  }
  return m_pDlg->Get();
}

void ColorHarmonyCustomGuiData::Free(CDialog* dlg, void* ud)
{
  if (dlg) {
    DeleteObj((GeDialog*&)dlg);
  }
}

const Char* ColorHarmonyCustomGuiData::GetResourceSym()
{
  return "HARMONY";
}

CustomProperty g_cpHarmonyWheelProps[] =
{
  { CUSTOMTYPE_LONG, HARMONY_RGB_FIRST, "NUM_HARMONIES" }, // SDK Support Test
  { CUSTOMTYPE_END, 0, nullptr }
};

CustomProperty* ColorHarmonyCustomGuiData::GetProperties()
{
  return g_cpHarmonyWheelProps;
}

Int32 ColorHarmonyCustomGuiData::GetResourceDataType(Int32*& table)
{
  static Int32 l_table[] = { DTYPE_COLOR, CUSTOMDATATYPE_GRADIENT, CUSTOMDATATYPE_HARMONY };
  table = l_table;
  return sizeof(l_table);
}

And in a test resource file, I used:
COLOR ID_TESTOBJECT_HARMONY { FIT_H; SCALE_H; ANIM OFF; CUSTOMGUI HARMONY; NUM_HARMONIES 5; }

I'll double check the LONG datatype tomorrow.


Edited by Andreas Block - 2015 Jan 15 at 1:16pm
Cheers,
Andreas
SDK Support Engineer
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 15 at 6:19pm
Thanks Andreas! Not only to you is it confusing. I don't even want't to tell how much time I had
to invest to get around the CustomGui and CustomDataType stuff. It's poorly documented/explained.

One idea came up while I read your reply: Maybe it doesn't work because the ID of my property
conflicts with an existing ID? BANNERGUI_ICONID for instance has the ID 1000. I'm gonna check
this tomorrow. Smile
Back to Top
NiklasR View Drop Down
Member
Member


Joined: 2010 Dec 13
Location: Germany
Online Status: Offline
Posts: 2573
Post Options Post Options   Quote NiklasR Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 23 at 7:02am
That wasn't it. The obvious solution was to make a CustomDataTypeClass plugin that exposes the
same custom properties. The settings will be merged in the same BaseContainer that is passed to the
iCustomGui.

I have only one problem left, unfortunately. I want one of the custom properties to be a String.

static CustomProperty BannerGuiProperties[] = {
  { CUSTOMTYPE_LONG,   BANNERGUI_ICONID,         "ICON_ID" },
  { CUSTOMTYPE_LONG,   BANNERGUI_BGCOLOR_ID,     "BGCOLOR_ID" },
  { CUSTOMTYPE_VECTOR, BANNERGUI_BGCOLOR_VECTOR, "BGCOLOR_VECTOR" },
  { CUSTOMTYPE_FLAG,   BANNERGUI_TRANSPARENT,    "TRANSPARENT" },
  { CUSTOMTYPE_STRING, BANNERGUI_HALIGN,         "ALIGN_H" },
  { CUSTOMTYPE_LONG,   BANNERGUI_WIDTH,          "WIDTH" },
  { CUSTOMTYPE_LONG,   BANNERGUI_HEIGHT,         "HEIGHT" },
  { CUSTOMTYPE_FLAG,   BANNERGUI_LOCKSCALE,      "LOCKSCALE" },
  { CUSTOMTYPE_END, 0, "" },
};

But when the property is specified in the Description resource, the entry in the settings container I
get in the iCustomGui is empty (DA_NIL). If the property is left out, I get the default value that I
initialized in CustomDataTypeClass::GetDefaultProperties() (which is fine).

        GROUP {
            BANNER TEST { ICON_ID 5159; WIDTH 16; ALIGN_H "center"; LOCKSCALE; TRANSPARENT; }
        }

class BannerGuiDataType : public CustomDataTypeClass {
  typedef CustomDataTypeClass super;
public:

  // CustomDataTypeClass

  virtual Int32 GetId() override
  {
    return CUSTOMDATATYPE_BANNER;
  }

  virtual CustomDataType* AllocData() override
  {
    return NewObjClear(CustomDataType);
  }

  virtual void FreeData(CustomDataType* data) override
  {
    DeleteObj(data);
  }

  virtual Bool CopyData(
    const CustomDataType* src, CustomDataType* dest, AliasTrans* at)
    override
  {
    return true;
  }

  virtual Int32 Compare(const CustomDataType* d1, const CustomDataType* d2)
    override
  {
    return -1;
  }

  virtual Bool WriteData(const CustomDataType* data, HyperFile* hf) override
  {
    return true;
  }

  virtual Bool ReadData(CustomDataType* data, HyperFile* hf, Int32 level)
    override
  {
    return true;
  }

  virtual const Char* GetResourceSym() override
  {
    return "BANNER";
  }

  virtual CustomProperty* GetProperties() override
  {
    return ::BannerGuiProperties;
  }

  virtual void GetDefaultProperties(BaseContainer& data) override
  {
    data.SetInt32(BANNERGUI_ICONID, 0);
    data.SetInt32(BANNERGUI_BGCOLOR_ID, -1);
    data.SetVector(BANNERGUI_BGCOLOR_VECTOR, Vector(0, 0, 0));
    data.SetBool(BANNERGUI_TRANSPARENT, false);
    data.SetString(BANNERGUI_HALIGN, "LEFT");
    data.SetInt32(BANNERGUI_WIDTH, -1);
    data.SetInt32(BANNERGUI_HEIGHT, -1);
    data.SetBool(BANNERGUI_LOCKSCALE, false);
    data.SetInt32(DESC_ANIMATE, DESC_ANIMATE_OFF);
    data.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BANNER);
  }
};

// -------------------------------------------------------------------------

BannerGui::BannerGui(
  const BaseContainer& bc, CUSTOMGUIPLUGIN* plugin)
  : super(bc, plugin), iconData(), ownsBitmap(false)
{
  this->ua = NewObjClear(BannerGuiUserArea, this);
  this->iconId = bc.GetInt32(BANNERGUI_ICONID, 0);
  this->transparent = bc.GetBool(BANNERGUI_TRANSPARENT);

  if (bc.GetInt32(BANNERGUI_BGCOLOR_ID, -1) < 0) {
    this->bgColor = bc.GetVector(BANNERGUI_BGCOLOR_VECTOR);
  }
  else {
    this->bgColor = bc.GetInt32(BANNERGUI_BGCOLOR_ID);
  }

  const String alignMode = bc.GetString(BANNERGUI_HALIGN).ToLower();
  if (alignMode == "right") {
    this->alignH = BANNERGUI_HALIGN_RIGHT;
  }
  else if (alignMode == "center") {
    this->alignH = BANNERGUI_HALIGN_CENTER;
  }
  else if (alignMode == "left" || true) {
    this->alignH = BANNERGUI_HALIGN_LEFT;
  }

  this->width = bc.GetInt32(BANNERGUI_WIDTH, -1);
  this->height = bc.GetInt32(BANNERGUI_HEIGHT, -1);
  this->lockScale = bc.GetBool(BANNERGUI_LOCKSCALE, false);

  GePrint("HALIGN Dtype: " + String::IntToString(bc.GetType(BANNERGUI_HALIGN)));
  GePrint("Icon ID: " + String::IntToString(this->iconId));
  GePrint("alignMode: " + alignMode);
  GePrint("Width: " + String::IntToString(this->width));
  GePrint("Height: " + String::IntToString(this->height));
  GePrint("LockScale: " + String::IntToString(this->lockScale));
}

An idea where the problem could be? Thanks!

Niklas


Edited by NiklasR - 2015 Jan 23 at 7:03am
Back to Top
MohamedSakr View Drop Down
Member
Member
Avatar

Joined: 2012 Sep 17
Location: Egypt
Online Status: Offline
Posts: 577
Post Options Post Options   Quote MohamedSakr Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Jan 26 at 10:55am
">I'm not sure where the problem could be!! "I usually get problems with .res files "I like C++ functions more""

what I did in my custom data type class and it worked

virtual Bool _GetDescription(const CustomDataType* data, Description& desc, DESCFLAGS_DESC& flags, const BaseContainer& parentdescription, DescID* singledescid)
{
//won't read res file!!
//edited the code
DescID cid = DescLevel(/* your ID here, same as the ID used in GetParameter() */ YOURID, DTYPE_STRING, 0);
if (!singleid || cid.IsPartOf(*singledescid, nullptr)) // important to check for speedup c4d!
{
BaseContainer mstring = GetCustomDataTypeDefault(DTYPE_STRING);
mstring .SetString(BANNERGUI_HALIGN, "left");
if (!desc.SetParameter(cid, mstring, DescLevel(0)))
return true;
}
flags |= DESCFLAGS_DESC_LOADED;
return SUPER::_GetDescription(data, desc, flags, parentdescription, singledescid);
}


Edited by MohamedSakr - 2015 Jan 28 at 7:28am
cheers,
Mohamed Sakr
Back to Top
 Post Reply Post Reply Page  12>

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.172 seconds.