Blender V5.0
Freestyle::BlenderFileLoader Class Reference

#include <BlenderFileLoader.h>

Classes

struct  detri_t

Public Member Functions

 BlenderFileLoader (Render *re, ViewLayer *view_layer, Depsgraph *depsgraph)
virtual ~BlenderFileLoader ()
NodeGroupLoad ()
uint numFacesRead ()
void setRenderMonitor (RenderMonitor *iRenderMonitor)

Protected Member Functions

void insertShapeNode (Object *ob, Mesh *mesh, int id)
int testDegenerateTriangle (float v1[3], float v2[3], float v3[3])
int countClippedFaces (float v1[3], float v2[3], float v3[3], int clip[3])
void clipLine (float v1[3], float v2[3], float c[3], float z)
void clipTriangle (int numTris, float triCoords[][3], float v1[3], float v2[3], float v3[3], float triNormals[][3], float n1[3], float n2[3], float n3[3], bool edgeMarks[5], bool em1, bool em2, bool em3, const int clip[3])
void addTriangle (struct LoaderState *ls, float v1[3], float v2[3], float v3[3], float n1[3], float n2[3], float n3[3], bool fm, bool em1, bool em2, bool em3)

Protected Attributes

Render_re
Depsgraph * _depsgraph
NodeGroup_Scene
uint _numFacesRead
bool _smooth
float _z_near
float _z_far
float _z_offset
RenderMonitor_pRenderMonitor

Detailed Description

Definition at line 64 of file BlenderFileLoader.h.

Constructor & Destructor Documentation

◆ BlenderFileLoader()

Freestyle::BlenderFileLoader::BlenderFileLoader ( Render * re,
ViewLayer * view_layer,
Depsgraph * depsgraph )

◆ ~BlenderFileLoader()

Freestyle::BlenderFileLoader::~BlenderFileLoader ( )
virtual

Definition at line 44 of file BlenderFileLoader.cpp.

References _Scene.

Member Function Documentation

◆ addTriangle()

◆ clipLine()

void Freestyle::BlenderFileLoader::clipLine ( float v1[3],
float v2[3],
float c[3],
float z )
protected

Definition at line 182 of file BlenderFileLoader.cpp.

References Freestyle::c, i, v2, and z().

Referenced by clipTriangle().

◆ clipTriangle()

void Freestyle::BlenderFileLoader::clipTriangle ( int numTris,
float triCoords[][3],
float v1[3],
float v2[3],
float v3[3],
float triNormals[][3],
float n1[3],
float n2[3],
float n3[3],
bool edgeMarks[5],
bool em1,
bool em2,
bool em3,
const int clip[3] )
protected

Definition at line 208 of file BlenderFileLoader.cpp.

References _z_far, _z_near, BLI_assert, clipLine(), CLIPPED_BY_NEAR, copy_v3_v3(), i, NOT_CLIPPED, v, and v2.

Referenced by insertShapeNode().

◆ countClippedFaces()

int Freestyle::BlenderFileLoader::countClippedFaces ( float v1[3],
float v2[3],
float v3[3],
int clip[3] )
protected

Definition at line 120 of file BlenderFileLoader.cpp.

References _z_far, _z_near, CLIPPED_BY_FAR, CLIPPED_BY_NEAR, ELEM, G, G_DEBUG_FREESTYLE, i, NOT_CLIPPED, printf, sum(), v, and v2.

Referenced by insertShapeNode().

◆ insertShapeNode()

void Freestyle::BlenderFileLoader::insertShapeNode ( Object * ob,
Mesh * mesh,
int id )
protected

Definition at line 418 of file BlenderFileLoader.cpp.

References _depsgraph, _numFacesRead, _re, _Scene, _smooth, _z_offset, Freestyle::a, Freestyle::NodeGroup::AddChild(), Freestyle::NodeShape::AddRep(), addTriangle(), Geometry::attributes, Material::b, BKE_object_material_get(), Freestyle::GeomCleaner::CleanIndexedVertexArray(), clipTriangle(), copy_v3_v3(), blender::bke::mesh::corner_tris_calc(), Mesh::corners_num, countClippedFaces(), Freestyle::LoaderState::currentIndex, Freestyle::LoaderState::currentMIndex, DEG_get_evaluated(), Freestyle::GeomUtils::distPointSegment(), blender::bke::Edge, blender::bke::Face, Mesh::faces_num, Library::filepath, G, Material::g, G_DEBUG_FREESTYLE, i, Object::id, invert_m4_m4(), ID::lib, Material::line_col, Material::line_priority, blender::bke::AttributeAccessor::lookup_or_default(), Freestyle::LoaderState::maxBBox, MEM_freeN(), MEM_malloc_arrayN(), Freestyle::LoaderState::minBBox, mul_m4_m4m4(), mul_m4_v3(), mul_mat3_m4_v3(), Freestyle::BlenderFileLoader::detri_t::n, ID::name, name, Freestyle::VecMat::Vec< T, N >::norm(), normal_tri_v3(), normalize_v3(), Freestyle::VecMat::Vec< T, N >::normalizeSafe(), normals, Freestyle::LoaderState::pm, Freestyle::LoaderState::pmi, Freestyle::LoaderState::pn, Freestyle::LoaderState::pni, poly_to_tri_count(), printf, Freestyle::LoaderState::pv, Freestyle::LoaderState::pvi, Material::r, RE_GetCamera(), RE_GetCameraModelMatrix(), Freestyle::Rep::setBBox(), Freestyle::FrsMaterial::setDiffuse(), Freestyle::NodeShape::setFrsMaterial(), Freestyle::Rep::setId(), Freestyle::Rep::setLibraryPath(), Freestyle::FrsMaterial::setLine(), Freestyle::Rep::setName(), Freestyle::FrsMaterial::setPriority(), Freestyle::FrsMaterial::setShininess(), Freestyle::FrsMaterial::setSpecular(), Material::specb, Material::specg, Material::specr, Freestyle::testEdgeMark(), transpose_m4(), Freestyle::IndexedFaceSet::TRIANGLES, Freestyle::BlenderFileLoader::detri_t::v, v, v2, Freestyle::BlenderFileLoader::detri_t::viA, Freestyle::BlenderFileLoader::detri_t::viB, Freestyle::BlenderFileLoader::detri_t::viP, Freestyle::VecMat::Vec3< T >::x(), Freestyle::VecMat::Vec3< T >::y(), and Freestyle::VecMat::Vec3< T >::z().

Referenced by Load().

◆ Load()

◆ numFacesRead()

uint Freestyle::BlenderFileLoader::numFacesRead ( )
inline

Gets the number of read faces

Definition at line 74 of file BlenderFileLoader.h.

References _numFacesRead.

Referenced by Freestyle::Controller::LoadMesh().

◆ setRenderMonitor()

void Freestyle::BlenderFileLoader::setRenderMonitor ( RenderMonitor * iRenderMonitor)
inline

Modifiers

Definition at line 88 of file BlenderFileLoader.h.

References _pRenderMonitor.

Referenced by Freestyle::Controller::LoadMesh().

◆ testDegenerateTriangle()

int Freestyle::BlenderFileLoader::testDegenerateTriangle ( float v1[3],
float v2[3],
float v3[3] )
protected

Member Data Documentation

◆ _depsgraph

Depsgraph* Freestyle::BlenderFileLoader::_depsgraph
protected

Definition at line 131 of file BlenderFileLoader.h.

Referenced by BlenderFileLoader(), insertShapeNode(), and Load().

◆ _numFacesRead

uint Freestyle::BlenderFileLoader::_numFacesRead
protected

Definition at line 133 of file BlenderFileLoader.h.

Referenced by BlenderFileLoader(), insertShapeNode(), and numFacesRead().

◆ _pRenderMonitor

RenderMonitor* Freestyle::BlenderFileLoader::_pRenderMonitor
protected

Definition at line 141 of file BlenderFileLoader.h.

Referenced by BlenderFileLoader(), Load(), and setRenderMonitor().

◆ _re

Render* Freestyle::BlenderFileLoader::_re
protected

Definition at line 130 of file BlenderFileLoader.h.

Referenced by BlenderFileLoader(), insertShapeNode(), and Load().

◆ _Scene

NodeGroup* Freestyle::BlenderFileLoader::_Scene
protected

Definition at line 132 of file BlenderFileLoader.h.

Referenced by BlenderFileLoader(), insertShapeNode(), Load(), and ~BlenderFileLoader().

◆ _smooth

bool Freestyle::BlenderFileLoader::_smooth
protected

Definition at line 137 of file BlenderFileLoader.h.

Referenced by BlenderFileLoader(), and insertShapeNode().

◆ _z_far

float Freestyle::BlenderFileLoader::_z_far
protected

Definition at line 138 of file BlenderFileLoader.h.

Referenced by clipTriangle(), countClippedFaces(), and Load().

◆ _z_near

float Freestyle::BlenderFileLoader::_z_near
protected

Definition at line 138 of file BlenderFileLoader.h.

Referenced by clipTriangle(), countClippedFaces(), and Load().

◆ _z_offset

float Freestyle::BlenderFileLoader::_z_offset
protected

Definition at line 139 of file BlenderFileLoader.h.

Referenced by insertShapeNode(), and Load().


The documentation for this class was generated from the following files: