TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software’s can be used with TurboCAD.


Access to the render object in Animation Lab 4.4
Read 4476 times
* May 17, 2010, 04:31:35 PM
I have some models that will render with the Lightwork renderer only once before running out of memory.  I can render with a High Quality Full render for one frame at a time and then rerender in wireframe to clear up the memory that is used up.  Then start the next frame.  I can continue this process for a long time before memory becomes a problem.  However, if I used Animation Lab to create the frames, I can't find a way to do this programmatically.   The scripting provides access to the ActiveDrawing object but not to the Application Object where the Render Object is located.

Am I missing something simple?  I've been using Animation Lab with TC 16.2 pro and 17 Platinum for quite awhile but have not run into a function to reset to wireframe before starting the next frame and rendering.


Logged
TurboCAD v19 Platinum - 64bit
Windows 7 Ultimate - 64bit
Intel i7 - x980 (3.33 GHz 6 duo-core)
12GB RAM, ATI 5570 w/1GB VRAM, 2TB 7200rpm HDD

Fast but not the fastest...


* May 18, 2010, 01:20:02 AM
#1
UPDATE:  I figured out that I can control the rendering with the RenderView Object which is part of the View Object.  Now on each iteration of the frame I rerender my model to wireframe and then set it to render in Lightworks Full Render for creating the Frame.

It works.  I need to fine tune my code but I will let this render complete which is 406 frames and will take about 8 hrs.  This process adds time about an hour in my case.  We will see how it goes.

I will copy the code here if it works for those that may have models that just are too big and the memory runs out over time as the model is rendered over and over.

John

Logged
TurboCAD v19 Platinum - 64bit
Windows 7 Ultimate - 64bit
Intel i7 - x980 (3.33 GHz 6 duo-core)
12GB RAM, ATI 5570 w/1GB VRAM, 2TB 7200rpm HDD

Fast but not the fastest...


* May 18, 2010, 06:19:28 PM
#2
I guess nobody bit on this.  I have read that others have had problems running out of memory while runing animations as the memory used climbs after every iteration.  Even models that don't take up almost the whole allotted memory during the the render will eventually run into the memory barrier.

I was able to run all 406 iterations last night on my animation of my model.  The first frame took 1,310MB of RAM (seems like two renders are used one during the object movements and the second for file frame creation.  I believe the second one will not accumulate the memory leak and that is why I don't have problems when doing camera movement only renders.  After about 300 frames TurboCAD used only about 1,396,MB of RAM.  It never crashed until all renders were done and the Application restarted.  It did take longer to run the animation however, but beats doing it manually which is what I used to do.

I hope this makes sense to people that have experience with Animation Lab.  For those with more experience than me, and there are a lot of you, if there is an easier way of doing this without simplifing the model too much please tell me.  I have seen amazing renders on this site.

Here is the code I put in the script:

// Copy this code into the script section of Animation Lab 4.4
// to force rendering into wireframe to recollect lost memory
// from Lightworks Engine memory leaks.
//
// Animation Lab seems to Render the drawing twice,
// once on each step after a movement of an object
// and during file frame creation.

// Untested:  One step scenario's enter a scrpt which will need
// to be modified by adding below code to the StepCustomAction Sub

// It is best to Set Options to not check syntax before as that can cause
// many unnecessary iterations of the code

Sub PreScenarioAction
// TODO your code
end sub

Sub PostScenarioAction
// TODO your code
end sub

Sub StepCustomAction
  Dim RefeshEveryXFrames
  //RefreshEveryXFrames should = StepNum to refresh on every iteration otherwise any integer greater than one 2,3,4,5,10...
  RefreshEveryXFrames=StepNum
  If StepNum<>0 then
    If StepNum mod RefreshEveryXFrames=0 then
     ActiveDrawing.ActiveView.RenderView.EndRender
     //RenderMode=0 is wireframe render
     ActiveDrawing.ActiveView.RenderView.RenderMode=0
     ActiveDrawing.ActiveView.RenderView.BeginRender(0)
     //RenderMode=4 is Full Render
     ActiveDrawing.ActiveView.RenderView.RenderMode=4
    End if
  End if
end sub

« Last Edit: May 18, 2010, 06:59:55 PM by Johnny_Law »

Logged
TurboCAD v19 Platinum - 64bit
Windows 7 Ultimate - 64bit
Intel i7 - x980 (3.33 GHz 6 duo-core)
12GB RAM, ATI 5570 w/1GB VRAM, 2TB 7200rpm HDD

Fast but not the fastest...


* October 07, 2010, 08:53:21 AM
#3
Thanks for the script!  Finally I am able to run full length best quality animations. 


Logged


* July 18, 2013, 04:18:11 PM
#4
Does anybody know what these settings are for the various render modes.

ActiveDrawing.ActiveView.RenderView.RenderMode=0 ActiveDrawing.ActiveView.RenderView.BeginRender(0)


Example as above, what should the settings be for other rendering modes in relation to

RenderMode
BeginRender

I would at least for starters like to know what these settings are for lightworks Raytrace Full.

Any assistance appreciated.

Regards Mike Geraghty!.

Logged


* July 23, 2013, 01:51:38 PM
#5
I haven't been frequenting the forum lately, but I did get your PM while I was on vacation.  Now I can answer your request.

I sent you a PM as to how I can find which rendermode is which.  The Raytrace Full looks like it is 6 for the Lightworks engine.

Good luck with your project, the tcsdk.chm help file has a lot missing.

Johnny

Logged
TurboCAD v19 Platinum - 64bit
Windows 7 Ultimate - 64bit
Intel i7 - x980 (3.33 GHz 6 duo-core)
12GB RAM, ATI 5570 w/1GB VRAM, 2TB 7200rpm HDD

Fast but not the fastest...


* July 24, 2013, 06:37:08 AM
#6
Many thanks for your feedback and assistance Johnny, I am going to have a play around with some of the new settings today!.





Mike Geraghty.

Logged


* July 26, 2013, 01:50:39 PM
#7
Hope it worked for you.

Logged
TurboCAD v19 Platinum - 64bit
Windows 7 Ultimate - 64bit
Intel i7 - x980 (3.33 GHz 6 duo-core)
12GB RAM, ATI 5570 w/1GB VRAM, 2TB 7200rpm HDD

Fast but not the fastest...


* July 27, 2013, 10:15:24 AM
#8
I am getting somewhere Johnny, but not exactly what I want yet, still waiting for a reply from Softdev about the RenderStyle and ChangeRenderStyle commands.


I will email you in the next few days with where I am at with the initial problem.


Regards Mike Geraghty.

Logged


* September 12, 2013, 05:28:48 PM
#9
Mike - I am curious if you got answers regarding renderstyle.  I am struggling with the same issue. 

Craig Johnson

Logged


* September 13, 2013, 09:12:34 AM
#10
Hello Craig, unfortunately I did not get any feedback from SoftDev, probably because it is in Russia, and some of the emails may be taken as spam. I know Dave Taylor was going to chase up SoftDev about some of the settings or syntax, but as yet have not heard anything.

Try sending Dave Taylor a message!.

Mike Geraghty.

Logged