Maxscript Concatenation

Maxscript Concatenation

Anonymous
Not applicable
921 Views
6 Replies
Message 1 of 7

Maxscript Concatenation

Anonymous
Not applicable
Hi,

Can someone give me an explanation of concatenation in maxscript? I always run into trouble with the syntax for this and it takes a long time messing around until I get the correct result. I can't find the answer in the help files.

In this specific case I am trying to write multiple string variables into the user properties of an object, each variable on a new line. I am using the setuserpropbuffer command.

Here is the section of script I am struggling with. I am writing the variables upA and upB into the user properties. I have tried all manner of ways of writing in \r\n to break the line between these but to no effect.

for obj in selection do
(
setuserpropbuffer obj (upA+upB)
)


Thanks

Stuart
0 Likes
922 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
When writing to the user property buffer, use "\r\x00A" instead of "\r\n".
0 Likes
Message 3 of 7

Anonymous
Not applicable
It doesnt seem to like that. How would it be written in that piece of code?

Also, where did you get that hex value from? Are these hidden in the help somewhere?
0 Likes
Message 4 of 7

Anonymous
Not applicable
I got it working, but in a different manner. Told you this is confusing.

setuserpropbuffer $ (upA+"\r\n"+upB)

writes variables
upA
upB
0 Likes
Message 5 of 7

Anonymous
Not applicable
I have had problems with this same issue too, and what you did is how I solved it too.
If you do a lot of userPropBuffer stuff maybe my userpropBuffer editor can be of some assistance..
http://scripts.subd.nl/?f=JHN_userPropBuffer.ms

It shows the userpropbuffer of an object that is selected, no need to open properties panel.

-Johan
0 Likes
Message 6 of 7

Anonymous
Not applicable
Thanks for that. We're still using max 8 on this project though so I'll need to have a look at this on another machine.
0 Likes
Message 7 of 7

Anonymous
Not applicable
It was build in max9, but from the top of my head, I don't see why it shouldn't work in max8... no exotic code was used... if I remember correctly.

-Johan
0 Likes