lib
convert_to_fps(source_value)
Convert value into fps value.
Non string values are kept untouched. String is tried to convert. Valid values: "1000" "1000.05" "1000,05" ",05" ".05" "1000," "1000." "1000/1000" "1000.05/1000" "1000/1000.05" "1000.05/1000.05" "1000,05/1000" "1000/1000,05" "1000,05/1000,05"
Invalid values: "/" "/1000" "1000/" "," "." ...any other string
Returns:
Name | Type | Description |
---|---|---|
float | Converted value. |
Raises:
Type | Description |
---|---|
InvalidFpsValue | When value can't be converted to float. |
Source code in client/ayon_ftrack/common/lib.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
create_chunks(iterable, chunk_size=None)
Separate iterable into multiple chunks by size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iterable | Iterable[Any] | Object that will be separated into chunks. | required |
chunk_size | int | Size of one chunk. Default value is 200. | None |
Returns:
Type | Description |
---|---|
List[List[Any]]: Chunked items. |
Source code in client/ayon_ftrack/common/lib.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
get_ftrack_icon_url(icon_name, addon_version, addon_name=None)
Helper to get icon url to server.
The existence of file is not validated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
icon_name | str | Name of icon filename. | required |
addon_version | str | Version of addon. | required |
addon_name | Optional[str] | Name of addon. For development purposes. Default value 'ftrack'. | None |
Returns:
Name | Type | Description |
---|---|---|
str | Url to icon on server. |
Source code in client/ayon_ftrack/common/lib.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
|
get_ftrack_public_url(*args, addon_version, addon_name=None)
Url to public path in ftrack addon.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args | tuple[str] | Subpaths in 'public' dir. | () |
addon_version | str | Version of addon. | required |
addon_name | Optional[str] | Name of addon. This is for development purposes. Default value 'ftrack'. | None |
Returns:
Name | Type | Description |
---|---|---|
str | Url to public file on server in ftrack addon. |
Source code in client/ayon_ftrack/common/lib.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
|
get_host_ip()
Get IP of machine.
Returns:
Type | Description |
---|---|
Union[str, None]: IP address of machine or None if could not be detected. |
Source code in client/ayon_ftrack/common/lib.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
get_service_ftrack_icon_url(icon_name, addon_version=None, addon_name=None)
Icon url to server for service process.
Information about addon version are taken from registered service in 'ayon_api'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
icon_name | str | Name of icon filename. | required |
addon_version | Optional[str] | Version of addon. Version from registered service is used if not passed. For development purposes. | None |
addon_name | Optional[str] | Name of addon. For development purposes. | None |
Returns:
Name | Type | Description |
---|---|---|
str | Url to icon on server. |
Source code in client/ayon_ftrack/common/lib.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
|
is_ftrack_enabled_in_settings(project_settings)
Check if ftrack is enabled in ftrack project settings.
This function expect settings for a specific project. It is not checking if ftrack is enabled in general.
Project settings gives option to disable ftrack integration per project. That should disable most of ftrack integration functionality, especially pipeline integration > publish plugins, and some automations like event server handlers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_settings | dict[str, Any] | ftrack project settings. | required |
Returns:
Name | Type | Description |
---|---|---|
bool | True if ftrack is enabled in project settings. |
Source code in client/ayon_ftrack/common/lib.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
is_string_number(value)
Can string value be converted to number (float).
Source code in client/ayon_ftrack/common/lib.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
join_filter_values(values)
Prepare values to be used for filtering in ftrack query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Iterable[str] | Values to join for filter query. | required |
Returns:
Name | Type | Description |
---|---|---|
str | Prepared values for ftrack query. |
Source code in client/ayon_ftrack/common/lib.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|