On 12/11/2013 at 15:27, xxxxxxxx wrote:
hi,
sorry my mistake , this is a tag so callcommand not working.
Here I will show you how you should work when scripting:
1- Will we find the Vray light tag ID:
add a light to your scene;
add to it a Vray light tag
Select the light
import c4d
from c4d import gui
#Welcome to the world of Python
def main() :
mydoc = c4d.documents.GetActiveDocument()
myobj = doc.GetActiveObject()
print myobj.GetTags()
if __name__=='__main__':
main()
In my case, I added Xpresso tag and I get:
[<c4d.modules.graphview.XPressoTag object called 'XPresso/XPresso' with ID 1001149 at 0x10C249A0>]
2- Now you have the ID, so we will call it myID:
add a new light and select it:
import c4d
from c4d import gui
#Welcome to the world of Python
def main() :
myID = (put here the ID returned by the 1 print)
mydoc = c4d.documents.GetActiveDocument()
myobj = doc.GetActiveObject()
if myobj==None or myobj.GetType() != c4d.Olight:
gui.MessageDialog('Select a Light!')
return
mytag = c4d.BaseTag(myID)
myobj.InsertTag(mytag, None)
c4d.EventAdd()
if __name__=='__main__':
main()
-Focus3D-