sorry for this, I didn't meant to violate NDA, I was just trying to help.
No problem with the post removal though, will be more careful on that in the future.
Anyway, managing to create my own nodes would interest me as well so I keep following this thread
Posts made by Fremox
-
RE: Writing scene nodes
-
RE: Script that converts Redshift materials back to C4D standard ones
I get it now, thanks for your detailed explanation!
-
RE: Script that converts Redshift materials back to C4D standard ones
Thanks for your reply.
I was asking by curiosity rather than asking for a debug on your side.
But I get why you understood it that way, so, sorry I'll try to write my posts with that in mind in the future, sorry for the misunderstanding.As Javascript developper, I never had any issue in After Effects with some code only working on one OS and not the other, this is why I got curious and I was thinking that, maybe, Python wasn't OS agnostic after all. But you answered my question so, as far as I understand there isn't any reason why it shouldn't work on my colleague workstation.
When he runs the same script on his computer, nothing happens at all, while, with the exact same scene, it does work properly on my PC machine.
So I will investigate on my side in order to see what could be wrong with his setup (he uses 2023.2 version too).Anyway, thanks again for the precision
-
RE: Script that converts Redshift materials back to C4D standard ones
Hey @ferdinand
Hope you are doing wellContinuing my script testing I realized that the code above didn't work for a colleague who works on a Mac, but I don't really understand why a Python script wouldn't work on both Windows and Mac systems, or am I missing something?
Isn't Python working the same way in both cases? -
RE: Script that converts Redshift materials back to C4D standard ones
Perfect, works like a charm!
I will definitely digg the whole code in order to fully understand each instruction, so that I will be able to adapt it for my needs (for example, finding the textures for the Emission channel in RS Shaders and map it correctly to the luminance channel of the STD ones ; Shouln't be a problem since you have neatly documented all your code -
RE: Script that converts Redshift materials back to C4D standard ones
you are right, I tested it in R25 in the first place and that's why it didn't work!
Now that I've tested it in 2023.2, everything works fine, thanks a lot!!
Now I will test different things in order to easily replace RS mats by the STD ones in my scenes.
I've changed the line 198 tomaterial.SetName(f"{name}")
instead of
material.SetName(f"{name} [STD]")
in order for my new STD materials names to be written just like the RS ones, in order to be able to use the Material Exchanger (which needs 2 scenes with exact same materials names to work properly), but I end up with names with ".1" suffixe at the end of the newly created materials.
Since it seems you can't use the Naming tool on materials (I've tested it and it didn't work)
is there a way in our srcipt to kind of "force" the newly STD materials to have the exact same name without this .1 suffixe ?Sorry to bother you again
i try to wrap my head to find the best solution in the least amount of time (and your script aleardy does 99% of what I wanted so 1000 thanks) -
RE: Script that converts Redshift materials back to C4D standard ones
OK, I tried to understand the main code and I think I got most of it.
But when I try to use it on a simple scene with RS materials in them, there is an error at line 54 (I checked the console > Python tab) that saysFile "D:\FREMOX\R&D\C4D\Scripts\materialMapper_v0.py", line 54, in IterRsGraphGraphs if not material.CheckType(c4d.Mrsgraph): AttributeError: module 'c4d' has no attribute 'Mrsgraph'
Where can I find documentation on each attribute available for specific objects in Python C4D?
or maybe the keyword "Mrsgraph" hadn't been written correctly?Just for your information,
I disabled the roughness, reflection and bump lines in your code by adding a # sign to make them comments, in order for me to just focus on the Diffuse color first.Any help would be appreciated,
Thanks in advance (and sorry to bother you if it's already to much work on your side, I would totally get it, no worry -
RE: Script that converts Redshift materials back to C4D standard ones
Whoooo, can't believe I got such an efficient support for what I asked, and in such a little amount of time!
Would kill to have your coding skills ^_^Thanks for having documented your code with so much comments, it will definitely facilitate my scripting learning journey!
I will first give this nice piece of script a try, in order for me to fully understand what it can and what it can't "do as it is", then I will come back to you, probably with some questions on how I could change or improve it myself, because of course I understand nobody here is willing to do professionnal work for no money
Will have to have a deep look at the C4D scripting API and Python of course though, but I'm pretty sure learning at least the basics of all that could already improve my (and my colleagues) workflow so thanks again for your support.
-
RE: Script that converts Redshift materials back to C4D standard ones
You are right about what you understood.
I think we would just have a simple shema where there are just a bitmap file plugged in to the Diffuse Color of a RS C4D Shader 99% of the times.
But I need to investigate more on my side, in order to ensure my colleagues from the team always rely on XPresso based RS materials, and not the new nodal ones, because otherwise, it would be way more complicated, which I understand completely.So, if we stick with this simple shema as an input, since you have written "a much more trivial task" in your last sentence, I was wondering..
Would you think someone who doesn't know C4D API, has a strong background in Javascript, and has begun to learn Python (a bit) like me, could make it on his own, with a little bit of help from this forum, or is it too much work for a C4D scripting newbie? -
RE: Script that converts Redshift materials back to C4D standard ones
Thanks a lot for your detailed reply.
And sorry if my question looked a bit fuzzy, I didn't want to confuse anyone!So, I'm just investigating what's possible as a solution right now, I did think that maybe, such a script would already exist in some sort and could be easily tweakable/adapted for our needs without too much work, but you are right, I may have underrated the amount of work such a task represents.
Not my fault though... Every time I came up with a request on the Maxon backstage forum, I almost always ended up with a genious guy saying "Hey, I've just wrote a script that does that..", so I assumed it would be the same here, sorry ^_^I will then answer to your 3 points one by one:
-
I won't lie here, even if I have some experience with development, it's only in Javascript (I create scripts for AfterEffects), and such a script for C4D is way beyond my skills ; so yes, I guess we (because I work for a team) will search for developper for hire on this. BUT, please wait for me to give more details about that, because I need to talk about this with my team and my hierarchy first (as I said, I was "just" investigating a bit in order to see if a solution existed)
-
The inputs would be either some RS materials or RS Standard materials, that usually only have a plain color or a single bitmap texture plugged in their diffuse (sometimes there are some textures in the emission too), with various roughness values ;
The output have to be materials for the Standard renderer (the old materials not the Node materials) -
you are right with what you assume: the image file plugged in the Diffuse slot of the RS materials should be applied to the Color channel of the Standard renderer materials, with the ability to replace the RS ones, just like if we had made used the "Convert and Replace" command from the Redshift menu, but exactly in the reverse way!
So if we have let say this RS material:
I would like to create a new Material for the Standard Renderer that looks like this:
...where, as you can see, the image is the same in both the Diffuse (RS) and the Color channel (STD).
I understand why you had some doubts, but I didn't lie when I said there was hundreds of these materials to convert.
We work for a video game, and each time we have to import an Avatar from the game in C4D, it imports one material per body part, and each character has, at least, 15 different parts... Since we create trailers with sometimes a lot of different characters in a same scene (for a Concert for example), our scenes, often have more than 200 materials!This why I try to find some viable solution.
-
-
Script that converts Redshift materials back to C4D standard ones
Hey there!
first time posting here (I come from the other forum, backstage as a beta tester) and someone advised me to post my question there so... here am II know we will be more and more pushed to use RS as the default Render engine in future versions of C4D, BUT, what I really need right now (for a big project) is to go exactly the opposite direction (we need NPR rendering and we also need to export some of the textured objects in various game ready formats that can't handle RS mats... yet)!
I have huge scene files that used RS for materials, lighting and rendering, and I need to convert as much materials as possible back to Standard materials (not the RS Standard materials, but our old good C4D Standard Renderer).
We really can't do that manually because there are really too much of them (hundreds of them), so I need to find a solution.
Any chance someone has already managed to write some python scripts that:1/ analyze the bitmap files used in the most common RS materials channels (diffuse, at the very least, but if it could also do it for Emission and Roughness, it would be great ;
)2/ and apply these same files in some newly created C4D Standard materials in the proper channels (Diffuse in Color, Emission in Luminance, Roughness in Reflectance roughness...)
3/ and replace each RS material by its C4D standard mat equivalent on each object
?I'm pretty sure I can't be the only one who actually need such a script...
Thanks in advance for your help