Can anybody line pick children???

Blitz3D Forums/Blitz3D Programming/Can anybody line pick children???

Hujiklo(Posted 2004) [#1]
Can anybody please tell me if it's possible to line pick children in Blitz?
I'm worn out and sick to the back teeth of trying every combination i can think of in order to get Blitz to line pick children - this sort of crap just eats in to dev-time and makes it all the more harder needlessly...Sure line pick will pick a mesh but an animesh with children??? What's the big secret? Somebody tell me please before I put a mouse to my head and rollerball my skull to death GRNNGGnnggg@@##!!


Rimmsy(Posted 2004) [#2]
firstly I'd quite like to see someone rollerball their own skull to death. it'd be one to tell the kids. Second: you have to load a mesh with animation (loadAnimMesh) first before you can see or interact with children. Make sure you entitypickmode (or whatever it is) recursively on the model. So:
m=loadanimmesh("mesh.3ds")
for i=1 to countchildren(m)
  child=getchild(m,i)
  entitypickmode child,2 ; poly pick mode
next


That should work a treat.


Hujiklo(Posted 2004) [#3]
Big thank you Rims. Your code snippet didn't work, but your confidence in it leads me to believe it is something I am doing wrong.
I'm actually making a menu system that is 3d...right now my head is pounding and I'm dog tired but something tells me I'm getting my 2d mixed up with the actual 3d...I'll let you know tommorrow if I solve it or not - me bed is beckoning something terrible and am just too knacked to resist..zzzzzzzz
z
z
z
z

z


jfk EO-11110(Posted 2004) [#4]
Always use recursive functions for such child-editing stuff.

eg:
function xtree_entitypickmode(m,p)
 if entityclass$(m)="Mesh"
  entitypickmode m,p
 endif
 for i=1 to countchildren(m)
  xtree_entitypickmode(getchild(m,i),p)
 next
end function

uh, not tested, just about what you need. I also use an array named orphans(n,4), that is used to store the child handles together with the top parent handles, so I can search for the top parent of any picked child at any time easily.


Hujiklo(Posted 2004) [#5]
Thanks for the tips. I missed the importance of the recursive checking which probably explains my on and off results (only last 2 children would pick before.). It sure would be nice if the blitz docs hammered this point home as I can't seem to find any linepick examples with children at all.
But anyhow, it's working now and I am very, very grateful!