Blender V5.3
blender::bke::BlenderProject Class Reference

#include <BKE_blender_project.hh>

Public Member Functions

void set_name (StringRef name)
void set_root_path (StringRef root_path)
void set_ocio_config_path (StringRef ocio_config_path)
void set_splash_image_path (StringRef splash_image_path)
StringRefNull get_name () const
StringRefNull get_root_path () const
StringRefNull get_ocio_config_path () const
StringRefNull get_splash_image_path () const
int find_variable_index (ProjectVariable *var)
ProjectVariable * new_variable (StringRef name, ProjectVariableType type)
int remove_variable (ProjectVariable *var)
void move_variable (int from_index, int to_index)
void rename_variable (int variable_index, StringRef name)

Public Attributes

Vector< std::unique_ptr< ProjectVariable > > variables
int active_variable_index = 0
int active_asset_library_index
bool is_dirty = true
bool ocio_config_use_path = false

Detailed Description

A Blender project.

There is at most one active project at a time in Blender.

Definition at line 140 of file BKE_blender_project.hh.

Member Function Documentation

◆ find_variable_index()

int blender::bke::BlenderProject::find_variable_index ( ProjectVariable * var)

Get the array index of the given variable.

Returns
If the variable is found, the index of the variable. If not found, -1.

Definition at line 255 of file blender_project.cc.

References blender::BLI_assert(), and variables.

Referenced by remove_variable().

◆ get_name()

StringRefNull blender::bke::BlenderProject::get_name ( ) const

Definition at line 235 of file blender_project.cc.

References blender::StringRefNull::StringRefNull().

◆ get_ocio_config_path()

StringRefNull blender::bke::BlenderProject::get_ocio_config_path ( ) const

Definition at line 245 of file blender_project.cc.

References blender::StringRefNull::StringRefNull().

◆ get_root_path()

StringRefNull blender::bke::BlenderProject::get_root_path ( ) const

Definition at line 240 of file blender_project.cc.

References blender::StringRefNull::StringRefNull().

◆ get_splash_image_path()

StringRefNull blender::bke::BlenderProject::get_splash_image_path ( ) const

Definition at line 250 of file blender_project.cc.

References blender::StringRefNull::StringRefNull().

◆ move_variable()

void blender::bke::BlenderProject::move_variable ( int from_index,
int to_index )

Move the variable at from_index to to_index.

The other variables are shifted appropriately around this.

Both from_index and to_index must be valid indices in the list.

Definition at line 302 of file blender_project.cc.

References blender::BLI_assert(), is_dirty, and variables.

◆ new_variable()

ProjectVariable * blender::bke::BlenderProject::new_variable ( StringRef name,
ProjectVariableType type )

Create a new variable of the given name and type.

If name does not adhere to naming requirements, it is automatically altered to meet them by substituting invalid characters. name will also be modified if needed to make it unique among the current variables.

Definition at line 271 of file blender_project.cc.

References blender::bke::ensure_is_valid_project_variable_name(), is_dirty, rename_variable(), and variables.

◆ remove_variable()

int blender::bke::BlenderProject::remove_variable ( ProjectVariable * var)

Remove the given variable.

Returns
The index that the removed variable had, or -1 if the variable wasn't found.

Definition at line 283 of file blender_project.cc.

References active_variable_index, find_variable_index(), is_dirty, and variables.

◆ rename_variable()

void blender::bke::BlenderProject::rename_variable ( int variable_index,
StringRef name )

Rename the variable at the given index.

If name does not adhere to naming requirements, it is automatically altered to meet them by substituting invalid characters. name will also be modified if needed to make it unique among the current variables.

Definition at line 326 of file blender_project.cc.

References blender::BLI_assert(), blender::BLI_uniquename_cb(), blender::bke::ensure_is_valid_project_variable_name(), blender::IDProperty::name, and variables.

Referenced by new_variable().

◆ set_name()

void blender::bke::BlenderProject::set_name ( StringRef name)

Set the project's name.

Also marks the project as dirty.

The passed name should never be empty (which is invalid).

Definition at line 203 of file blender_project.cc.

References blender::BLI_assert(), is_dirty, and blender::blender::StringRefBase::is_empty().

◆ set_ocio_config_path()

void blender::bke::BlenderProject::set_ocio_config_path ( StringRef ocio_config_path)

Set the OpenColorIO configuration path and mark the project dirty.

Definition at line 221 of file blender_project.cc.

References is_dirty.

◆ set_root_path()

void blender::bke::BlenderProject::set_root_path ( StringRef root_path)

Set the project's root path.

Also marks the project as dirty.

The passed root_path should never be empty (which is invalid).

Definition at line 212 of file blender_project.cc.

References blender::BLI_assert(), is_dirty, and blender::blender::StringRefBase::is_empty().

◆ set_splash_image_path()

void blender::bke::BlenderProject::set_splash_image_path ( StringRef splash_image_path)

Set the splash screen image path and mark the project dirty.

Definition at line 228 of file blender_project.cc.

References is_dirty.

Member Data Documentation

◆ active_asset_library_index

int blender::bke::BlenderProject::active_asset_library_index

Definition at line 169 of file BKE_blender_project.hh.

◆ active_variable_index

int blender::bke::BlenderProject::active_variable_index = 0

Definition at line 167 of file BKE_blender_project.hh.

Referenced by remove_variable().

◆ is_dirty

bool blender::bke::BlenderProject::is_dirty = true

Whether the project has unsaved changes.

Default initializes to true because a freshly constructed BlenderProject is unsaved by definition.

Definition at line 177 of file BKE_blender_project.hh.

Referenced by move_variable(), new_variable(), remove_variable(), set_name(), set_ocio_config_path(), set_root_path(), and set_splash_image_path().

◆ ocio_config_use_path

bool blender::bke::BlenderProject::ocio_config_use_path = false

Show the OpenColorIO config a path even when empty or a preset, runtime UI state only.

Definition at line 182 of file BKE_blender_project.hh.

◆ variables

Vector<std::unique_ptr<ProjectVariable> > blender::bke::BlenderProject::variables

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