Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/07/2012 at 03:01, xxxxxxxx wrote:
I know that I can place a button in a dialog for a TagData plugin. But I can only override the Draw, Execute and AddToExecution methods. Shouldn't I have a Command method to check for GUI elements? How can I check if a button is pressed in the tag dialog?
On 22/07/2012 at 04:12, xxxxxxxx wrote:
You need to override the Message() function and look for messages of type 'MSG_DESCRIPTION_COMMAND'. You then get the DescriptionCommand structure and look for the ID of the button that was clicked in that.
On 22/07/2012 at 04:50, xxxxxxxx wrote:
Ok, I got it working, kind of... When I print data, I get:
{'id': (1007, 8, 1028854)}
This means that it is a dict object, right? So, when I do:
print data['id']
I get (1007, 8, 1028854)
The 1007 is the ID of the button. The 8, I assume that it is the type of GUI element, or something. The 1028854 is the ID of my tag. So, how do I get the individual elements. It seems like a vector but I can't get the ID of the button with data'id' So, how do we access those elements?
On 22/07/2012 at 06:13, xxxxxxxx wrote:
data['id'].id
-Nik
On 22/07/2012 at 07:53, xxxxxxxx wrote:
When I try something like:
bt=data['id'].id
it returns the error:
AttributeError: 'c4d.DescID' object has no attribute 'id'
On 22/07/2012 at 08:11, xxxxxxxx wrote:
There's an example in the Python docs:
def Message(self, node, type, data) : if type==c4d.MSG_DESCRIPTION_COMMAND: if data['id'][0].id==THE_BUTTON_ID: print "Pushed button with command ID", THE_BUTTON_ID return True
On 22/07/2012 at 09:02, xxxxxxxx wrote:
Once again, thank you These things are so poorly documented
On 22/07/2012 at 14:25, xxxxxxxx wrote:
Uups, I'm sorry. Missed the [0] part.
-Niklas