Page 1 of 1

check "movable proxy" via maxscript

Posted: Thu Dec 24, 2015 1:51 pm
by HHbomb
Hi
can somebody help me : I would like to turn "movable proxy" to true via maxscript.
Thanks

Re: check "movable proxy" via maxscript

Posted: Thu Dec 24, 2015 2:53 pm
by oguzbir
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

Re: check "movable proxy" via maxscript

Posted: Thu Dec 24, 2015 3:02 pm
by HHbomb
thanks for answer, but it seems to do Nothing.

Re: check "movable proxy" via maxscript

Posted: Thu Dec 24, 2015 4:12 pm
by oguzbir
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,

Re: check "movable proxy" via maxscript

Posted: Thu Dec 24, 2015 9:24 pm
by JimStar
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"...

Re: check "movable proxy" via maxscript

Posted: Thu Dec 24, 2015 11:09 pm
by oguzbir
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 :)

Re: check "movable proxy" via maxscript

Posted: Sat Dec 26, 2015 2:59 pm
by HHbomb
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 :-)