Initial testing on the mac works too, though there's no need to copy the instructor files to the temp directory on a mac
Posts
-
RE: Instructor content
-
RE: Instructor content
@thomthom said:
@bentleykfrog said:
In the snippet you posted earlier, doesn't parts = origin.split( File::SEPERATOR ).size include the separator in the drive name (ie. C:/), so you get x+1 slashes to the root C:/ from helpcontent instead of x, which negates the /tool folder?
That is a possibility... I might very well be wrong about where it base the path from. But the positive side-effect of my little bug is that it works.
Its definitely a positive side effect, and consistent across OS's as macs start with '/' instead of 'C:/'
@thomthom said:
With PHP formatting:
PHP & escape characters == no love (not even with double escaping), which sucks with Regex. From my experience there's no telling how many processes a php string has been through on a forum post (ie. as written in your own code or copy-and-paste from another website/forum) so I think the php code goes on the singular escape and doesn't bother to check for doubles, which is wrong even if you're formatting php code. I suppose since sketchucation is in php, they've at least got to make the code mute to prevent some pretty easy hacking, by formatting php code as a string. (I'll stop here since its way off topic)
-
RE: Instructor content
@chris fullmer said:
Sorry Dan, you lost me at "APPDATA". I never knew there was an alternate folder schema somewhere. I'm really not sure what appdata is.
+1 on this, sorry for the confusion dan
Time to make a fool out of myself for a second time:
@thomthom said:
@chris fullmer said:
That worked for me, are you guys seeing differently?
The snippet I posted work for me when I added it to Bezier Tools as a working example. I generate a relative path from
Sketchup.get_resource_path( 'helpcontent' )
In the snippet you posted earlier, doesn't
parts = origin.split( File::SEPERATOR ).size
include the separator in the drive name (ie. C:/), so you get x+1 slashes to the root C:/ from helpcontent instead of x, which negates the/tool
folder?Also, just to double-check, is there meant to be an escaping character for w in
/^w:/
(ie./^\w:/
) or is something weird going on?sorry for the noob questions, I really appreciate the responses.
-
RE: Instructor content
@dan rathbun said:
PC:
VER = Sketchup.version.to_i USER_PLUGINS = File.expand_path("#{ENV['APPDATA']}\Google\Google SketchUp #{VER}\SketchUp\Plugins")
Sorry for the late reply Dan, but on my Windows 7 machine there's no Sketchup Folder, ie.
USER_PLUGINS = File.expand_path("#{ENV['APPDATA']}\Google\Google SketchUp #{VER}\Plugins")
would work. -
RE: Instructor content
This returns the eraser tool on my system.
def getInstructorContentDirectory return "\\21019\\" end
Its a long way around but I'm thinking that it would be possible to write the required files and folders to the /temp/ folder on the C:/ drive before the tool loads, then use a relative path to the /temp/instructor/ directory in
getInstructorContentDirectory
. This would avoid the volume traversal problem but I think it would be a bit of a headache. -
RE: Instructor content
@thomthom said:
Yea, if we have to specify a path relative to a fixed one we're restrained to the drive the fixed path originates from.
(unless someone can show of a neat trick around that...?)Ohhhh!!!! Just tested, Volume traversal on a mac!
plugin_path = File.dirname (__FILE__) root_dir_entries = Dir.entries(plugin_path+"/../../../../../../Volumes/") puts root_dir_entries
Hmm, if I save a model on my primary hard drive (the hard drive that my user folder is set on and sketchup is installed on) and run
model_path = Sketchup.active_model.path
in the Ruby console I get the following path:/Users/[my user name]/Desktop/Untitled.skp
. But if I save to another drive I get/Volumes/[drive namespace (not the letter)]/Untitled.skp
.Will have to check on pc.
-
RE: Instructor content
@kirill2008 said:
Does anyone know how to find out how many slashes and dots are needed at certain end user comp ("..\..\..\..\"). I mean if someone has installed sketchup in a custom subdirectory it is necessary to add/remove one of "..\" I guess.
I think that because its relative to [sketchup folder]/Resources/[language]/helpcontent/tool/ that it shouldn't matter where sketchup is installed, as this will be constant. The parent directory "..\" folder just goes back through tool -> helpcontent -> [language] -> resources to get you to the base [sketchup folder].
@thomthom said:
And because some OSX users put their plugins in the user folder instead of the default, one can never rely to plugins to be at a fixed relative path.
You're right this is a huge issue. I'm guessing that on OSX this path will be relative to the main library folder (ie. [primary hard drive]/Library/Application Support/[sketchup folder]/Sketchup/Resources/[language]/helpcontent/tool/). So maybe you can do some comparison between
Sketchup.find_support_file "[some_file].html", "Tools/[your_plugin]/"
and the main library location, like this:def getInstructorContentDirectory plugin_folder = Sketchup.find_support_file test_file.html, "Tools/My Plugin/" plugin_folder = plugin_folder.split("test_file.html") plugin_folder_array = plugin_folder[0].split("/") if(plugin_folder_array[1] == "Library") #so the plugin/tool is stored in the main library return "../../../../Tools/My Plugin/Instructor/" elsif (plugin_folder_array[1] == "Program Files" || plugin_folder_array[1] == "Program Files (x86)") #the operating system is PC, so only 1 location for tools/plugins #there's probably a better way to do this return "../../../../Tools/My Plugin/Instructor/" else #not sure about this, especially since it could be traversing drives return "../../../../../../../../../"+plugin_folder+"Instructor/" end end
I'm not sure about the OSX support, but I'll check after I'm finished with my work on the PC.
What do you guys think?
-niall
-
RE: Instructor content
@thomthom said:
@dan rathbun said:
Another example of how the API docs (and a poorly written example,) have thrown us all off course for months!
It does smell like a bug though. It doesn't sound right that they intended people to add custom Instructor content to the SU Instructor content folder.
Its unusual that they document absolute paths but only go with relative paths, not that relative paths are bad by any means.
-
RE: Instructor content
hmmmm the following works well on pc too
def getInstructorContentDirectory return "../../../../Tools/etc/instructor/" end
-
RE: Instructor content
seems like the response is relative to the help directory on pc
writing the following brings up the eraser tool
def getInstructorContentDirectory return "\\21019\\" end
so looks like relative paths it is
-
RE: Let's have a Hardware speed test for SU
Wow, some unusual results here. I've had some discrepancy between Sketchup v.8.0.4811 and Sketchup v.7.1.6860
Under v.7.1.6860 I got:
But under v.8.0.4811 I got:
After some troubleshooting, I found that disabling "Enable Transparency" in the Styles window gave this result in v.8.0.4811:
Its unusual, I disabled "Enable Transparency" under 7.1.6860 and there was no noticable difference in the animations performance, but this is different for 8.0.4811. I'm not sure what is going on here but for consistency in results I think the style in the file should be updated to disable the transparency.Here's my stats:
Mac Pro (1,1) with a modified 8 core x5355 @ 2.66 GHz (2 processors)
16gb DDR2 ECC ram
Ati Radeon HD 5770 (apple version)
SATA II
Windows 7 Ultimate 64bit -
RE: Alternative to angle_between?
Also, as a bit of a bodge to fix the 50/50 direction problem
vector_90 = Geom;;Vector3d.new(vector_90[0].abs,vector_90[1].abs,vector_90[2].abs)
Its probably not efficient, or even tested
-
RE: Alternative to angle_between?
Sorry for digging up another old topic, here's my not-so-rough guess at a long way around.
angle1 = black_vector.angle_between red_vector vector_cross = black_vector.cross red_vector vector_90 = black_vector.cross vector_cross angle2 = vector_90.angle_between red_vector angle1 = (Math;;PI-angle1) + Math;;PI if angle2 >= (Math;;PI/2)
-
RE: Optimization Tips
@dany67300 said:
It takes me about 2 s to create 400 pieces, and it's growing exponentially. With 600 pieces -> 7s, 1200 pcs -> 50s...
Is it normal to take so much time ? Each domino is created in his own group for the moment, but it doesn't change if I create them directly in my scene.I've noticed that sketchup slows down greatly once the number of groups in the current tier is greater than 1000 on my machine. Does your script speed up if the geometry is written straight to
Sketchup.active_model.entities
? -
RE: Prevent model degrading to wireframe while orbiting, zooming
@unknownuser said:
This kicks in way too early - often on models that the camera could previously easily orbit, zoom without degradation - is there a way to disable it or adjust the settings?
In the preferences dialog under OpenGL, disable "Use fast feedback" to stop components degrading to a wireframe representation of their bounding box on camera movement. Disabling this will also increase your view refresh time. I think that both "full_detail_render_delay_min" & "full_detail_render_delay_max" both relate to the fast feedback setting wrt wireframe bounding boxes? Regardless of the fast feedback setting, textures will still turn off and on based on the "full_detail_render_delay_min" & "full_detail_render_delay_max" settings.
-niall
-
RE: Preview - Sketchup Floating Camera [Update 2011-03-19]]
Thanks guys,
@pixero said:
It's however a little hard to see how it performs in the video.
Is the small jerkyness in movements also present without screen recording software?There's two issues causing the jerkyness in the movements. The first was the screen recording software that I used. I'll have to play around with some encoders until I get something acceptable. The second issue is the script itself. I've been putting off optimising the code until now and there are a few measures that I can try to improve the performance of the script. There's also some boundingbox degrading that Sketchup does naturally when you modify the
Sketchup.max_draw_time
to something below what your system can handle, but I haven't been able to replicate this when the script is running.@pixero said:
I especially liked when the camera walked down the stairs. I though I saw some damping in the movement.
Heh, thanks. The unusual way that the camera walks down the stairs in the video is due to the speed set on the camera (20km/h). This speed is equivalent to a quick jog down the stairs so you see some unusual movements at this speed. I've noticed that in some video games the camera moves up stairs even faster than this, and I think they use some hidden smooth ramp to make sure the camera moves in a nice fashion. I'll have to modify some of the dampening to mirror this, but its a bit complex.
-
RE: Preview - Sketchup Floating Camera [Update 2011-03-19]]
Afternoon All,
I've been hard at work on the Floating Camera for the last week, focusing on Camera Collision, Gravity (maintaining eye height), Camera Roll & FOV changes and User Customisation in controls and the camera settings. Its been a very long week!
Below is a rough draft showing off the camera features I've been working on. At the end there is also an example of Floating Camera -> Camera Recorder work flow.
[flash=800,480:a5jpqin3]http://www.youtube.com/v/vh-BOHdcK_Y[/flash:a5jpqin3]
There's still some bugs to work out before the release, and I need to reduce its load on the computer to an acceptable level. A beta release shouldn't be far off though.
The features not shown include:
- Look customisation (finite|infinite rotation)
- Look x & y sensitivity
- Maximum speed
- Camera Inertia
- Collision Buffer Zone
- Lock vertical movements
- Maintain Camera Upright
- User customisable controls
-
RE: Work completed
excellent to see some beautiful work completed in sketchup, normally I get far to side-tracked to finish something off.
-
RE: Getting normal to cylinder face
@tig said:
Try
adjusted_normal=face.normal.transform!(group.transformation)
where 'group' is the container of the circle-'face' on the end?Sorry for digging up an old topic, but will this work with nested groups/component instances?
normal = entity.normal i = 0 path_to_entity.each {|entity| i +=1 break if i >= path_to_entity.length normal = normal.transform! (entity.transformation) }
Or does transform represent a transformation from the models axes? (ie, just require
normal = normal.transform! (entity.transformation)
Just for background, I'm trying to get a model based vector of the face normal as in peterjohnson84's example
-
RE: Getting normal to cylinder face
Just answered my own question, transformation is relative to the parent.
Here's some more compact code:
normal = entity.normal for i in (0..(path_to_entity.length-2)) do e = intersect_path[i] normal = normal.transform! (e.transformation) end