PDA

View Full Version : Problem detecting any Displacement plugins



Kvaalen
02-16-2004, 05:14 AM
This following script should inform you of the current displacement plugins applied:



generic
{
scene = Scene();
dispH = scene.server("DisplacementHandler");
info(dispH);
}


Well, for some reason dispH (the array which is supposed to have all the displacement handlers) is always nil.

Am I doing something wrong or is this a bug?

Thanks for any help.

Kvaalen
02-16-2004, 09:23 AM
Oh... I forgot to say that this script works fine for other handlers (volumetric, master...). It seems to be a problem with the DisplacementHandler part.

#lwrs_web
02-16-2004, 11:01 AM
Use the Item OA instead of the Scene OA.

myItem.server( HANDLERTYPE );

Kvaalen
02-16-2004, 11:42 AM
Well I guess that makes sense, I should have thouhgt of that but it still doesn't work.

I found this link in the old forums:

http://forums.newtek.com/discus/messages/2/26339.html?1025618669

At the end they come to the conclusion that it is probably a bug. Has anyone got this to work?

#lwrs_web
02-17-2004, 01:34 AM
The return value is an array.
Here's an Example:



// ...
handlerList=nil;
itemlist=nil;
item=Mesh();
//item=item1.bone();
if(!item)
return;
while(item)
{
itemlist+=item;
item=item.next();
}
if(itemlist)
foreach(i, itemlist)
{
showItemHandlers(i, SERVER_CUSTOMOBJ_H);
showItemHandlers(i, SERVER_DISPLACEMENT_H);
showItemHandlers(i, SERVER_ITEMMOTION_H);
showItemHandlers(i, SERVER_CHANNEL_H);
//showChannelHandlers(i, SERVER_CHANNEL_H);
//showItemHandlers(i, SERVER_OBJREPLACEMENT_H); // crash in 7.5c

}

// ...

showItemHandlers: item, htyp
{
hlist = item.server(htyp);
if(hlist)
{
handlerList+=string("{", item.name, "} ", htyp);
foreach(h, hlist)
handlerList+=string(" ", h);
}
}

Kvaalen
02-18-2004, 10:48 AM
Hey thanks for the help but it still returns nil. :confused:
Does it work for you?

Thanks again.

#lwrs_web
02-19-2004, 01:00 AM
Yes. LW 7.5c, LScript 2.6.1

Kvaalen
02-19-2004, 02:28 AM
Ah! that's my problem. I have 7.5 - never upgraded to 7.5c because of the bugs people have been complaining about. When LightWave 8 finally ships, I'll update it and then it should work.

Thanks for the help. :)