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
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 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | |
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
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 | |
auto_load(project)
Load passed presets to passed project if the flags are set.
Source code in npxpy/nodes/structures.py
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 | |