entity brush surface texture help

Started by William, November 18, 2022, 15:40:36

Previous topic - Next topic

William

; Paint B = CreateBrush() Tex = GetTexture(A\Actor\MaleBodyIDs[BodyTex]) If Tex <> 0 BrushTexture(B, Tex) PaintSurface(BodySurface, B) EndIf Tex = GetTexture(A\Actor\MaleFaceIDs[FaceTex]) If Tex <> 0 BrushTexture(B, Tex) PaintSurface(FaceSurface, B) EndIf FreeBrush(B) UnloadTexture(A\Actor\MaleBodyIDs[BodyTex]) UnloadTexture(A\Actor\MaleFaceIDs[FaceTex]) Else Tex = GetTexture(A\Actor\MaleBodyIDs[BodyTex]) If Tex <> 0 Then EntityTexture(A\EN, Tex) UnloadTexture(A\Actor\MaleBodyIDs[BodyTex]) EndIf
the problem with that is that you cannot entitytexture separate surfaces of a single mesh. has this been resolved in openb3d so that i may copy entities and paint separate surfaces?

t
is it possible in openb3d to entity texture surfaces with a brush?
im still interested in oldschool app/gamedev

markcwm

#1
; Paint
B = CreateBrush()
Tex = GetTexture(A\Actor\MaleBodyIDs[BodyTex])
If Tex <> 0
BrushTexture(B, Tex)
PaintSurface(BodySurface, B)
EndIf

Tex = GetTexture(A\Actor\MaleFaceIDs[FaceTex])
If Tex <> 0
BrushTexture(B, Tex)
PaintSurface(FaceSurface, B)
EndIf

FreeBrush(B)
UnloadTexture(A\Actor\MaleBodyIDs[BodyTex])
UnloadTexture(A\Actor\MaleFaceIDs[FaceTex])

Else

Tex = GetTexture(A\Actor\MaleBodyIDs[BodyTex])
If Tex <> 0 Then EntityTexture(A\EN, Tex)
UnloadTexture(A\Actor\MaleBodyIDs[BodyTex])
EndIf


GetSurfaceBrush and PaintSurface should work and is also in Openb3d.

William

#2
what about entities?

i found Function GetEntityBrush:TBrush( ent:TEntity ) in the docs

also found Function PaintEntity( ent:TEntity,brush:TBrush ) are these?
im still interested in oldschool app/gamedev

William

I've had this discussion before, i guess that i dont understand the way b3d/extensions are meant to be?

im still interested in oldschool app/gamedev

markcwm

#4
Entities functions will not give you access to the mesh surfaces, they are usually only for single surface entities. Each entity has it's own brush, and each surface has a brush, you can use entity brushes to over-ride surface brushes.

Each mesh is an entity but a surface is not an entity instead it is stored by a mesh in a list. So you can have an entity with multiple meshes with single surfaces, or a single mesh with multiple surfaces.

Also, brushes can store up to 8 textures, when you use an EntityTexture function that texture is stored in the entity's brush, but there is no such thing as SurfaceTexture instead you use BrushTexture(surf.brush). The other functions follow this logic.