[Closed] Changing objects script, help nedded
Im having a problem with a script im working at, where i can take an object in scene A and exchange it with an object from scene B…
for eksameple… im having a scene of a street where i want cars in but they got to many vertex’s, so i want to have a box in the street scene that i can change out with the car at render time…
i have tried to do it with a preRender but i get a string error cause i tryed to use merge, witch i also found out, just puts in the object at the place it have in the scene it came from, and dont inherit the x,y,z cordinats from the object its going to replace…
can somebody give me a hint how to get further… im a little stuck… thinking maybe i can use Xref, but can i do that in a preRender string and if so, how can i specify the file i want to get the (car) object from? I have been looking to see if i could find a script that did something in preRender put cant… except the build in “howTo” excample but it just give a sphere more segments… I also cant seem to find out how to have a string in a string…
Help!!!
Etchy
Without doing any research or testing on your specific problem, I can help you with your question about putting a “string inside a string.” You need to use the escape character to put the quote marks in explicitly:
“This string has a “string” inside it!”
The \ character tells Maxscript to include the quote mark into the string. Hope that gets you a little further along with your script:)
RH
X-ref Object is your best bet.
Set your cars up in individual files centered at [0,0,0]. You need to collapse your car to a single mesh.
Collect them with the X-ref Object dialog in the file menu. Then right click on the object and go to properties. Check display as box.
There’s also an option to use a proxy object in the X-ref object, which I set up in the same file. So I have a low-poly and a highres of each car in one file. I load in the hi-res into the x-ref slot, and the low res in the proxy slot. You can then select to render the proxy for scenes where the car is at a distance or render the high-res when it’s closer in your scene, or a combination when you’ve a bunch of cars in a shot…
Good Luck
Keith Morrison
thanx for that…
I’ll try to see if i can get it to work…
cause i still need to make a preRender function with the X-ref command within… I’ll studdy it a bit more…
Do any of u know if there is a book that goes deeper into the max scripting? or is the only thing i can go for the help?
Etchy
You can not change goemetry with the prerender callback, the scene nodes have already been evaluated.
The x-ref object will automatically do exactly what you stated above, load the high-res car in prior to rendering, but not negatively effect your working file size and your ability to move fast in that file.
What else do you need to change prior to rendering?
Books. I own two of them, but 64.7% of the time the help file is where I get answers to questions. 10.2% looking through scripts that do similar things that I want to do. After that I hit the forum.
I don’t feel the books were I very good investment, there’s plenty of resources on the web too…
Keith Morrison
but what i want is to make the car appear in the rendered scene but not in the scene im working at…
i want the substitude to happen when i press the render button…
is there a way that i can do that??
Sure. xref object… try it out…
When it’s an x-ref object it just like being a max node, you can hide it, animate it, add modifiers… ect…
You can animate the wheels turning in the max file with the car in it and the wheels will turn in the file you have it xref object’d into. They’re really bitch’n. I use them all the time.
For farm rendering there great, the queued file is small but has all the geometry from the x-ref’d files in it…
Good Luck
Keith Morrison
The biggest problem is that im newbiee… but had a company ask me if i could program a script that could do the above…
as a programmer I’ll ofcause try… Maybe I could be so lucky to get a job in the future… but first im trying to figure out how to script max… not that easy i found out… so if u know some good links to pages where i cant find good scripts to look at, please post them!!
Etchy
Has 90%, or so, of all the scripts out there…
http://support.discreet.com/webboard/wbpx.dll/~3dsmax
Discreets Web board. very usefull as well…
Don’t forget to use the search feature of the web boards to find things too… Alot of times the info I need has already been disscussed…
Keith Morrison
Is this company aware of X-ref objects? I know where I work they don’t use them much, although they should… very frustrating…
I dont know if they know them…
But I didn’t know them until yesterday when i read about them… I still havent figured them out but hope I can understand them by reading more about them somewhere…
But in the online help it dont says that mutch about using them… and the other part is kinda dark talk for me… hehe
so…
But when i figure out the force of them I will ofcause tell them about them… And since its not that big a company i guess its not that hard to get info around to everyone (5 persons)