imonkey
09-26-2010, 11:37 PM
Hey guys,
I once used this script to create an infinite light that was targeted at a null.. obviously it does not work in release 12. I have absolutely no idea about scripting in any shape or form. I was wondering if someone could tell me why this isn't working.. According to the console its Line 21 Pos 34. So i'm guessing it has something to do with the target tag being added..
main(doc,op)
{
var new_light,new_target,new_tag;
new_light=new(LightObject);
new_target=new(NullObject);
new_tag=AllocTag(Ttargetexpression);
doc->StartUndo();
doc->AddUndo(UNDO_OBJECT_NEW,new_target);
doc->InsertObject(new_target,NULL,NULL);
new_target->SetName("Light_Target");
doc->AddUndo(UNDO_OBJECT_NEW,new_light);
doc->InsertObject(new_light,NULL,NULL);
new_light->SetPosition(vector(-500,500,-500));
new_light#LIGHT_TYPE=3;
new_light#LIGHT_SHADOWTYPE=3;
new_light->InsertTag(new_tag);
new_tag#TARGETExpressionTAG_LINK=new_target;
doc->EndUndo();
}
I once used this script to create an infinite light that was targeted at a null.. obviously it does not work in release 12. I have absolutely no idea about scripting in any shape or form. I was wondering if someone could tell me why this isn't working.. According to the console its Line 21 Pos 34. So i'm guessing it has something to do with the target tag being added..
main(doc,op)
{
var new_light,new_target,new_tag;
new_light=new(LightObject);
new_target=new(NullObject);
new_tag=AllocTag(Ttargetexpression);
doc->StartUndo();
doc->AddUndo(UNDO_OBJECT_NEW,new_target);
doc->InsertObject(new_target,NULL,NULL);
new_target->SetName("Light_Target");
doc->AddUndo(UNDO_OBJECT_NEW,new_light);
doc->InsertObject(new_light,NULL,NULL);
new_light->SetPosition(vector(-500,500,-500));
new_light#LIGHT_TYPE=3;
new_light#LIGHT_SHADOWTYPE=3;
new_light->InsertTag(new_tag);
new_tag#TARGETExpressionTAG_LINK=new_target;
doc->EndUndo();
}
