R20 Startup script location - python_init.py

Hi everyone

Anyone know if it's possible to add a startup script in R20 like in previous versions?

The old method was adding a python_init.py file to the directory:

Cinema 4D RXX_XXXXXXX>prefs>python

The python directory no longer exists so not sure where to put it.

Thanks!

Adam

I would also like the answer to this question. can anyone enlighten us?

edit:
Go here: {HOME}\AppData\Roaming\Maxon\Cinema4D_RXX_YYYYYYYY\python27\maxon_generated and use the __init__.py to execute scripts.

That'll do it. Thanks!

It's worth noting that this seems to get loaded after all of the other plugins whereas in the method for previous versions it was before. - Just in case that might be a factor for anybody.

Cheers,

Adam

Hey Adam,

for now, I don't know better. Docs don't state anything about it yet. Guess, we'll have to wait until devs are back. Maybe someone can shed some light onto this.

Hi,

Sorry for being late in the discussion here.

In R20 python_init.py is no longer executed at startup of Cinema. Sorry this change was not documented.

The __init__.py script in the preferences path python27/maxon_generated was not meant for this but it can be used as replacement.
However, as Adam pointed out the difference in his last post here, the __init__.py script in R20 is executed after the plugins are registered. Pre-R20 python_init.py was executed before the plugins registration.
This means a plugin cannot rely on operations done in python27/maxon_generated/__init__.py.

Note the other Python files in the directory python27/maxon_generated (_configuration.py and _enums.py) must not be modified.

Former MAXON SDK Engineer

@y_puech said in R20 Startup script location - python_init.py:

In R20 python_init.py is no longer executed at startup of Cinema.

Why not?

Is there a chance that you possibly bring this feature back again please?
That really was quite handy for some cases.

Kind regards,
Tom

Hi @Tom
This will be fixed within a future release.

Cheers,
Maxime.

@m_adam said in R20 Startup script location - python_init.py:

This will be fixed within a future release.

Well, that's a relief then. Good to know.

Thank you Maxime for the clarification.

Kind regards,
Tom