using the save to b3d code,im trying to save all the children in my mesh 2 b3d.
when i add the section in the ####s below it reloads my mesh oh but causes an 'entity does not exist' error on an END statement, and then blitzcc crashes with a runtime error - abnormal prog termination! however, it works when debug is off
it works without it though for just the parent.
when i add the section in the ####s below it reloads my mesh oh but causes an 'entity does not exist' error on an END statement, and then blitzcc crashes with a runtime error - abnormal prog termination! however, it works when debug is off
it works without it though for just the parent.
Function WriteBB3D( f_name$,mesh ) file=WriteFile( f_name$ ) b3dSetFile( file ) b3dBeginChunk( "BB3D" ) b3dWriteInt( 1 ) ;version b3dBeginChunk( "BRUS" ) b3dWriteInt( 0 ) ;0 textures per brush b3dWriteString( EntityName(mesh) ) ;name b3dWriteFloat( 0 ) ;red b3dWriteFloat( 0 ) ;green b3dWriteFloat( 0 ) ;blue b3dWriteFloat( 1 ) ;alpha b3dWriteFloat( 0) ;shininess b3dWriteInt( 1 ) ;blend b3dWriteInt( 32+2 ) ;FX b3dEndChunk() ;end of BRUS chunk b3dBeginChunk( "NODE" ) b3dWriteString( EntityName(mesh) ) b3dWriteFloat( 0 ) ;x_pos b3dWriteFloat( 0 ) ;y_pos b3dWriteFloat( 0 ) ;y_pos b3dWriteFloat( 1 ) ;x_scale b3dWriteFloat( 1 ) ;y_scale b3dWriteFloat( 1 ) ;z_scale b3dWriteFloat( 1 ) ;rot_w b3dWriteFloat( 0 ) ;rot_x b3dWriteFloat( 0 ) ;rot_y b3dWriteFloat( 0 ) ;rot_z WriteMESH( mesh ) b3dEndChunk() ;end of NODE chunk ;#################################### For a=1 To CountChildren(mesh) b3dBeginChunk( "NODE" ) chi=GetChild(mesh,a) b3dWriteString( EntityName(chi) ) b3dWriteFloat( 0 ) ;x_pos b3dWriteFloat( 0 ) ;y_pos b3dWriteFloat( 0 ) ;y_pos b3dWriteFloat( 1 ) ;x_scale b3dWriteFloat( 1 ) ;y_scale b3dWriteFloat( 1 ) ;z_scale b3dWriteFloat( 1 ) ;rot_w b3dWriteFloat( 0 ) ;rot_x b3dWriteFloat( 0 ) ;rot_y b3dWriteFloat( 0 ) ;rot_z WriteMESH( chi ) b3dEndChunk() ;end of NODE chunk Next ;################################### b3dEndChunk() ;end of BB3D chunk CloseFile file End Function