# panda3d.egg.EggGroup¶

class EggGroup

The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nodes.

Inheritance diagram

enum BillboardType
enumerator BT_none = 0

The bits here must correspond to those in Flags, below.

enumerator BT_axis = 32
enumerator BT_point_camera_relative = 64
enumerator BT_point_world_relative = 128
enum BlendMode

These correspond to ColorBlendAttrib::Mode (but not numerically).

enumerator BM_unspecified = 0
enumerator BM_none = 1
enumerator BM_add = 2
enumerator BM_subtract = 3
enumerator BM_inv_subtract = 4
enumerator BM_min = 5
enumerator BM_max = 6
enum BlendOperand

These correspond to ColorBlendAttrib::Operand (but not numerically).

enumerator BO_unspecified = 0
enumerator BO_zero = 1
enumerator BO_one = 2
enumerator BO_incoming_color = 3
enumerator BO_one_minus_incoming_color = 4
enumerator BO_fbuffer_color = 5
enumerator BO_one_minus_fbuffer_color = 6
enumerator BO_incoming_alpha = 7
enumerator BO_one_minus_incoming_alpha = 8
enumerator BO_fbuffer_alpha = 9
enumerator BO_one_minus_fbuffer_alpha = 10
enumerator BO_constant_color = 11
enumerator BO_one_minus_constant_color = 12
enumerator BO_constant_alpha = 13
enumerator BO_one_minus_constant_alpha = 14
enumerator BO_incoming_color_saturate = 15
enumerator BO_color_scale = 16
enumerator BO_one_minus_color_scale = 17
enumerator BO_alpha_scale = 18
enumerator BO_one_minus_alpha_scale = 19
enum CollideFlags
enumerator CF_none = 0

The bits here must correspond to those in Flags, below, and they must fit within F_collide_flags.

enumerator CF_descend = 1048576
enumerator CF_event = 2097152
enumerator CF_keep = 4194304
enumerator CF_solid = 8388608
enumerator CF_center = 16777216
enumerator CF_turnstile = 33554432
enumerator CF_level = 67108864
enumerator CF_intangible = 134217728
enum CollisionSolidType
enumerator CST_none = 0

The bits here must correspond to those in Flags, below, and they must fit within F_cs_type.

enumerator CST_plane = 65536
enumerator CST_polygon = 131072
enumerator CST_polyset = 196608
enumerator CST_sphere = 262144
enumerator CST_tube = 327680
enumerator CST_inv_sphere = 393216
enumerator CST_box = 458752
enumerator CST_floor_mesh = 524288
enum DCSType
enumerator DC_unspecified = 0

The bits here must correspond to those in Flags2, below.

enumerator DC_none = 16
enumerator DC_local = 32
enumerator DC_net = 48
enumerator DC_no_touch = 64
enumerator DC_default = 80
enum DartType
enumerator DT_none = 0

The bits here must correspond to those in Flags, below.

enumerator DT_structured = 268435456
enumerator DT_sync = 536870912
enumerator DT_nosync = 805306368
enumerator DT_default = 1073741824
enum GroupType

These bits are all stored somewhere in _flags.

enumerator GT_invalid = -1

The bits here must correspond to those in Flags, below.

enumerator GT_group = 0
enumerator GT_instance = 1
enumerator GT_joint = 2
class TagData

alias of map_string_string

class VertexRef

alias of map_PT_EggVertex_double

__init__(copy: EggGroup) → None
__init__(name: str) → None
addGroupRef(group: EggGroup) → None

Adds a new <Ref> entry to the group. This declares an internal reference to another node, and is used to implement scene-graph instancing; it is only valid if the group_type is GT_instance.

addObjectType(object_type: str) → None
assign(copy: EggGroup) → EggGroup
Return type

EggGroup

property billboard_center

Getter Setter

Sets the point around which the billboard will rotate, if this node contains a billboard specification.

If a billboard type is given but no billboard_center is specified, then the group node is treated as an <Instance>, and the billboard rotates around the origin. If, however, a billboard_center is specified, then the group node is not treated as an <Instance>, and the billboard rotates around the specified point.

The point is in the same coordinate system as the vertices of this node: usually global, but possibly local if there is an <Instance> somewhere above. Specifically, this is the coordinate system defined by get_vertex_frame().

Return type

LPoint3d

property billboard_type

Getter Setter

Return type

BillboardType

property blend_color
Getter

Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not.

Setter

Return type

LColor

property blend_mode

Getter Setter

Return type

BlendMode

property blend_operand_a

Getter Setter

Return type

BlendOperand

property blend_operand_b

Getter Setter

Return type

BlendOperand

clearBillboardCenter() → None
clearBlendColor() → None

Removes the blend color specification.

clearCollideMask() → None
clearCollisionName() → None
clearDefaultPose() → None

Removes the initial pose transform. See setDefaultPose().

clearFromCollideMask() → None
clearGroupRefs() → None

Removes all of the <Ref> entries within this group. See addGroupRef().

clearIndexedFlag() → None
clearIntoCollideMask() → None
clearLod() → None
clearObjectTypes() → None
clearTag(key: str) → None

Removes the value defined for this key on this particular node. After a call to clearTag(), hasTag() will return false for the indicated key.

property collide_flags

Getter Setter

Return type

CollideFlags

property collide_mask

Getter Setter

Return type

property collision_name

Getter Setter

Return type

string

property cs_type

Getter Setter

Return type

CollisionSolidType

property dart_type

Getter Setter

Return type

DartType

property dcs_type

Getter Setter

Return type

DCSType

property decal_flag

Getter Setter

Return type

bool

property default_pose
Getter

Returns a read-only accessor to the initial pose transform. This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group’s <Transform> entry, which defines the (eventual) space of the group’s vertices.

Setter

Replaces the initial pose transform. This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group’s <Transform> entry, which defines the (eventual) space of the group’s vertices.

Return type

EggTransform

determineAlphaMode() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has an alpha_mode other than AM_unspecified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

determineBin() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a bin specified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

determineDecal() → bool

Walks back up the hierarchy, looking for an EggGroup at this level or above that has the “decal” flag set. Returns the value of the decal flag if it is found, or false if it is not.

In other words, returns true if the “decal” flag is in effect for the indicated node, false otherwise.

determineDepthOffset() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_offset specified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

determineDepthTestMode() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_test_mode other than DTM_unspecified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

determineDepthWriteMode() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a depth_write_mode other than DWM_unspecified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

determineDrawOrder() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a draw_order specified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

determineIndexed() → bool

Walks back up the hierarchy, looking for an EggGroup at this level or above that has the “indexed” scalar set. Returns the value of the indexed scalar if it is found, or false if it is not.

In other words, returns true if the “indexed” flag is in effect for the indicated node, false otherwise.

determineVisibilityMode() → EggRenderMode

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this group that has a visibility_mode other than VM_unspecified. Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Return type

EggRenderMode

property direct_flag

Getter Setter

Return type

bool

property from_collide_mask

Getter Setter

Return type

getBillboardCenter() → LPoint3d
Return type

LPoint3d

getBillboardType() → BillboardType
Return type

BillboardType

getBlendColor() → LColor

Returns the blend color if one has been specified, or (0, 0, 0, 0) if one has not.

Return type

LColor

getBlendMode() → BlendMode
Return type

BlendMode

getBlendOperandA() → BlendOperand
Return type

BlendOperand

getBlendOperandB() → BlendOperand
Return type

BlendOperand

static getClassType() → TypeHandle
Return type

TypeHandle

getCollideFlags() → CollideFlags
Return type

CollideFlags

getCollideMask() → CollideMask
Return type

getCollisionName() → str
getCsType() → CollisionSolidType
Return type

CollisionSolidType

getDartType() → DartType
Return type

DartType

getDcsType() → DCSType
Return type

DCSType

getDecalFlag() → bool
getDefaultPose() → EggTransform

Returns a read-only accessor to the initial pose transform. This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group’s <Transform> entry, which defines the (eventual) space of the group’s vertices.

Return type

EggTransform

getDirectFlag() → bool
getFromCollideMask() → CollideMask
Return type

getGroupRef(n: int) → EggGroup

Returns the nth <Ref> entry within this group. See addGroupRef().

Return type

EggGroup

getGroupRefs() → list
getGroupType() → GroupType
Return type

GroupType

getIndexedFlag() → bool
getIntoCollideMask() → CollideMask
Return type

getLod() → EggSwitchCondition
Return type

EggSwitchCondition

getModelFlag() → bool
getNofogFlag() → bool
getNumGroupRefs() → int

Returns the number of <Ref> entries within this group. See addGroupRef().

getNumObjectTypes() → int
getObjectType(index: int) → str
getObjectTypes() → list
getOccluderFlag() → bool
getPolylightFlag() → bool
getPortalFlag() → bool
getScrollR() → float
getScrollU() → float
getScrollV() → float
getScrollW() → float
getSwitchFlag() → bool
getSwitchFps() → float
getTag(key: str) → str

Retrieves the user-defined value that was previously set on this node for the particular key, if any. If no value has been previously set, returns the empty string.

getTexlistFlag() → bool
getVertexMembership(vert: EggVertex) → float

Returns the amount of membership of the indicated vertex in this group. If the vertex is not reffed by the group, returns 0.

property group_type

Getter Setter

Return type

GroupType

hasBillboardCenter() → bool
hasBlendColor() → bool

Returns true if the blend color has been specified, false otherwise.

hasCollideMask() → bool
hasCollisionName() → bool
hasDcsType() → bool

Returns true if the specified DCS type is not DC_none and not DC_unspecified.

hasFromCollideMask() → bool
hasIndexedFlag() → bool
hasIntoCollideMask() → bool
hasLod() → bool
hasObjectType(object_type: str) → bool

Returns true if the indicated object type has been added to the group, or false otherwise.

hasScrollingUvs() → bool
hasTag(key: str) → bool

Returns true if a value has been defined on this node for the particular key (even if that value is the empty string), or false if no value has been set.

property indexed_flag

Getter Setter

If this flag is true, geometry at this node and below will be generated as indexed geometry.

Return type

bool

property into_collide_mask

Getter Setter

Return type

isInstanceType() → bool

Returns true if this group is an instance type node; i.e. it begins the root of a local coordinate space. This is not related to instancing (multiple copies of a node in a scene graph).

This also includes the case of the node including a billboard flag without an explicit center, which implicitly makes the node behave like an instance.

isJoint() → bool

Returns true if this particular node represents a <Joint> entry or not. This is a handy thing to know since Joints are sorted to the end of their sibling list when writing an egg file. See EggGroupNode::write().

property lod

Getter Setter

Return type

EggSwitchCondition

property model_flag

Getter Setter

Return type

bool

modifyDefaultPose() → EggTransform

Returns a writable accessor to the initial pose transform. This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group’s <Transform> entry, which defines the (eventual) space of the group’s vertices.

Return type

EggTransform

property nofog_flag

Getter Setter

Return type

bool

property object_types
Return type

Sequence[string]

property occluder_flag

Getter Setter

Return type

bool

property portal_flag

Getter Setter

Return type

bool

refVertex(vert: EggVertex, membership: float) → None

Adds the vertex to the set of those referenced by the group, at the indicated membership level. If the vertex is already being referenced, increases the membership amount by the indicated amount.

removeGroupRef(n: int) → None

Removes the nth <Ref> entry within this group. See addGroupRef().

removeObjectType(object_type: str) → bool

Removes the first instance of the indicated object type from the group if it is present. Returns true if the object type was found and removed, false otherwise.

property scroll_r
Return type

float

property scroll_u
Return type

float

property scroll_v
Return type

float

property scroll_w
Return type

float

setBillboardCenter(billboard_center: LPoint3d) → None

Sets the point around which the billboard will rotate, if this node contains a billboard specification.

If a billboard type is given but no billboard_center is specified, then the group node is treated as an <Instance>, and the billboard rotates around the origin. If, however, a billboard_center is specified, then the group node is not treated as an <Instance>, and the billboard rotates around the specified point.

The point is in the same coordinate system as the vertices of this node: usually global, but possibly local if there is an <Instance> somewhere above. Specifically, this is the coordinate system defined by get_vertex_frame().

setBillboardType(type: BillboardType) → None
setBlendColor(blend_color: LColor) → None
setBlendMode(blend_mode: BlendMode) → None
setBlendOperandA(blend_operand_a: BlendOperand) → None
setBlendOperandB(blend_operand_b: BlendOperand) → None
setCollideFlags(flags: int) → None
setCollideMask(mask: CollideMask) → None
setCollisionName(collision_name: str) → None
setCsType(type: CollisionSolidType) → None
setDartType(type: DartType) → None
setDcsType(type: DCSType) → None
setDecalFlag(flag: bool) → None
setDefaultPose(transform: EggTransform) → None

Replaces the initial pose transform. This is the <DefaultPose> entry for a Joint, and defines only the initial transform pose for the unanimated joint; it has nothing to do with the group’s <Transform> entry, which defines the (eventual) space of the group’s vertices.

setDirectFlag(flag: bool) → None
setFromCollideMask(mask: CollideMask) → None
setGroupType(type: GroupType) → None
setIndexedFlag(flag: bool) → None

If this flag is true, geometry at this node and below will be generated as indexed geometry.

setIntoCollideMask(mask: CollideMask) → None
setLod(lod: EggSwitchCondition) → None
setModelFlag(flag: bool) → None
setNofogFlag(flag: bool) → None
setOccluderFlag(flag: bool) → None
setPolylightFlag(flag: bool) → None
setPortalFlag(flag: bool) → None
setScrollR(r_speed: float) → None
setScrollU(u_speed: float) → None
setScrollV(v_speed: float) → None
setScrollW(w_speed: float) → None
setSwitchFlag(flag: bool) → None
setSwitchFps(fps: float) → None
setTag(key: str, value: str) → None

Associates a user-defined value with a user-defined key which is stored on the node. This value has no meaning to Panda; but it is stored indefinitely on the node until it is requested again. This value will be copied to the PandaNode that is created for this particular EggGroup if the egg file is loaded as a scene.

Each unique key stores a different string value. There is no effective limit on the number of different keys that may be stored or on the length of any one key’s value.

setTexlistFlag(flag: bool) → None
setVertexMembership(vert: EggVertex, membership: float) → None

Explicitly sets the net membership of the indicated vertex in this group to the given value.

stealVrefs(other: EggGroup) → None

Moves all of the vertex references from the indicated other group into this one. If a given vertex was previously shared by both groups, the relative memberships will be summed.

static stringBillboardType(strval: str) → BillboardType

Returns the EggGroupBillboardType value associated with the given string representation, or BT_none if the string does not match any known EggGroupBillboardType value.

Return type

BillboardType

static stringBlendMode(strval: str) → BlendMode

Returns the EggGroupBlendMode value associated with the given string representation, or BM_none if the string does not match any known EggGroupBlendMode.

Return type

BlendMode

static stringBlendOperand(strval: str) → BlendOperand

Returns the EggGroupBlendOperand value associated with the given string representation, or BO_none if the string does not match any known EggGroupBlendOperand.

Return type

BlendOperand

static stringCollideFlags(strval: str) → CollideFlags

Returns the EggGroupCollideFlags value associated with the given string representation, or CF_none if the string does not match any known EggGroupCollideFlags value. This only recognizes a single keyword; it does not attempt to parse a string of keywords.

Return type

CollideFlags

static stringCsType(strval: str) → CollisionSolidType

Returns the EggGroupCollisionSolidType value associated with the given string representation, or CST_none if the string does not match any known EggGroupCollisionSolidType value.

Return type

CollisionSolidType

static stringDartType(strval: str) → DartType

Returns the EggGroupDartType value associated with the given string representation, or DT_none if the string does not match any known EggGroupDartType value.

Return type

DartType

static stringDcsType(strval: str) → DCSType

Returns the EggGroupDCSType value associated with the given string representation, or DC_unspecified if the string does not match any known EggGroupDCSType value.

Return type

DCSType

static stringGroupType(strval: str) → GroupType

Returns the EggGroupGroupType value associated with the given string representation, or GT_invalid if the string does not match any known EggGroupGroupType value.

Return type

GroupType

property switch_flag

Getter Setter

Return type

bool

property switch_fps

Getter Setter

Return type

float

testVrefIntegrity() → None
property texlist_flag

Getter Setter

Return type

bool

unrefAllVertices() → None

Removes all vertices from the reference list.

unrefVertex(vert: EggVertex) → None

Removes the vertex from the set of those referenced by the group. Does nothing if the vertex is not already reffed.

write(out: ostream, indent_level: int) → None

Writes the group and all of its children to the indicated output stream in Egg format.

writeBillboardFlags(out: ostream, indent_level: int) → None

Writes just the <Billboard> entry and related fields to the indicated ostream.

writeCollideFlags(out: ostream, indent_level: int) → None

Writes just the <Collide> entry and related fields to the indicated ostream.

writeDecalFlags(out: ostream, indent_level: int) → None

Writes the flags related to decaling, if any.

writeModelFlags(out: ostream, indent_level: int) → None

Writes the <Model> flag and related flags to the indicated ostream.

writeObjectTypes(out: ostream, indent_level: int) → None

Writes just the <ObjectTypes> entries, if any, to the indicated ostream.

writeRenderMode(out: ostream, indent_level: int) → None

Writes the flags inherited from EggRenderMode and similar flags that control obscure render effects.

writeSwitchFlags(out: ostream, indent_level: int) → None

Writes the <Switch> flag and related flags to the indicated ostream.

writeTags(out: ostream, indent_level: int) → None

Writes just the <Tag> entries, if any, to the indicated ostream.