---
title: "Paint FX Constant Line Width"
canonical: "https://documentation.chaos.com/space/VMAYA/111748345/Paint%20FX%20Constant%20Line%20Width"
format: markdown
---
This example using Post-Translate Python Script shows how to set a constant hair width in pixels, effectively applying it for Paint FX toon lines.

 

##### **Set Hairs Width In Pixels**

```python
from vray.utils import *

# Get all GeomMayaHair nodes and set their widths_in_pixels
hairs = findByType("GeomMayaHair")
for hair in hairs:
   hair.set("widths_in_pixels", True) 
```


<span style="color: #202124">The </span><span style="color: #202124">**widths_in_pixels**</span><span style="color: #202124"> option will instruct V-Ray to treat the line widths (exported as hair strands) as screen-space width values in pixels, rather than the default world-space widths.</span>

> Macro (ui-text-box)
> 
> Note that the hair width pixel override will not show in IPR.

 

In addition, using the Post-Translate Python Script, you can override the material of the pfxToon nodes. <span style="color: #252c2f">This script relies on your pfxToon strokes being named pfxToonShape1, 2, etc., so if you've changed their name from the default, edit it accordingly.</span>

##### **Set VRayMtl to pfxToon nodes**

```python
# if material is not assigned to any object it will not be exported, export it here
vraymtl = exportMaterial('VRayMtl1')
nodes = findByType('Node')
for node in nodes:
    if node.name().startswith('pfxToonShape'):
        node.set('material', vraymtl)
```

> Macro (ui-text-box)
> 
> For more information on [Post-Translate Python Script](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111745019), refer to the dedicated page.