Hi everybody!
It's my first encounter with regular expressions ( i never used it) and i don't know how to get read a multiples files (previously selected), and change the param "normal_map" from "False" to "True" and vice versa.
this a example file.
{
"$name": "Model_Tree_LOD_blue",
"$type": "@tts::editor::MaterialEntity",
"$params": {
"normalMap": {
"$isSet": false,
"$hasValue": false
},
"normalMapUVChannelIdx": 1,
"diffuseMapUVChannelIdx": 1,
},
"features": [
{
"$name": "albedo_map",
"$type": "::bool",
"$value": true
},
{
"$name": "normal_map",
"$type": "::bool",
"$value": false
},
],
}
If anyone can lighting my way, i'll love forever and ever and ever
Replies
Python has easy to use libraries for accessing JSON elements and making changes. I'd strongly suggest doing that instead
Well, I'll study some Python. Thanks poopipe !! ^^
I'm not sure it'd be any less effort than learning and doing it in python though.
The python code for this is pretty easy. The only issue was I had to paste your Json text in to an online linter before Python could read it.
https://jsonlint.com/
monster thank you so much for the script! ^^ you rock!
Disclaimer . .. I've got very little experience beyond doing a hello world experiment in max python as I only get paid to script for maya.
Python is worth learning, it's initially disgusting if you're used to C style languages but it's so widely used in CG that you'd be dumb to dismiss it.
I'll to take advantage of this thread, with another mini question. What MaxScript/Python editor which editor can to execute the scripts into the 3ds MAx 2017 recommend me?
Sorry if i'll being heavy or abuse into this thread, but i think it's better tan create a differents threads.
And thank you so much again for the help! ^^
I'm reading somethings about Python and 3ds max. What is the best way to create scripts throught MaxPlus or pymxs?
In Monster's picture, i see that you use MaxPlus.
So far i'm very noob in python and It with 3ds Max.
If i want to recreate some of my mxs scripts, i would have to use MaxPlus?
Thanks for all the help guys! ^^
MaxPlus is access to most of the 3ds Max API through python. (Same API you get from C++, just not all of it.)
pymxs is a bridge to maxscript commands though Python.
I need two, because will be cases with Maxplus doesn't have the correctly command or function and i need pymxs. So, in any cases of this, i understand that i could refactor my mxs scripts with Python ( obviously with MaxPlus and pymxs ), aren't they?
Another Python question guys.
How do you create the Python UI? i've seen that the people, uso QT creator or designer. this tool is usefull for this?
This blog post from 2014 has some great info that is still relevant. http://www.losart3d.com/?p=828
if evaluate in max, it works. Someone could light my way, please ^^
but how can i change this settings in VScode?
thank for all this help! ^^
i have a little doubt about custom functions (its a dle, this function call a C++ script), the sintax in maxscript is the following:
this script you can call like other maxscripts function.
But I don't know how to do works this in Python, i thoug this:
OR
But i don't get anything.
can someone help me with this?
Thanks for all again and thanks axi5 for your previous help ^^ (i forgot to say you)
But I've tried with your feedback and doesn`t work the error which 3ds max gave me was:
The same error gave the Listener:
"Traceback (most recent call last):
SyntaxError: invalid syntax (<input>, line 132)"
And in my IDE(Visual Studio Code), the pylynt says the same: "E0001:invalid syntax (<string>, line 132)"
Surele, I'm writting wrong the sintax but i don't know where
My actual syntax is this:
The script in maxscript works perfectly, the problem by me is I don't know how to translate this in python code (using MaxPlus or/and pymxs).
thanks again guys!
https://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/functions.html#multiple-function-parameters
i've try this correction:
AttributeError: 'pymxs.runtime' object has no attribute 'settings'
I tried with this syntax:
But appear the following errors, are obvius:
But appear the following error:
E0001:invalid syntax (<string>, line 132)
customScriptOK= rt.customScript(theObjs, thePath, rt.settings:customScriptSettingsFile, rt.log:customScriptLogFile)
But appear the following error:E0001:invalid syntax (<string>, line 132)
this 3 options are incorrect.
i'm searching by google how to translate this things (Maxscript --> function var var option: option:) but the moment i haven't found anything.
thank you again guys! ^^
rt.customScript(theObjs, thePath, settings=customScriptSettingsFile, log=customScriptLogFile)
It works!
thanks again for your help guys! ^^