Blender V5.0
BKE_uvproject.h File Reference

Go to the source code of this file.

Functions

struct ProjCameraInfoBKE_uvproject_camera_info (const struct Object *ob, const float rotmat[4][4], float winx, float winy)
void BKE_uvproject_from_camera (float target[2], float source[3], struct ProjCameraInfo *uci)
void BKE_uvproject_from_view (float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy)
void BKE_uvproject_from_view_ortho (float target[2], float source[3], const float rotmat[4][4])
void BKE_uvproject_camera_info_scale (ProjCameraInfo *uci, float scale_x, float scale_y)
void BKE_uvproject_camera_info_free (ProjCameraInfo *uci)

Function Documentation

◆ BKE_uvproject_camera_info()

struct ProjCameraInfo * BKE_uvproject_camera_info ( const struct Object * ob,
const float rotmat[4][4],
float winx,
float winy )

Create UV info from the camera, needs to be freed.

Parameters
rotmatcan be obedit->object_to_world().ptr() when uv project is used.
winx,winycan be from scene->r.xsch / ysch.

Referenced by uv_from_view_exec(), and uvprojectModifier_do().

◆ BKE_uvproject_camera_info_free()

void BKE_uvproject_camera_info_free ( ProjCameraInfo * uci)

Definition at line 177 of file uvproject.cc.

References MEM_freeN().

Referenced by uv_from_view_exec().

◆ BKE_uvproject_camera_info_scale()

void BKE_uvproject_camera_info_scale ( ProjCameraInfo * uci,
float scale_x,
float scale_y )

So we can adjust scale with keeping the struct private.

Definition at line 193 of file uvproject.cc.

References ProjCameraInfo::xasp, and ProjCameraInfo::yasp.

Referenced by uvprojectModifier_do().

◆ BKE_uvproject_from_camera()

◆ BKE_uvproject_from_view()

void BKE_uvproject_from_view ( float target[2],
float source[3],
float persmat[4][4],
float rotmat[4][4],
float winx,
float winy )

Apply uv from perspective matrix.

Parameters
persmatCan be rv3d->persmat.

Definition at line 84 of file uvproject.cc.

References copy_v3_v3(), fabsf, mul_m4_v4(), x, and y.

Referenced by uv_from_view_exec().

◆ BKE_uvproject_from_view_ortho()

void BKE_uvproject_from_view_ortho ( float target[2],
float source[3],
const float rotmat[4][4] )

Apply orthographic UVs.

Definition at line 182 of file uvproject.cc.

References mul_v3_m4v3().

Referenced by uv_from_view_exec().