question

Joerg Vogel avatar image
0 Likes"
Joerg Vogel asked Phil BoBo edited

What are the states of the attribute "drawflags" under the visual tree in an object?

The standard value is "0". A luminous plane gets the value "64". I can set this value for other objects, too. Which other states are there? What happens then?

Choose One
visualattributedrawflags
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Allister Wilson avatar image
1 Like"
Allister Wilson answered Phil BoBo edited

It's a bit mask, you can find the (complete? @phil.bobo) list of flags by searching for DRAW_FLAG under the main tree, the first result should lead you to MAIN:/project/exec/globals/fsmacros.

Here's the list in 16.2:

#define DRAW_FLAG_BILLBOARD_MASK 0x3
#define DRAW_FLAG_ONE_SIDED 0x4
#define DRAW_FLAG_TWO_SIDED 0x8
#define DRAW_FLAG_NO_DEPTH_TEST 0x10
#define DRAW_FLAG_REFLECTIVE 0x20
#define DRAW_FLAG_LUMINOUS 0x40
#define DRAW_FLAG_SCALE_CHILDREN 0x80
#define DRAW_FLAG_IGNORE_PICKING 0x100
#define DRAW_FLAG_NO_ON_DRAW 0x200
#define DRAW_FLAG_NO_ON_PRE_DRAW 0x400
#define DRAW_FLAG_SKIP_ALL_DRAW 0x800
#define DRAW_FLAG_CENTER_PORT_NAMES 0x1000
#define DRAW_FLAG_INOUT_PORT_NAMES 0x2000

So if you were to set the drawflags attribute to, for example:

DRAW_FLAG_LUMINOUS | DRAW_FLAG_SCALE_CHILDREN

You'd get the equivalent of checking the corresponding boxes in the object's properties.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

You can also set certain flags using bit-wise operators in FlexScript or C++:

// make an object draw luminous
set(drawflags(so()),get(drawflags(so())) | DRAW_FLAG_LUMINOUS);
// make an object not draw luminous
set(drawflags(so()),get(drawflags(so())) &~ DRAW_FLAG_LUMINOUS);
1 Like 1 ·
Arun Kr avatar image Arun Kr commented ·

Can anyone explain, what does this draw flags do?

0 Likes 0 ·