Fixed in 14.1.1282. Thanks.
Latest posts made by Marginal
-
RE: Face.position_material SketchUp 2014 regression
-
RE: [Plugin] UVEditor 0.30
@squidcap said:
Empty screen, nothing on Ruby console. That is if you are using default Sketchup textures. Import your own and it works.
...
Took me a while to figure this out. Hope it helps
Thanks. I can reproduce the problem with default textures in a model that's never been saved. Will be fixed in the next release.@greenskp said:
Works great but a bit confusing see vertex and edges because the image texture repeats a lot and the uv is not highlighted.
I agree usability isn't as good as I'd like.
You can turn on "Hidden Geometry" to view the UVs of just Faces you're interested in. Or am I misunderstanding your issue?@charly2008 said:
With internet explorer 10 I get this message.
I can't reproduce this on Sketchup 8, Windows 7 64bit, IE10 (which I think is your setup). And the error message is useless. Does this occur with all models that you've tried, or just sometimes? -
RE: Face.position_material SketchUp 2014 regression
@tt_su said:
I'm logging this bug internally.
Thanks. -
Face.position_material SketchUp 2014 regression
Here's a weird one.
Under SketchUp 2014.0.4900 a (caught) exception generated by a call to Face.position_material appears to cause SketchUp to unwind everything back to the last Model.start_operation. It's as if SketchUp is internally calling Model.abort_operation (but no ModelObserver.onTransactionAbort is generated).
Example code:
Sketchup.active_model.start_operation('Do stuff', true) entities = Sketchup.active_model.active_entities f1 = entities.add_face([[0,0,1.m], [10.m,0,1.m], [0,10.m,1.m]]) f2 = entities.add_face([[10.m,10.m,1.m], [10.m,0,1.m], [0,10.m,1.m]]) material = Sketchup.active_model.materials.add("MyMaterial") material.texture = "/path/to/some/texture/on/your/disk.png" begin f1.position_material(material, [[0,0,0],[0,0,1], [0,10.m,1.m],[0,0,1], [10.m,0,1.m],[0,0,1]], true) # bogus texture layout rescue ArgumentError => e p "Oops #{e.inspect}" end f2.position_material(material, [[10.m,10.m,1.m],[1,1,1], [10.m,0,1.m],[1,0,1], [0,10.m,1.m],[0,1,1]], true) Sketchup.active_model.commit_operation
Under SketchUp 8 & 2013 this creates two triangles, the second of which is textured. The console says:
"Oops #<ArgumentError; Could not compute valid matrix from points>"
Under SketchUp 2014, no triangles are created and the console says:
"Oops #<ArgumentError; Could not compute valid matrix from points>" Error; #<TypeError; reference to deleted Face
It's as if the operation was aborted - the material and Face f1 have been deleted.
Weirdly, if I remove the start_operation and commit_operation calls the code behaves correctly (but naturally clutters up the Undo stack).
Has anyone seen anything like this before, and can anyone suggest a workaround?
(I could perhaps convert the faces to be textured into a PolygonMesh, use PolygonMesh.set_uv, and convert back again. But this implies deleting and re-creating the Faces which seems ugly).
-
RE: [Plugin] UVEditor 0.30
I've updated the initial post with version 0.30 which implements Rotate, Scale, exporting UV coordinates, and Project from View. Plus some optimisations and fixes.
Hopefully I've fixed the issues that many people are having on Windows. If you still don't see anything appear in the "UV Editor" window when you select faces, please look in the Ruby Console window: This version prints out the URL of the texture file that it's sending to the UV Editor window. Please let me know if you don't see this, or if it is incorrect. (If it is correct you should be able to copy and paste it into IE's address bar and have IE display the texture file).
Thanks to Aerilius for the code review. I don't have PM privileges so I'll answer here. I've addressed most of your comments, except the following:
- I can't use Point3d's built-in rounding when comparing coordinates - it's way too coarse for UV co-ordinates which have values typically in the range 0->1.
- I have to provide my own version of basename because I need to ensure that the texture file is present in the filesystem and not just embedded in the SketchUp model. And it's possible for the SketchUp model to contain embedded textures with Mac-style pathnames on a PC, and vice versa.
-
RE: [Plugin] UVEditor 0.30
I've edited the first post to clarify system requirements, namely:
SketchUp 8 or later. MacOS 10.5 or later, or Windows XP or later with IE 9 or later.And to upload a new version:
- Fix for texture not appearing in UV Editor window on Windows.
- UV Editor window stays on top.
Please let me know if you're still having trouble getting started.
@jeff hammond said:
it seems like it would take a really long time to edit the uvs so all the texture lines match up in this example.. but again, i'm probably overlooking a scenario where it's useful or not as complicated.
I'd envisaged it being useful for tweaking the position of textures that have already been projected.But I'm starting to think that to be truly useful it's going to have to support a range of unwrapping and projection tools. (I looked at ThruPaint and, as far as I can tell, it doesn't offer these).
-
[Plugin] UVEditor 0.30
The tools that SketchUp offers for texturing Faces have their good points and bad points.
Good:-
When using Texture → Position it's easy to understand and visualise what's going on.
-
Once someone has pointed you to a video (like this one) explaining how it works, projecting textures is a powerful technique.Bad:
-
Texture → Position only works on single Faces.
-
Whether positioning textures on a single Face or projecting a texture across many Faces, it's difficult to get really accurate positioning - e.g. the pixel or sub-pixel accuracy that's required when using a texture atlas.
This plugin aims to address the above "Bad" points by offering a traditional UV Editor. It's loosely inspired by Blender's "UV/Image Editor", but with a SketchUp user interface and interaction model. Here's a screen shot of it in action:
Requirements: SketchUp 8 or later. MacOS 10.5 or later, or Windows XP or later with IE 9 or later.
Quick start:
-
Download and install the plugin in the usual way:
-
Mac: choose SketchUp → Preferences → Extensions → Install Extension
-
Windows: choose Windows → Preferences → Extensions → Install Extension
-
Re-start SketchUp if upgrading from an older version of this plugin.* Use Tools → UV Editor to display the "UV Editor" window.
-
Select one or more Faces in the main SketchUp window; the "UV Editor" window shows the UV assignments of the selected faces. Note: Because the "UV Window" only shows one texture at a time, only those faces that use the same texture file are shown.
-
Use the mouse wheel or zoom gesture in the "UV Editor" window as desired to focus on the UV assignments of interest to you.
-
In the "UV Editor" window select one or more UV points, and use the "Move", "Rotate" or "Scale" tool to adjust them.
Other features:
-
The "Export UV layout" button in the "UV Editor" window saves a PNG with the selected faces' UV coordinates outlined in it. You can use these outlines to help paint your texture.
-
The plugin provides a toolbar which currently has two buttons:
-
UV Editor window: This just does the same thing as the Tools → UV Editor menu option.
-
Project UVs from View: This provides an alternative to SketchUp's built-in texture projection - the texture is projected from the current camera view rather than from a plane. (This is similar to Blender's "Project From View" feature).I hope to add more projection and unwrapping choices in future.
This is an alpha release - it's functional but missing some features:
Rotate and Scale tools not implemented.- Numeric input not implemented.
- No manual (but context-sensitive help is shown in the status bar).
- No support for
projecting orunwrapping (but other built-in tools and 3rd-party plugins support unwrapping).
I'm publishing this as an alpha because I'm looking for feedback:
- Is this kind of tool useful?
- Is there an existing tool that does this better?
- Is it easy to use?
- What functionality is missing?
- etc.
Finally, thanks to those who have posted guidance and code snippets in the Developers forum, especially to thomthom for his Sketchup WebDialogs - The Lost Manual.
-