EntityAlpha on part of a mesh?

Blitz3D Forums/Blitz3D Programming/EntityAlpha on part of a mesh?

3DFish(Posted 2005) [#1]
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


Ross C(Posted 2005) [#2]
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.


Ross C(Posted 2005) [#3]
http://www.blitzbasic.com/codearcs/codearcs.php?code=787

That might help you with the recursive searching :o)


3DFish(Posted 2005) [#4]
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.