On 13/01/2013 at 12:08, xxxxxxxx wrote:
not so sure, if i am just misunderstading you again, but i do not really see the problem at least for
the first problem. if haven't searched very hard for all appearences of GeDialog.Open(). so there
might be more:
Bool SimpleDialog::Execute(BaseDocument *doc)
{
StopAllThreads();
return dlg.Open(DLG_TYPE_ASYNC,DIALOG_PLUGIN_ID, -1, -1, 300,150);
}
in python :
def Execute(self, doc) :
# this is actually just covering objects, so no materials, tags and so on
selection = doc.GetActiveObjects(0)
if(selection) :
result myDialog.Open(Blah, Blah, Blah)
note that there is also the overwriteable GetState Method, which disables the command
button itself when you retun False (this gray disabled thing) :
edit :it is not False but 0, here a small example (not sure if False will work also) :
# toggle the plugin button state, pressed / active / disabled (unsaved document)
# ---------------------------------------------------------------------------------------------------
def GetState(self, doc) :
if (doc.GetDocumentPath() != "") :
if (self.isActive) :
return c4d.CMD_VALUE + c4d.CMD_ENABLED
else:
return c4d.CMD_ENABLED
else:
return 0
for the second one. you are talking about a bitmap stored inside the TagData class, not
the BitmapIcon of the tag itself ? And you want to get the bitmap of the currently selected
object / the custom tag of this object ?
geting hold of the actual intance of this TagClass seems almost impossible for me without
writing an extra plugin for that but you could try your luck with a CoreMessage/Message.
the chain would be something like that :
1. myCommandDataInstance.Execute:
myTag = GetSelectedObject().GetTagClassXYZ
myDialogInstance.PassDataMethod(myTag)
2. myDialogInstance.PassDataMethod:
SpecialEventAdd(GetBitmapID, myTag)
3. myTagInstance.CoreMessage:
if id == GetBitmapID and data = = self then SpecialEventAdd(SendBitmapID, bitmap)
4. myDialogInstance.CoreMessage:
if id == SendBitmapID then myBitmap = data
5. myCommandDataInstance.Execute:
myDialogInstance.Open
6. myDialogInstance.Somewhere:
use myBitmap
this really does not sound like fun :)