Page 1 of 1
Exporting multiple scenes from sketchup to mxs
Posted: Sat Mar 12, 2011 12:43 am
by rcnorve
Is this possible? With SU Animate i can create lets say 800 scences in sketchup for an animation, each scene represents a frame in the animation. Is there a way to export all of these scenes to mxs or once in studio export out all 800 cameras to mxs so i can batch render an animation? Seems pretty simple to me but can find out how to do it.
Thanks.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Sat Mar 12, 2011 12:49 am
by Half Life
I've asked about this in the past -- I think it can't be done (unless there is some hidden code) right now, but certainly should be something for the plugin wishlist.
Best,
Jason.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Sat Mar 12, 2011 1:46 am
by JDHill
In the exported MXS, you should find one camera for each Scene in the SKP. I assume that there is some method to their names, as created by your plugin, such that you could script Maxwell Render to render each camera using its setActiveCamera(name) function. I quickly threw such a script together; it assumes SketchUp's own default Scene-naming convention:
Code: Select all// This script loops through a set of cameras, specified by name and
// index. It must be customized to fit the characteristics of the given
// MXS file. As set up, it expects to find the MXS filled with cameras
// whose names begin with 'Scene '. This base name is stored below
// in the 'baseName' variable. It expects the scene numbers to begin
// at 1 and to end at 3, with these limits being stored below in the
// 'firstFrame' and 'lastFrame' variables. It will loop through the frame
// range looking for cameras which fit the pattern 'Scene 1', rendering
// each one as it is found.
var firstFrame = 1;
var lastFrame = 3;
var baseName = "Scene ";
// internal vars & events
var isRendering = 0;
var currentFrame = firstFrame;
var outputFolder = FileManager.getFileFolder(Scene.mxsPath);
RenderEvents["renderFinished()"].connect(renderHasFinished);
// render loop
while (currentFrame <= lastFrame)
{
renderCamera(currentFrame);
while(1)
{
if(isRendering == 0)
{
break;
}
}
currentFrame++;
}
// functions
function renderCamera(frameNumber)
{
var sceneName = baseName + frameNumber;
Scene.setActiveCamera(sceneName);
if (Scene.activeCameraName != sceneName)
{
Maxwell.print("The MXS contains no camera named '" + sceneName + "'!");
}
else
{
Maxwell.print("rendering Scene: " + sceneName);
Scene.setMxiPath(outputFolder + "\" + sceneName + ".mxi");
Scene.setImagePath(outputFolder + "\" + sceneName + ".png");
isRendering = 1;
Maxwell.startRender();
}
}
function renderHasFinished()
{
isRendering = 0;
Maxwell.print("Render finished!!");
}
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon Mar 14, 2011 8:14 pm
by rcnorve
Thanks, I will see if we can get this to work.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon Mar 14, 2011 8:36 pm
by JDHill
Just give it a try and let me know if you run into any problems. imho, this is really the best way of doing such camera-based animations, since it requires only one MXS file.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon Mar 14, 2011 8:53 pm
by Half Life
With the small exception of no motion blur in the animation...
Best,
Jason.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon Mar 14, 2011 10:01 pm
by JDHill
I'm not sure what you mean by that; camera motion blur is property of the camera -- each camera. If each of his 800 cameras was written with two positions, then all 800 would render with motion blur, and still using just the one MXS. How the plugin would know what those two positions are supposed to be is another question; that is something which can be inferred frame-to-frame when using SketchUp to transition between one Scene and the next, but in this case, the only ways of tying one scene to the next conceptually are (a) start at the left and move to the right, or (b) analyze the Scene names and try to infer a sequence.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon Mar 14, 2011 11:45 pm
by Half Life
Exactly -- and this is precisely how the Sketchup native animation accomplishes it's task... I'm not saying it is (or should be) a one-to-one conversion between Sketchup "animation" and Maxwell animation, I'm just pointing out that while we can render "animations" from Sketchup to Maxwell we do not have access to motion blur because each camera is exported as a "still" camera via the plugin, regardless of the positional changes of the cameras on either side of it.
This is easily corrected in post production using things like AfterEffects motion blur settings... but an animation from Sketchup to Maxwell is not equal to an animation from other (more animation-centric) programs to Maxwell.
I have pointed out in the past that these types of plugins do create the cameras so that they represent a single frame (at whatever frames per second) in a very structured way, so conceptually it would be possible to properly infer what positional information is needed... but in all reality it seems likely that the Sketchup Dev team is going to include improved animation features in the next major release and so I would not bother trying to work in motion blur as it stands now because it will likely change soon (unless you consider it as a favor to legacy Sketchup version users).
Best,
Jason.
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon May 09, 2011 8:02 pm
by roch_fr
hello,
can you explain me how to export XXX frames from a SU animation ?
Thank you.
Roch
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon May 09, 2011 8:22 pm
by JDHill
Are you also using the SU Animate plugin, like the original poster in this thread?
Re: Exporting multiple scenes from sketchup to mxs
Posted: Mon May 09, 2011 9:42 pm
by roch_fr
No, it is a recurrent request on the french forum so I've got an interest.
I will have a look to animate plugin.
Thank you,
Roch