EntityAlpha on part of a mesh?
Blitz3D Forums/Blitz3D Programming/EntityAlpha on part of a mesh?
| ||
i have a fish model. i'm trying to set the entityalpha of it's fins to 0.4 EntityAnimAlpha(fish_model,0.4) Function EntityAnimAlpha(m,a#) mymeshname$=EntityName(m) ;"topfin is a group of fish_model" If mymeshname="topfin" Then EntityAlpha m,a# EndIf For i=1 To CountChildren(m) ww=GetChild(m,i) EntityAnimAlpha(ww,a#) Next End Function the problem is when I do a CountChildren(fish_model) I get a result of 2 but the model have more than 50 joints and 9 groups |
| ||
Try countsurfaces(). With that, you can use the GetSurface command and apply alpha and such to different parts. A surface is basically a material. The problem you might be having with count children, is your not doing it recursivly, meaning, the children are parents of other children, at a lower heirarcy level. |
| ||
http://www.blitzbasic.com/codearcs/codearcs.php?code=787 That might help you with the recursive searching :o) |
| ||
thanks Ross that will really help me. I know what the problem with my model is. I need to get Ultimate Unwrap to rename all the groups. all the group names are called ROOT. |