I tried to create my first plugin which sets Shadows and should set camera. I wanted to do it so that I call the function toggleCamera but no change of camera I could see. Also I tried to add paranthesis but this also did not work. I am not sure if this is valid to return instance on line 6?
def toggleCamera
eye = [1000,1000,1000]
target = [0,0,0]
up = [0,0,1]
return Sketchup::Camera.new eye, target, up
end;
def barr_shadows
Sketchup.active_model.start_operation "Barracuda Shadows"
si = Sketchup.active_model.shadow_info
si["Light"] = 85;
si["Dark"] = 45;
### value = si["ShadowTime"]=Time.local(2017, 7, 21, 14);
value = si["ShadowTime"]=Time.gm(2017, 7, 21, 14, 00);
si["TZOffset"] = -1.0;
UI.messagebox value
si["EdgesCastShadows"] = false;
si["DisplayShadows"] = true;
Sketchup.active_model.commit_operation
return
end
barracuda_shadows = UI.menu("Plugins")
if not (file_loaded? "shadows.rb")
barracuda_shadows.add_item("Barracuda Shadows") { barr_shadows; view.camera = toggleCamera; }
end