doc.SetActiveTag() was the key.
doc.SetSelection() was not switching it over to tag mode.
Posts made by Motion4D
RE: Attribute Manager not updating with Tag Selection
Attribute Manager not updating with Tag Selection
I am selecting tags on an object with python and once the selection is set the attribute manager doesn't update with the tag's attributes. It will if you only have any tag selected before the selection but if an object is selected or nothing is selected the attribute manager won't display anything when the tag is selected:/
Any idea how to get the tag's properties to show up without manually selecting it?
Here is simplified code to illustrate the issue. If you just make a cube primitive and select it this code will select the phong tag. But again the properties of the phong tag dont show up.
import c4d from c4d import gui def main(): obj = doc.GetActiveObject() tags = obj.GetTags() doc.SetSelection(tags) c4d.EventAdd() # Execute main() if __name__=='__main__': main()
RE: "Signed Integer is greater then maximum" when registering python plugin
@a_block It was the ID. I did use a random number, apparently one too many. I didn't think it would matter for testing but I guess I was wrong! I figured it would be something dumb like that. It was just weird it pointed me to that line for the error. And yes sorry my code snippet was confusing, I thought it was standard practice to put RegisterObjectPlugin on multiple lines for easier reading.
"Signed Integer is greater then maximum" when registering python plugin
Cinema is complaining about this line of code in my RegisterObjectPlugin function saying "Signed Integer is greater then maximum":
info=c4d.OBJECT_GENERATOR | c4d.OBJECT_ISSPLINE)
I even referenced a working spline plugin and it's the same.
I tried looking the error up and I still have no idea why it thinks this is an issue, any ideas?
RE: R20 Script State Function
@y_puech and @dskeith Thank you both, that is extremely helpful as I didn't see any other documentation on that. I can see how state() could become very dangerous very quickly. I will certainly proceed with caution and hope this will help others will to not abuse the state() function as well:)
R20 Script State Function
So it was announced that scripts will now get access to an on/off state for their icons.
I see that right in the script manager it tells how to work with it using the state() function. I have 2 questions about this.
- Only passing True, False and c4d.CMD_ENABLED|c4d.CMD_VALUE will effect the icon state correct? it can't be done outside of the state() function?
- I noticed when I put a print function inside of the state() function it seemed to loop endlessly? if I use this code:
def state(): obj = doc.GetSelection() if obj != : print "disabled" return c4d.CMD_ENABLED else: print "enabled" return c4d.CMD_ENABLED|c4d.CMD_VALUE
It also seems to update in real time, if I select something the icon becomes instantly enabled without executing the script. I feel like I'm doing it wrong haha.