[SOLVED] Accessing SOP variables from python

How could one access SOP variables like these ones from python ?

Edit: One can not access them directly via script, so one workaround is to use a point SOP and create a new attribute using those variables as values.

Then a SopTo CHOP can convert them into channels that one can access via python or tscript expressions.

are there already any python equivalents in the meantime?

The, many of these are now accessible via Python. Start at this page to get help on it:
derivative.ca/wiki088/index. … =SOP_Class

Then dig down into attributes to learn more.

What is the equivalence of $NPT ?
When i use me.numPoints or len(me.points)
It’s alert me with Loop error.

I just want a simple $PT/$NPT in my Point SOP. but in Python.
Thx

I would probably do something like

me.inputPoint.index / op('sop_name_here').numPoints

Does that work for your use case?

it could work if
op(‘sop_connect_from’).numPoints

But i thought that i could know the total number of the current sop, Local variable like in Tscript

it works in my exemple but it is not versatile
TSvsPY_COLORS.tox (1006 Bytes)

you can replace the op() call for me

me.numPoints

Try that?

me.numPoints
and
len(me.points)

create a warning/error Cook Dependency loop detected,

What is equivalent of $BBY, $BBY, $BBZ in python language?
How could i access bounding boxes in python?