EggVertex

from panda3d.egg import EggVertex
class EggVertex

Bases:

Bases: EggObject, EggAttributes

Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.

Inheritance diagram

Inheritance diagram of EggVertex

__init__()
__init__(copy: EggVertex)

Copies all properties of the vertex except its vertex pool, index number, and group membership.

property _dxyzs EggMorphVertexList

getter for EggMorphVertexList EggVertex::_dxyzs;

assign(copy: EggVertex) EggVertex

Copies all properties of the vertex except its vertex pool, index number, and group membership.

clear_aux()

Removes all auxiliary data from the vertex.

clear_aux(name: str)

Removes the named auxiliary data from the vertex.

clear_grefs()

Removes all group references from the vertex, so that it is not assigned to any group.

clear_uv()

Removes all UV coordinate pairs from the vertex.

clear_uv(name: str)

Removes the named UV coordinate pair from the vertex, along with any UV morphs.

compare_to(other: EggVertex) int

An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices.

Group membership is not considered in this comparison. This is somewhat problematic, but cannot easily be helped, because considering group membership would make it difficult to add and remove groups from vertices. It also makes it impossible to meaningfully compare with a concrete EggVertex object (which cannot have group memberships).

However, this is not altogether bad, because two vertices that are identical in all other properties should generally also be identical in group memberships, else the vertices will tend to fly apart when the joints animate.

copy_grefs_from(other: EggVertex)

Copies all the group references from the other vertex onto this one. This assigns the current vertex to exactly the same groups, with exactly the same memberships, as the given one.

Warning: only an EggVertex allocated from the free store may have groups assigned to it. Do not attempt to call this on a temporary concrete EggVertex object; a core dump will certainly result.

get_aux(name: str) panda3d.core.LVecBase4d

Returns the named auxiliary data quadruple on the vertex. It is an error to call this if has_aux(name) returned false.

get_aux_obj(name: str) EggVertexAux

Returns the named EggVertexAux object, which defines the auxiliary data for this name. This object might be shared between multiple vertices. You should not attempt to modify this object; instead, call modify_aux_object to return a modifiable pointer.

static get_class_type() panda3d.core.TypeHandle
get_external_index() int

Returns the number set by set_external_index(). See set_external_index().

get_external_index2() int

Returns the number set by set_external_index2(). See set_external_index2().

get_index() int

Returns the index number of the vertex within its pool.

get_num_dimensions() int

get_pos[123] return the pos as the corresponding type. It is an error to call any of these without first verifying that get_num_dimensions() matches the desired type. However, get_pos4() may always be called; it returns the pos as a four-component point in homogeneous space (with a 1.0 in the last position if the pos has fewer than four components).

get_num_global_coord() int

Returns the number of primitives that own this vertex whose vertices are interpreted in the global coordinate system.

get_num_local_coord() int

Returns the number of primitives that own this vertex whose vertices are interpreted to be in a local coordinate system.

get_pool() EggVertexPool

Returns the vertex pool this vertex belongs in. This may be NULL if the vertex has not been added to a pool.

get_pos1() float

Only valid if get_num_dimensions() returns 1. Returns the position as a one-dimensional value.

get_pos2() panda3d.core.LPoint2d

Only valid if get_num_dimensions() returns 2. Returns the position as a two-dimensional value.

get_pos3() panda3d.core.LVertexd

Valid if get_num_dimensions() returns 3 or 4. Returns the position as a three-dimensional value.

get_pos4() panda3d.core.LPoint4d

This is always valid, regardless of the value of get_num_dimensions(). It returns the position as a four-dimensional value. If the pos has fewer than four dimensions, this value represents the pos extended into four- dimensional homogenous space, e.g. by adding 1 as the fourth component.

get_uv() panda3d.core.LTexCoordd

Returns the unnamed UV coordinate pair on the vertex. It is an error to call this if has_uv() has returned false.

This is the more restrictive interface, and is generally useful only in the absence of multitexturing; see get_uv(name) for the interface that supports multitexturing.

get_uv(name: str) panda3d.core.LTexCoordd

Returns the named UV coordinate pair on the vertex. It is an error to call this if has_uv(name) returned false.

get_uv_obj(name: str) EggVertexUV

Returns the named EggVertexUV object, which defines both the UV coordinate pair for this name and the UV morphs. This object might be shared between multiple vertices. You should not attempt to modify this object; instead, call modify_uv_object to return a modifiable pointer.

get_uvw(name: str) panda3d.core.LTexCoord3d

Returns the named UV coordinate triple on the vertex. It is an error to call this if has_uvw(name) returned false.

has_aux() bool

Returns true if the vertex has any auxiliary data, false otherwise.

has_aux(name: str) bool

Returns true if the vertex has the named auxiliary data quadruple.

has_gref(group: EggGroup) bool

Returns true if the indicated group references this vertex, false otherwise.

has_pref(prim: EggPrimitive) int

Returns the number of times the vertex appears in the indicated primitive, or 0 if it does not appear.

has_uv() bool

Returns true if the vertex has an unnamed UV coordinate pair, false otherwise.

This is the more restrictive interface, and is generally useful only in the absence of multitexturing; see has_uv(name) for the interface that supports multitexturing.

has_uv(name: str) bool

Returns true if the vertex has the named UV coordinate pair, and the named UV coordinate pair is 2-d, false otherwise.

has_uvw(name: str) bool

Returns true if the vertex has the named UV coordinate triple, and the named UV coordinate triple is 3-d, false otherwise.

is_forward_reference() bool

Returns true if the vertex is a forward reference to some vertex that hasn’t been defined yet. In this case, the vertex may not have any properties filled in yet.

This can only happen if you implicitly create a vertex via EggVertexPool.get_forward_vertex(). Presumably, when the vertex pool is later filled in, this vertex will be replaced with real data.

static make_average(first: EggVertex, second: EggVertex) EggVertex

Creates a new vertex that lies in between the two given vertices. The attributes for the UV sets they have in common are averaged.

Both vertices need to be either in no pool, or in the same pool. In the latter case, the new vertex will be placed in that pool.

modify_aux_obj(name: str) EggVertexAux

Returns a modifiable pointer to the named EggVertexAux object, which defines the auxiliary data for this name. Returns NULL if there is no such named UV object.

modify_uv_obj(name: str) EggVertexUV

Returns a modifiable pointer to the named EggVertexUV object, which defines both the UV coordinate pair for this name and the UV morphs. Returns NULL if there is no such named UV object.

output(out: panda3d.core.ostream)
set_aux(name: str, aux: panda3d.core.LVecBase4d)

Sets the indicated auxiliary data quadruple on the vertex. This replaces any auxiliary data with the same name already on the vertex.

set_aux_obj(vertex_aux: EggVertexAux)

Sets the indicated EggVertexAux on the vertex. This replaces any auxiliary data with the same name already on the vertex.

set_external_index(external_index: int)

Sets a special index number that is associated with the EggVertex (but is not written to the egg file). This number is not interpreted by any egg code; it is simply maintained along with the vertex. It is used to differentiate otherwise identical vertices in EggVertexPool.create_unique_vertex(), however.

The intention of this number is as an aid for file converters, to associate an EggVertex back to the index number of the original source vertex.

set_external_index2(external_index2: int)

Similar to set_external_index(), but this is a different number which may be used for a different purpose by the calling code. The egg library does not assign any meaning to this number or use it in any way.

set_pos(pos: panda3d.core.LPoint2d)

Sets the vertex position. This variant sets the vertex to a two- dimensional value.

set_pos(pos: panda3d.core.LPoint3d)

Sets the vertex position. This variant sets the vertex to a three- dimensional value.

set_pos(pos: panda3d.core.LPoint4d)

Sets the vertex position. This variant sets the vertex to a four- dimensional value.

set_pos(pos: float)

Sets the vertex position. This variant sets the vertex to a one- dimensional value.

set_pos4(pos: panda3d.core.LPoint4d)

This special flavor of set_pos() sets the vertex as a four-component value, but does not change the set number of dimensions. It’s handy for retrieving the vertex position via get_pos4(), manipulating it, then storing it back again, without worrying about the number of dimensions it actually had.

set_uv(texCoord: panda3d.core.LTexCoordd)

Replaces the unnamed UV coordinate pair on the vertex with the indicated value.

This is the more restrictive interface, and is generally useful only in the absence of multitexturing; see set_uv(name, uv) for the interface that supports multitexturing.

set_uv(name: str, texCoord: panda3d.core.LTexCoordd)

Sets the indicated UV coordinate pair on the vertex. This replaces any UV coordinate pair with the same name already on the vertex, but preserves UV morphs.

set_uv_obj(vertex_uv: EggVertexUV)

Sets the indicated EggVertexUV on the vertex. This replaces any UV coordinate pair with the same name already on the vertex, including UV morphs.

set_uvw(name: str, texCoord: panda3d.core.LTexCoord3d)

Sets the indicated UV coordinate triple on the vertex. This replaces any UV coordinate pair or triple with the same name already on the vertex, but preserves UV morphs.

sorts_less_than(other: EggVertex) bool

An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices.

test_gref_integrity()
test_pref_integrity()
transform(mat: panda3d.core.LMatrix4d)

Applies the indicated transformation matrix to the vertex.

write(out: panda3d.core.ostream, indent_level: int)

Writes the vertex to the indicated output stream in Egg format.