sketchucation logo sketchucation
    • Login
    1. Home
    2. ymalaika
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Y
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Groups 1

    ymalaika

    @ymalaika

    10
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    ymalaika Unfollow Follow
    registered-users

    Latest posts made by ymalaika

    • Writing material thumbnails

      I'm using Material.write_thumbnail to create image files of materials but am running into a couple issues when materials have textures.

      First, it does not seem to take material colorization into account in the written thumbnail file.

      Second, it will fail if the texture thumbnail size is larger in pixelsize than the material texture. I can get around this one by checking the texture size first.

      Does anyone anyone happen to know a way around the first issue besides applying my own colorization?

      Thanks in advance.

      posted in Developers' Forum
      Y
      ymalaika
    • RE: Pushing and popping a tool works in many but not all cases

      I've decided to abandon the tool route. By running outside the tool stack I am able to change the view asynchronously, so the user can navigate without having to explicitly invoke or change tool modes. It's a much more fluid experience, and with the exception of a few minor cases that I think I can work around, it doesn't disrupt tool operation.

      Thank you for the useful tips, everyone. This is a really fantastic forum!

      posted in Developers' Forum
      Y
      ymalaika
    • Pushing and popping a tool works in many but not all cases

      Hello. I'm creating a camera manipulation tool and am looking to replicate this standard SketchUp behavior:

      If I am in the middle of a push/pull, and I activate the orbit tool, change the view, and then hit ESC to cancel, the original push/pull resumes operation at the state it was at. It also recovers to its previous state if from the view tool I directly reactivate push/pull using a hotkey, toolbar, or menu.

      One way I've found to do this is to call

      Sketchup.active_model.tools.push_tool( mynewToolObject )

      instead of

      Sketchup.active_model.select_tool( mynewToolObject )

      Curiously, this works as desired when using drawing tools like Rect, Line, etc., but not entirely for manipulation tools like push/pull, move, etc. For manipulation tools, if they are mid operation, push_tool() will return false and my tool never gets its activate() call. The manipulation doesn't get interrupted.

      If the manipulation tool is not dragging something, however, everything works as expected.

      I see there's a Tool.suspend() and Tool.resume(), but these appear to be more like onSuspend() and onResume(), meant for handling that external event when called by SU. It's way cleaner and better encapsulated if an individual Tool need not be aware of the stack it's in, and that appears to be the API intent...

      Does anyone have experience doing this or perhaps know of any other plugins that I should reference?

      Thanks in advance,

      -Y. Malaika

      posted in Developers' Forum
      Y
      ymalaika