Skip to content

GuidelineVanishPoint1 class

Bases: pytvpaint.guideline.Guideline[pytvpaint.george.TVPGuidelineVanishPoint1, pytvpaint.george.GuidelineType]

A GuidelineVanishPoint1 is a point used as guideline for artists.

Source code in pytvpaint/guideline.py
766
767
768
769
770
771
772
773
774
775
def __init__(
    self,
    position: int,
    project: Project,
    data: george.TVPGuidelineVanishPoint1 | None = None,
) -> None:
    super().__init__(position, project)
    self._data: george.TVPGuidelineVanishPoint1 = data or george.tv_guideline_modify_vanish_point_1_get(
        self._position
    )

TYPE = george.GuidelineType.VANISH_POINT_1 class-attribute instance-attribute

refresh_on_call = True instance-attribute

is_removed: bool property

Checks if the object is removed by trying to refresh its data.

Returns:

Name Type Description
bool bool

whether if it was removed or not

position: int property

The position of the guideline.

data: GuidelineDT | None property

Returns the raw data of the guideline.

project: Project property

The project instance the guideline belongs to.

name: str property writable

The name of the guideline.

is_visible: bool property writable

The guideline visibility.

margin: int property writable

The guideline margin.

color: george.RGBAColor property writable

The guideline color.

snap: bool property writable

The guideline snap state.

collapse: bool property writable

The guideline collapse state.

refresh() -> None

Refreshes the guideline data.

Source code in pytvpaint/guideline.py
777
778
779
780
781
782
def refresh(self) -> None:
    """Refreshes the guideline data."""
    super().refresh()
    if not self.refresh_on_call and self._data:
        return
    self._data = george.tv_guideline_modify_vanish_point_1_get(self._position)

x(value: float) -> None

Source code in pytvpaint/guideline.py
789
790
791
@x.setter
def x(self, value: float) -> None:
    george.tv_guideline_modify_vanish_point_1_set(self.position, x=value)

y(value: float) -> None

Source code in pytvpaint/guideline.py
798
799
800
@y.setter
def y(self, value: float) -> None:
    george.tv_guideline_modify_vanish_point_1_set(self.position, y=value)

ray(value: int) -> None

Source code in pytvpaint/guideline.py
807
808
809
@ray.setter
def ray(self, value: int) -> None:
    george.tv_guideline_modify_vanish_point_1_set(self.position, ray=value)

grid(value: bool) -> None

Source code in pytvpaint/guideline.py
816
817
818
@grid.setter
def grid(self, value: bool) -> None:
    george.tv_guideline_modify_vanish_point_1_set(self.position, grid=value)

new(project: Project, x: float | None = None, y: float | None = None, grid: bool | None = None) -> GuidelineVanishPoint1 classmethod

Create a new guideline in the project.

Source code in pytvpaint/guideline.py
820
821
822
823
824
825
826
827
828
829
830
831
832
@classmethod
def new(
    cls,
    project: Project,
    x: float | None = None,
    y: float | None = None,
    grid: bool | None = None,
) -> GuidelineVanishPoint1:
    """Create a new guideline in the project."""
    project.make_current()

    position = george.tv_guideline_add_vanish_point_1(x, y, grid)
    return cls(position, project)

remove() -> None

Remove the guideline.

Warning

the guideline instance won't be usable after removal

Source code in pytvpaint/guideline.py
151
152
153
154
155
156
157
158
159
def remove(self) -> None:
    """Remove the guideline.

    Warning:
        the guideline instance won't be usable after removal
    """
    if self.TYPE:
        george.tv_guideline_remove(self.position, self.TYPE)
    self.mark_removed()

mark_removed() -> None

Marks the object as removed and is therefor not usable.

Source code in pytvpaint/utils.py
 98
 99
100
def mark_removed(self) -> None:
    """Marks the object as removed and is therefor not usable."""
    self._is_removed = True

set_all_visible(value: bool) -> None classmethod

Set visibility state on all guidelines.

Source code in pytvpaint/guideline.py
121
122
123
124
@classmethod
def set_all_visible(cls, value: bool) -> None:
    """Set visibility state on all guidelines."""
    george.tv_guideline_visibility_set_all(cls.TYPE, value)

set_all_margin(value: int) -> None classmethod

Set the margin on all guidelines.

Source code in pytvpaint/guideline.py
126
127
128
129
@classmethod
def set_all_margin(cls, value: int) -> None:
    """Set the margin on all guidelines."""
    george.tv_guideline_margin_set_all(cls.TYPE, value)

set_all_color(value: george.RGBAColor) -> None classmethod

Set the color on all guidelines.

Source code in pytvpaint/guideline.py
131
132
133
134
@classmethod
def set_all_color(cls, value: george.RGBAColor) -> None:
    """Set the color on all guidelines."""
    george.tv_guideline_color_set_all(cls.TYPE, value)

set_all_snap(value: bool) -> None classmethod

Set the snap state on all guidelines.

Source code in pytvpaint/guideline.py
136
137
138
139
@classmethod
def set_all_snap(cls, value: bool) -> None:
    """Set the snap state on all guidelines."""
    george.tv_guideline_snap_set_all(cls.TYPE, value)

set_global_visible(value: bool) -> None staticmethod

Set the visibility on the global guideline.

Source code in pytvpaint/guideline.py
141
142
143
144
@staticmethod
def set_global_visible(value: bool) -> None:
    """Set the visibility on the global guideline."""
    george.tv_guideline_visibility_set(0, value, on_global=True)

set_global_snap(value: bool) -> None staticmethod

Set snap state on the global guideline.

Source code in pytvpaint/guideline.py
146
147
148
149
@staticmethod
def set_global_snap(value: bool) -> None:
    """Set snap state on the global guideline."""
    george.tv_guideline_snap_set(0, value, on_global=True)