sketchucation logo sketchucation
    • Login
    1. Home
    2. AdamB
    3. Posts
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 129
    • Posts 933
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Simple interior lighting

      @joshvt said:

      Hi
      We use sketchup a lot for single family home design. We always model the interiors as part of our design study, but have not done much with interior lighting/ plug ins. Can some one point me in the diretion of an eefective tool to get started that is on the simple and cheap side.

      thanks
      j

      You could download the free LightUp demo here.

      If it works for you, then buy it, if it doesn't, don't buy it. πŸ˜„

      Adam

      posted in Newbie Forum
      AdamBA
      AdamB
    • RE: Component processor usage...

      @plot-paris said:

      and while we are at it: what is the easiest method of showing the framerate of SketchUp? is the time.test-thing command the best way or is there something like a small digit in the top right corner that shows the current framerate?

      At the Ruby Console, you can type this mouthful:

      1.0 / Sketchup.active_model.active_view.average_refresh_time

      to get frames per second

      posted in SketchUp Discussions
      AdamBA
      AdamB
    • RE: @Jim and other coders

      @jim said:

      Check the method index also. It has methods that have are not listed on the individual pages - even if they lack documentation.

      Totally agree. However using the methods() method is 'straight from the horses mouth' as it were. No worrying whether the docs are right / up to date etc. If it reports there is a method called "blah", it is 100% certain there is a method called that.

      Adam

      posted in Developers' Forum
      AdamBA
      AdamB
    • RE: @Jim and other coders

      Hi Didier,

      With a language like Ruby that supports reflection you can always query objects to see what they actually do respond to:

      Sketchup::ModelObserver.new.methods - Object.methods

      gives:

      ["onDeleteModel", "onTransactionAbort", "onSaveModel", "onTransactionRedo", "onTransactionStart", "onTransactionUndo", "onTransactionEmpty", "onEraseAll", "onTransactionCommit"]

      So perhaps its called "onTransactionCommit"

      posted in Developers' Forum
      AdamBA
      AdamB
    • RE: Barcelona Pavilion (redux)

      Thank you!

      @princedragoncok said:

      Although it may clash, for the moment it is an excellent replacement for HRDI - you just require a more suitable image that is not so blured/skewed

      Ironically I Gaussian blurred it just so it would feel out of the depth of field and not encroach.. sigh...

      Here's a go at a night time shot - its kinda cool I think (Pity about the jpeg encoding artefacts in the starfields..)
      barcelona_google_at_night_lightup.jpg

      And there's a very short ideo
      [flash=400,300:3aedo54m]http://vimeo.com/moogaloop.swf?clip_id=1718060&server=vimeo.com&show_title=1&show_byline=1[/flash:3aedo54m]

      Adam

      posted in Gallery
      AdamBA
      AdamB
    • RE: $ versus @

      I'd suggest always re-instance a Tool unless there is a compelling reason to make it persist.

      As a general rule, releasing resources as soon as possible is a GoodThing, and secondly - and probably more importantly in a Ruby context, to ensure you don't carry references to Ruby objects and therefore stop garbage collection happening - worse still carry stale references to objects that have subsequently been deleted which tends to make SU jump into the azure blue sea of unallocated heap store and commit hare-kiri.

      Adam

      posted in Developers' Forum
      AdamBA
      AdamB
    • RE: Shortcuts and keys in rubys collide

      Why don't you plug in another keyboard and double the number of keys.

      posted in Developers' Forum
      AdamBA
      AdamB
    • RE: $ versus @

      The original question was about why bother using anything but globals.

      Given at the end of the day its just bytes in memory, why do all these pesky computer scientists keep harping on about using locals and scoping stuff?

      Well, at the end of the day, it is just memory somewhere. But as programs became more and more complex the opportunities to shoot yourself in the foot and introduce bugs into the logic of your programs became more and more common.

      So rather than have to make correctness assertions about a million lines of code, computer scientists started breaking down large programs into small self-contained pieces of a tens of lines of code that were guaranteed to have no 'side effects' outside themselves. Having shown the individual functions were correct, they could then move up and start making correctness assertions about groups of functions and so on. Its called a 'hierarchy of confidence' and without it you'd simply never be able to get big software projects out the door.

      So, ensuring that variables are only accessible and changeable by certain well known bits of your program is just to make your life easier.

      Ditto laying out your (Ruby) code with rigid rules about formatting/indentation. It just helps spot errors. Ditto naming variables that give a hint about the meaning of the variable. Ditto naming functions to reflect what they actually do and not having 'hidden magic' they do on the side..

      So, if you want to use globals, and put all your Ruby code on a single line with no spaces. Go knock yourself out - you are free to do so. Its just making things hard for yourself - but each to his/her own. πŸ˜‰

      Thinking about who needs to be able to access variables is a good exercise before you even approach a keyboard to ensure you've thought things through.

      Having said all that, if you're writing a 10 line program and want to use globals because you've got a few minutes to bang some code out - don't have a guilt trip about - we've all done it.

      The flip side is that those who have worked on multi-million line projects adopt these ways or working for a good reason and not just for the hell of it.

      And lastly, for compiled code in C++/C# etc, using locals and avoiding globals will often results in the compiler generating faster code for you because it can rely on just the small set of local variables changing not anything and everything.

      Phew,
      Adam

      posted in Developers' Forum
      AdamBA
      AdamB
    • RE: Component processor usage...

      Not strictly the case... but I know what you're saying..

      Broadly there are 3 things that take time in graphics:

      1. Containers the geometry is inside
      2. The geometry itself
      3. The pixels that need to be drawn

      Working backward up the list:

      If you're model refreshes faster if you make the window smaller, the limiting factor for your computer is drawing pixels. You are what is known as "Fill-bound".
      If you find that as you subdivide a surface more and more but keep the window the same size, the refresh gets slower, the limiting factor is geometry. You are what is known as "Geometry-bound"

      Finally, there is a "fixed-cost" with opening each container of geometry (be it a group or component instance) in order to draw what is inside. Having 1 container with 100 polygons inside is much faster to draw than having 100 containers each with 1 polygon inside. There is a sweet spot for how finegrain you should create containers aka components/groups. Unfortunately it relates to how fast your graphics card is...but as a rough rule of thumb, a container of less than 20 odd faces is going to hurt your performance if you have lots of containers.

      The pathologically bad example of this is the standard SU beech tree which has a container for each leaf. This is a really bad idea and the modeller responsible will be taken out and shot when I'm ruler of the universe..but I digress. Much better to have a container/component with 40-50 leaves inside and still get the advantage of compactness with the advantage of keeping your graphics card busy.

      Adam

      posted in SketchUp Discussions
      AdamBA
      AdamB
    • RE: Barcelona Pavilion (Animation Added)

      @princedragoncok said:

      @adamb said:

      The discoloration is caused by 2 things.

      1. The handle goes through the body of the cup and is causing some bad normals on the inner surface - you'll see SU shading anomolies. Just delete the part of the handle inside the cup body.

      2. More importantly, the smoothing groups seem wrong. You want your surface normals on the outer side of the mug to be varying around the circumference of the mug but not vertically. This false color render of interpolated surface normal screenshot from LightUp shows the normals are being smooth around the bottom of the mug causing your odd shading. If the normals were 'right', the bottom of the mug would have a near constant normal facing down (as it does right in the center).

      Hmm this is interesting, but somewhat out of my realm of understanding. I should also say that I got the cup from the warehouse, so what you're saying might make more sense if i was the creator. But I do understand that you want a horizontal band, rather than vertical band of colour around the cup. So how badly is the render effected in Lightup in the end? Vray has discoloured it slightly but it's not detrimental to the final rendering. Is this the case in LightUp? Can LightUp adapt to cope with such 'bad normals' rather than the user having to make sure every component is composed of good normals?

      Hey its all just ones and zeros. Be that in LightUp, vray or anything else, the same applies - ie the renderer is going to take the input you give it and do its lighting thing. If that input is bad, you'll get a bad result. "Garbage in, garbage out" is the old adage with computers.

      Over many years of writing software I've come to conclusion that rather than try and second guess the user - by for example, ignoring the normals that are given and recalculating new ones that the software thinks are 'better' - its better to simply reflect what you're given.

      So, I would Explode the mug, and use the Smooth normals tool to reset the crease angle (say, 30 degrees), then regroup it and you should be good to go.

      Adam

      posted in Gallery
      AdamBA
      AdamB
    • RE: Barcelona Pavilion (Animation Added)

      @princedragoncok said:

      Here ya go: http://www.cgtextures.com/texview.php?id=4715&PHPSESSID=ed155963660e9c84e42204b0199a8376
      What do you reckon would make the cigarette and mug better? I see there is slight discoloration at the bottom of the mug - dunno why that is though

      The discoloration is caused by 2 things.

      1. The handle goes through the body of the cup and is causing some bad normals on the inner surface - you'll see SU shading anomolies. Just delete the part of the handle inside the cup body.

      2. More importantly, the smoothing groups seem wrong. You want your surface normals on the outer side of the mug to be varying around the circumference of the mug but not vertically. This false color render of interpolated surface normal screenshot from LightUp shows the normals are being smooth around the bottom of the mug causing your odd shading. If the normals were 'right', the bottom of the mug would have a near constant normal facing down (as it does right in the center).
        mugnormals2_lightup.jpg

      posted in Gallery
      AdamBA
      AdamB
    • RE: Barcelona Pavilion (redux)

      princedragoncok has kindly lent me his model to do some comparison shots with his vray rendered version (see here)

      Had a couple of problems with the model in LightUp. First thing that tripped me up was the stone desk its all sitting on - at around 2 kilometers by 1 kilometer in size (an allcomers record, surely) - it revealed a scale-dependant bug in LightUp. BTW Bug now fixed - with a commit revision number of 666 which made me smile!

      The scalpel was modeled using back faces, as was parts of the mobile phone. Easily fixed.

      I added a skybox too (which I think clashes a little...)

      Lighting time around 2 minutes. [Rendering time 33.3 milliseconds. πŸ˜‰ ie These are stills from a 30 frames/sec realtime tour]

      And here's the results:
      Ambient Occlusion only
      Ambient Occlusion with sunlight

      posted in Gallery
      AdamBA
      AdamB
    • RE: [Plugin] Memory Copy (xformclone.rb)

      Glad you like it.

      Feel free to slap me here but you did press return after typing the "5x" or whatever, didn't you.

      Adam

      posted in Plugins
      AdamBA
      AdamB
    • RE: [Plugin] Memory Copy (xformclone.rb)

      I decided to get it out the way. Here it is.

      1. Create an instance of component
      2. Duplicate and position a second instance
      3. Right click on first instance and choose "Play it again.."
      4. Now if you hover over any instance that is the same definition as your 'start' instance it will be highlighted.
      5. Left button to create a new instance.
      6. Type string of the form "123x" in the VCB to set the number of instances to create per left button click.
      7. Click away from geometry to exit tool

      Enjoy,
      Adam


      Stick it in your plugins folder

      posted in Plugins
      AdamBA
      AdamB
    • RE: [Plugin] Memory Copy (xformclone.rb)

      Yes, clear as mud... πŸ˜’

      I should have explained it was just me banging out some code while I finished my after lunch espresso, not some finished thang. More a proof of concept. Mea culpa.

      1. I'd left in a hardcoded '3' for the number of times to do the clone. It should be 1 (or perhaps read the VCB?)
      2. The plugin wrongly relies on an ordering of the SketchUp Selection buffer. ie Selection is an unordered group of stuff you've hilighted, but this v0.000001 of the plugin was presuming the first thing in the Selection was the first thing you selected - which as you've discovered is not true - and nor should it be either I hasten to add.

      So. I think I'll change it so you highlight an Instance, hover over another instance and right click - (ie an implicit second instance).

      But but I've got things to do.. but I'll try to get to it soon.

      Adam

      posted in Plugins
      AdamBA
      AdamB
    • RE: Barcelona Pavilion (redux)

      @princedragoncok said:

      Hi Adam, I'd be interested to see how close a result lightUp can achieve when compared to v-ray. So if you'd like my model I'd be happy to give it to you for the experiment. Provided it came out comparable, I could touch it up in windows movie maker and make a nice video for your gallery. Let me know

      Yes, sound like an interesting/fun experiment. But bare in mind vray and LU are not equivalent - they merely overlap somewhere. πŸ˜„
      This 1 minute render is the result of LU performing around 45,000,000 ray tests, single bounce and store results. Vray does it differently.

      Also - while I'm in 'caveat mode' - LU currently struggles with some kinds of curved surfaces - which v1.3 should address to a greater or lesser degree. I see your model has a bunch of stuff that might be 'interesting' for LU. Coincidently, I'm actually working on the code for that right now.

      So do we meet at checkpoint Charlie at midnight and swap models? πŸ˜„

      @princedragoncok said:

      Also does LightUp support HDRI's?

      All the calculations are in done in a HDR space and then mapped back down to RGB at the end. So to that degree, yes. But as to importing HDR images/textures etc, no, not currently.

      Adam

      posted in Gallery
      AdamBA
      AdamB
    • RE: [Plugin] Memory Copy (xformclone.rb)

      Had a quick go..and now I've got to go!

      But basically it works just fine - put this code in a file in your plugins folder, select the first object, add another instance to the selection (this only works for Components) and right click and select "Play it again.."

      So the only wrinkle is it tries to update the selection to the last 2 things it created so you can repeatedly right click but its screwing up.

      Anyone want to point out my schoolboy error, feel free to ritually humiliate me. πŸ˜„

      def xformclone(num)
      	first = Sketchup.active_model.selection[0]
      	second = Sketchup.active_model.selection[1]
      	
      	if (num > 0) and (first.definition == second.definition)
      		delta = second.transformation * (first.transformation.inverse)
      		
      		Sketchup.active_model.start_operation("xform & clone")
      
      		ctm = second.transformation
      		curr = second
      		num.times do
      			ctm = ctm * delta
      			curr = curr.parent.entities.add_instance(first.definition, ctm)
      			first = second
      			second = curr
      		end
      		
      		Sketchup.active_model.commit_operation
      		
      		Sketchup.active_model.selection.clear
      		Sketchup.active_model.selection.add [first,second]
      	end
      end
      
      UI.add_context_menu_handler do |menu|
      	menu.add_separator
      	menu.add_item("Play it again..") { xformclone(3)}
      end 
      
      posted in Plugins
      AdamBA
      AdamB
    • RE: [Plugin] Memory Copy (xformclone.rb)

      Perhaps simpler still is to select 2 instances and the script subtracts the transforms to find the difference and just applies that repeatedly to Nx new instances.

      Adam

      posted in Plugins
      AdamBA
      AdamB
    • Barcelona Pavilion (redux)

      Seeing all these renders of the Barcelona Pavilion made me give it a whirl in LightUp.

      Lighting time was 1 minute 5 seconds. I've also posted a youtube vid here
      too but the video encoding they do hasn't done it any favors on both color or resolution.

      barcelona_google_lightup.jpg

      EDIT: I've posted the model + textures I used on the LightUp website if you want to have a go.

      posted in Gallery
      AdamBA
      AdamB
    • RE: [REQ] Material Modifier

      Completely do-able but its a hammer to crack a nut.

      Why not just export the image and convert the image to grayscale?

      Adam

      posted in Plugins
      AdamBA
      AdamB
    • 1
    • 2
    • 36
    • 37
    • 38
    • 39
    • 40
    • 46
    • 47
    • 38 / 47