On 31/03/2013 at 07:25, xxxxxxxx wrote:
User Information:
Cinema 4D Version: r14
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ;
---------
Hi,
Here's a script i did to change texture tags location.
It's definitely not a slick one, but it works, except that...
It makes the console giving error message each time i select an object when user_data#ID_USERDATA:2 == false.
I tried different way to fixe it, really, never being able doing it.
Is somebody could help me with it?
Thanks a lot,
Jean
Here's the links for the C4D scene(the second one in zip format).
https://www.yousendit.com/download/UVJpb2VNQ1B3NUtFQk1UQw
https://www.yousendit.com/download/UVJpb2VNQ1AxUURFdzhUQw
main(doc,op)
{
var user_data = doc->FindObject("temp_tag(f)");
var tag_cntnr;//tag container
var f_clnr;
var f_txt_tg = new(array,2);
var i;
var i_tag;
if (user_data#ID_USERDATA:2 == true)
{
tag_cntnr = doc->FindObject("f1");
if(!tag_cntnr) return;
i_tag = tag_cntnr->GetFirstTag();
if(!i_tag) return;
i = 0;
while(i< 2)
{
f_txt_tg = i_tag;
_ i_tag = i_tag->GetNext();_
_ i++;_
_ }_
f_txt_tg[0]- >Remove();
f_txt_tg[1]- >Remove();
f_clnr = doc- >FindObject("f_1(clnr)");
if(!f_clnr) return;
f_clnr- >InsertTag(f_txt_tg[1]);
f_clnr- >InsertTag(f_txt_tg[0]);
}
if (user_data#ID_USERDATA:2 == false)
{
tag_cntnr = doc- >FindObject("f_1(clnr)");
if(!tag_cntnr) return;
i_tag = tag_cntnr- >GetFirstTag();
if(!i_tag) return;
_ i = 0;_
_ while(i< 2)_
_ {_
_ f_txt_tg = i_tag;_
_ _ i_tag = i_tag->GetNext();__
_ _ i++;__
_ _ }__
_ f_txt_tg[0]- >Remove();_
_ f_txt_tg[1]- >Remove();_
_ tag_cntnr = doc- >FindObject("f1");_
_ if(!tag_cntnr) return;_
_ tag_cntnr- >InsertTag(f_txt_tg[1]);_
_ tag_cntnr- >InsertTag(f_txt_tg[0]);_
_ }_
__
_ }_
__