check "movable proxy" via maxscript

3D Studio Max Plugin (Export Script Plugins developed by [gk] and KilaD; Integrated Plugin developed by Karba)
Forum rules
Please post only in English in this subforum. For alternate language discussion please go here http://render.otoy.com/forum/viewforum.php?f=18
Post Reply
HHbomb
Licensed Customer
Posts: 1378
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

Hi
can somebody help me : I would like to turn "movable proxy" to true via maxscript.
Thanks
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
User avatar
oguzbir
Licensed Customer
Posts: 715
Joined: Fri Jun 25, 2010 12:30 am
Contact:

HHbomb wrote:Hi
can somebody help me : I would like to turn "movable proxy" to true via maxscript.
Thanks
Test this out

Code: Select all

setUserProp selection "octane_movable_proxy" true as string
My Portfolio
windows 10 Pro. |1070 + 1070 + 1070 + 1070 | i7 @4.5Ghz
HHbomb
Licensed Customer
Posts: 1378
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

thanks for answer, but it seems to do Nothing.
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
User avatar
oguzbir
Licensed Customer
Posts: 715
Joined: Fri Jun 25, 2010 12:30 am
Contact:

HHbomb wrote:thanks for answer, but it seems to do Nothing.
You must have done something wrong. it works.
Create a new box
Right click - object settings go to user defined. There should be no text there.


select the object
write this in the listener and enter.
setUserProp selection "octane_movable_proxy" true as string

Again go to object properties you'll see the variable there.


Ok.
Let me clear this out. That it not that easy to do. I made it work with my script. But every time I deal with it I forget all my findings everytime.

Since there is no direct object setting that enables or disables the moveable proxy setting This is done via object properties in max, under the "User Defined" tab aka. User Defined properties.
So first you should be get current user defined values as string

On a newly created object that section is completely empty.
If you plan on creating a button to control the objects moveable proxy property.

So you should create an if clause in your script.
So ask the object whether or not has the string such as

Code: Select all

getUserProp $ "octane_movable_proxy" 

This will give you undefined, true or false
undefined - means there is no variable set octane_movable_proxy (I mean the user defined section is empty
True meaning user defined section has the octane_movable_proxy = true line there.
False means octane_movable_proxy = false is written there.

So first you should get the properties. check if there is octane_movable_proxy in the properties.
Then make (say)a button or checkbox to drive that code. If there is no proxy info in the object then the button is closed. if true that enable button.

These are some codes that will help you start from somewhere.

Code: Select all


--This below code has to be in a function that needs to be rerun or refreshed every time you select a new object.
fn updateRefresher =
(
for A in selection do 
	(
	if getUserProp A "octane_movable_proxy" == undefined  then BUTTONNAME.checked=false
	if getUserProp A "octane_movable_proxy" == True  then BUTTONNAME.checked=true
	if getUserProp A "octane_movable_proxy" == False  then BUTTONNAME.checked=false
	)
)
.
.
.


-- The code for the button or checkbox
on BUTTONNAME changed status do
	(
	if status == on then (setUserProp selection "octane_movable_proxy" true as string)
	else
	(setUserProp selection "octane_movable_proxy" False as string)
	)

There is no one code type thing for this to work great.
You may also use my script for that.
Here is the link
viewtopic.php?f=27&t=49724&hilit=Octane+Shortcuts
Best,
My Portfolio
windows 10 Pro. |1070 + 1070 + 1070 + 1070 | i7 @4.5Ghz
User avatar
JimStar
OctaneRender Team
Posts: 3816
Joined: Thu Jul 28, 2011 8:19 pm
Location: Auckland, New Zealand

oguzbir
Does it really work for you? I mean overall you are correct, but if I remember correctly (I can't check right now, we are on holidays currently) - this code should not work because of one small mistake that Karba made at the very beginning of "movable proxy" implementation.
There is a misspelling in "octane_movable_proxy" property name, it actually is "octane_movable_proy". Now I didn't want to change it 'cause it may be already used by some third party scripts - so I don't remember that I fixed this misspelling... So, the property name most likely should be still "octane_movable_proy"...
User avatar
oguzbir
Licensed Customer
Posts: 715
Joined: Fri Jun 25, 2010 12:30 am
Contact:

JimStar wrote:oguzbir
Does it really work for you? I mean overall you are correct, but if I remember correctly (I can't check right now, we are on holidays currently) - this code should not work because of one small mistake that Karba made at the very beginning of "movable proxy" implementation.
There is a misspelling in "octane_movable_proxy" property name, it actually is "octane_movable_proy". Now I didn't want to change it 'cause it may be already used by some third party scripts - so I don't remember that I fixed this misspelling... So, the property name most likely should be still "octane_movable_proy"...
Oddly enough it was the first thing I noticed that you've changed, after you took over. because I had this moveable proxy script button from the beginning and it stopped working after you came along :))
So I'm pretty much clear that it works with proxy not proy :)

Happy holidays to you. Drink and rest well, we're waiting a lot from you :)
My Portfolio
windows 10 Pro. |1070 + 1070 + 1070 + 1070 | i7 @4.5Ghz
HHbomb
Licensed Customer
Posts: 1378
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

Hi, thanks oguzbir, it works fine...
Sometime I'm sooo stupid... "setUserProp selection "octane_movable_proxy" true as string" works better than "get (...)"...

If you have a code to "export to octane proxy" without the ui, I'm interrested too :-)
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
Post Reply

Return to “Autodesk 3Ds Max”