Page 1 of 1

C4D S24 not sure how to setup

Posted: Tue Sep 28, 2021 4:25 pm
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

Re: C4D R24 not sure how to setup

Posted: Tue Sep 28, 2021 7:07 pm
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.

Re: C4D S24 not sure how to setup

Posted: Wed Sep 29, 2021 5:01 pm
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')

Re: C4D S24 not sure how to setup

Posted: Thu Sep 30, 2021 9:45 am
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.

Re: C4D S24 not sure how to setup

Posted: Thu Sep 30, 2021 1:16 pm
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