npxpy.nodes.structures.Text
Bases: Structure
A class representing a text node.
Attributes:
Name | Type | Description |
---|---|---|
text |
str
|
The text content. |
font_size |
Union[float, int]
|
The font size of the text. |
height |
Union[float, int]
|
The height of the text. |
Source code in npxpy/nodes/structures.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
|
font_size
property
writable
The font size of the text.
height
property
writable
The height of the text.
text
property
writable
The text content of the node.
__init__(preset, name='Text', text='Text', font_size=10.0, height=5.0, slicing_origin='scene_bottom', slicing_offset=0.0, priority=0, expose_individually=False, position=[0, 0, 0], rotation=[0.0, 0.0, 0.0], color='lightblue')
Initialize a Text node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preset
|
Preset
|
The preset associated with the text. |
required |
name
|
str
|
The name of the text. |
'Text'
|
text
|
str
|
The text content. |
'Text'
|
font_size
|
Union[float, int]
|
The font size of the text. Must be greater than 0. |
10.0
|
height
|
Union[float, int]
|
The height of the text. Must be greater than 0. |
5.0
|
slicing_origin
|
str
|
The origin for slicing. Must be one of 'structure_center', 'zero', 'scene_top', 'scene_bottom', 'structure_top', 'structure_bottom', 'scene_center'. |
'scene_bottom'
|
slicing_offset
|
Union[float, int]
|
The offset for slicing. |
0.0
|
priority
|
int
|
The priority of the text. Must be >= 0. |
0
|
expose_individually
|
bool
|
Flag to expose the text individually. |
False
|
position
|
List[Union[float, int]]
|
The position of the text [x, y, z]. |
[0, 0, 0]
|
rotation
|
List[Union[float, int]]
|
The rotation of the text [psi, theta, phi]. |
[0.0, 0.0, 0.0]
|
Source code in npxpy/nodes/structures.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
|
auto_load(project)
Load passed presets to passed project if the flags are set.
Source code in npxpy/nodes/structures.py
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
|
to_dict()
Convert the text to a dictionary representation.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
The dictionary representation of the text. |
Source code in npxpy/nodes/structures.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
|