C4D S24 not sure how to setup

Post Reply
ak47xm4
Posts: 3
Joined: Tue Sep 28, 2021 4:08 pm

C4D S24 not sure how to setup

Post by ak47xm4 »

Hello

1. I have no idea where is the submit button ...

2. if I using default setting , the cmd show these
C4D_USER_FOLDER=
"ERROR: The User-Directory did not exist so the current python_init.py could NOT get copied!!!"
" Please set C4D_USER_FOLDER to point to the User-Directory!"
C4D_EXEC=C:\Program Files\Maxon Cinema 4D R24\Cinema 4D.exe

3. then if I try to force modify setup_c4d.cmd
set "APP_EXE=C:\Program Files\Maxon Cinema 4D R24\CINEMA 4D.exe"
set "C4D_USER_FOLDER=%MAXON_HOME%\Maxon Cinema 4D R24_C2A528F6\"

the python_init.py copied successful, but I don't know is it works?...... ((back to 1.
c4d console shows nothing about afanasy...

cgru.3.2.1
Last edited by ak47xm4 on Wed Sep 29, 2021 2:40 pm, edited 1 time in total.
User avatar
timurhai
Site Admin
Posts: 793
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: C4D R24 not sure how to setup

Post by timurhai »

Hi!

That copying is needed to "install" this scripts to C4D:
https://github.com/CGRU/cgru/tree/maste ... pts/python
(to make C4D to "see" that scripts)

You can make C4D to "see" that scripts in any other way. You can ask C4D forums how to do it.

Also i do not think that it is correct:
set "C4D_USER_FOLDER=%MAXON_HOME%\Maxon Cinema 4D R24_C2A528F6\"
- it looks more like an installation, not home folder.
Timur Hairulin
CGRU 3.2.1, Ubuntu 20.04 LTS, MS Windows 10 (clients only).
ak47xm4
Posts: 3
Joined: Tue Sep 28, 2021 4:08 pm

Re: C4D S24 not sure how to setup

Post by ak47xm4 »

OK...
now it works

setup_c4d.cmd " c4d version path update "

set "MAXON=%SystemDrive%\Program Files\Maxon "
For /F "Tokens=*" %%I in ('dir /b "%MAXON%CINEMA 4D*"') Do set APP_DIR=%MAXON%\%%I
set "APP_EXE=%APP_DIR%\CINEMA 4D.exe"

IF EXIST "%C4D_USER_FOLDER%\python37" (
copy /Y "%C4D_CGRU_LOCATION%\python_init.py" "%C4D_USER_FOLDER%\python37"

put these codes on top of python_init.py

import sys
sys.path.append('C:/cgru/cgru.3.2.1_0920/cgru.3.2.1/afanasy/python')
sys.path.append('C:/cgru/cgru.3.2.1_0920/cgru.3.2.1/lib/python')
User avatar
timurhai
Site Admin
Posts: 793
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: C4D S24 not sure how to setup

Post by timurhai »

Hi!
Thank you for a donation!

So, the result path that python_init.py should be copied to is:

Code: Select all

%USERPROFILE%\AppData\Roaming\MAXON\CINEMA 4D*\python37
- is this correct?

Later it was:

Code: Select all

%USERPROFILE%\AppData\Roaming\MAXON\CINEMA 4D*\prefs\python
and this is the reason that copying was not working

This lines should be not needed:

Code: Select all

sys.path.append('C:/cgru/cgru.3.2.1_0920/cgru.3.2.1/afanasy/python')
sys.path.append('C:/cgru/cgru.3.2.1_0920/cgru.3.2.1/lib/python')
as cgru lib/python and afanasy/python are appended in PYTHONPATH
in cgru setup.cmd and afanasy/setup.cmd
https://github.com/CGRU/cgru/blob/master/setup.cmd
https://github.com/CGRU/cgru/blob/maste ... /setup.cmd
CGRU environment should be initialized on software start.
This is the reason to not to append sys.path in python directly by absolute paths.
Or you should do it at any CGRU update.
Timur Hairulin
CGRU 3.2.1, Ubuntu 20.04 LTS, MS Windows 10 (clients only).
ak47xm4
Posts: 3
Joined: Tue Sep 28, 2021 4:08 pm

Re: C4D S24 not sure how to setup

Post by ak47xm4 »

timurhai wrote: Thu Sep 30, 2021 9:45 am
So, the result path that python_init.py should be copied to is:

Code: Select all

%USERPROFILE%\AppData\Roaming\MAXON\CINEMA 4D*\python37
- is this correct?
yes, it is correct~~~
((temporary in R23
(((( downgraded to debug

I have tested
echo PYTHONPATH=%PYTHONPATH%
it's correct path, but C4D python can't import af

(( just using C4D for less than 1 month OTZ
Post Reply