You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-11Lines changed: 6 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,11 +83,11 @@ To enable IDE autocomplete and type checking for Designer's Python API, install
83
83
pip install designer-plugin-pystub
84
84
```
85
85
86
-
Once installed, import the stubs using the `TYPE_CHECKING` pattern. This provides type hints in your IDE without affecting runtime execution:
86
+
Once installed, import the stubs.
87
+
> **Important:**`pystub` provides type hints for Designer's API objects but not their implementations. These objects only exist in Designer's runtime and cannot be used in local Python code. They must only be referenced in code that will be executed remotely in Designer.
88
+
87
89
```python
88
-
from typing importTYPE_CHECKING
89
-
ifTYPE_CHECKING:
90
-
from designer_plugin.pystub.d3 import*
90
+
from designer_plugin.pystub import*
91
91
```
92
92
93
93
This allows you to get autocomplete for Designer objects like `resourceManager`, `Screen2`, `Path`, etc., while writing your plugin code.
@@ -100,9 +100,7 @@ The Client API allows you to define a class with methods that execute remotely o
100
100
101
101
```python
102
102
from designer_plugin.d3sdk import D3PluginClient
103
-
from typing importTYPE_CHECKING
104
-
ifTYPE_CHECKING:
105
-
from designer_plugin.pystub.d3 import*
103
+
from designer_plugin.pystub import*
106
104
107
105
# 1. Sync example -----------------------------------
108
106
classMySyncPlugin(D3PluginClient):
@@ -186,9 +184,7 @@ Both `D3AsyncSession` and `D3Session` provide two methods for executing function
186
184
187
185
```python
188
186
from designer_plugin.d3sdk import d3pythonscript, d3function, D3AsyncSession
0 commit comments