Removing unrendered objects
-
Another question came to mind as I was thinking of using the nXtRender engine for something that took regular Sketchup about two minutes on my machine...
Is there any way to remove non-rendered objects (or planes, or lines...) based on a scene? (with/without shadows?)
-
By 'remove' do you mean delete or ignore/move onto an 'off' layer etc ?
It's relatively easy with Ruby... This line pasted into the Ruby Console will erase all active faces without a material [and you can also look for edges/groups/instances too if required - a
or e.class==
::Edge
or`` ::Group
or`` ::ComponentInstance
... You need to test for edges having a face with a material as you loose the face if an edge goes, etc so the face [or group] is the simplest to automate...Sketchup.active_model.active_entities.to_a.each{|e|if(e.valid? and e.class==Sketchup;;Face)and not e.material;e.erase!;end}
The
e.valid?
test is put in to avoid a crash if say an edge is erase! before one of its faces, because then you can'te.erase!
it since it's already gone !
Instead oferase!
you could make alayer
, turn it 'off' and move everything onto it [e.layer=mylayer
] ? -
It doesn't work.
So again... I want to remove (not hide) anything that is NOT rendered in my view screen. The script you posted doesn't seem to do that.
-
Do you mean that there's something you want to see in the SketchUp window but not in the rendered image, without having to hide an object?
I don't really understand what you want. Could you please post a more graphic explanation, even if it's just scribbled in MS Paint? I'm guessing perhaps you could use layers for this, or perhaps even Martin Rinehart's vismap script.
-
@ecuadorian said:
Do you mean that there's something you want to see in the SketchUp window but not in the rendered image, without having to hide an object?
No.... It seems that when I am using the nXtRender thingo, it will process the whole model and then render the viewport (VERY SLOW!). I want to get rid of (delete) any pieces that don't show up in the viewport, so it (nXt) does not try to process them!
-
i think you mean off screen right? the things the camera can't see?
if so i'm not sure you can do that succesfully because everything in the scene effects the light rays bouncing around. imagine a white wall close to your object but off screen it will add alot of light to your scene but if its gone; not included in the render; your render will look totally different. -
@xrok1 said:
i think you mean off screen right? the things the camera can't see?
if so i'm not sure you can do that succesfully because everything in the scene effects the light rays bouncing around. imagine a white wall close to your object but off screen it will add alot of light to your scene but if its gone; not included in the render; your render will look totally different.Actually I don't even have shadows enabled ...
-
Care to post a screenshot of the model?
Perhaps you're trying to render a model of Manhattan and expect it to render as fast as a simple Big Apple... -
@agamemnus said:
Another question came to mind as I was thinking of using the nXtRender engine for something that took regular Sketchup about two minutes on my machine...
Is there any way to remove non-rendered objects (or planes, or lines...) based on a scene? (with/without shadows?)
You can select everything you can see in the current view, use cut to remove it and send it to the clipboard, then use select all to select everything which is left, and the hit delete.
Then paste the original geometry back into the drawing.
-
you really do need an illustration of what your doing, everyone is playing a guessing game with you.
unless you meant to post this on the puns & puzzles thread? -
Al, that will also select things I can't see. It will also select pieces in complete groups that I can't see.
xrok1.. I dunno, just imagine a model, any model. Imagine I am looking at the model from some angle, any angle. Imagine I don't see the entire model because I'm looking at a closeup. I want to remove the parts of the model that I don't see.
-
call zorro
-
You can place 4 to 6 section planes in the drawing, and then use the "cut drawing to section plane" ruby to cut out the unwanted geometry.
However, the best plan is probably to use layers to make it easier to turn on and off geometry which will not be visible.
We have considered a rendering function to only extract visible geometry. But that gets tricky because some off-screen geometry may effect reflections, shadows, and reflected light calculations.
-
Agamemnus, I hope you're not filling your models with double-curvature stuff such as moldings on round columns. The polygon count goes pretty high with such objects. Also be extra careful with components downloaded from the 3D warehouse, as they often have tiny things with lots of polygons. Switch to wireframe view to spot the most polygon-heavy parts, and clean them up.
-
i'll let you alone with this, but i have a feeling if you ever accomplish what your attempting you'll discover it doesn't accomplish what you thought it would.
good luck, it is an interesting challenge if nothing else and some good may come from it.
Advertisement