Some questions about the Freehand Sketch tool

Next
 From:  pior (PIOR_O)
9606.1 
Hello Michael and all -

In V4 beta, is there any way to make freehand sketch curves be drawn on the surface of objects ? I understand that I can draw them in an ortho view and then project accordingly, but this involves many "flow breaking" steps. By that I mean that ideally, there should be no need to juggle between viewport and resort to extra tools.

Here is an example of what can be done by relying on an ortho view :




This is fine for this case but it still requires some juggling of views and tools which ideally I would like to avoid.

And here is an example where the current paradigm is quite limiting - attempting to sketch details following changes of surface direction :




As you can see on the bottom capture the sketched lines end up on the grid rather than on the object itself even though Object snap is on. This could be okay if there was a way to project these ground sketches back into the object according to the current 3D viewport but it seems like the Project tools only allows for directions based on the scene axis. Unless I am missing something ?

I'd welcome any suggestion that may help with this workflow. At a high level, said workflow is basically to be able to work with the least amount of view switching and twitchy camera adjustments, favoring what I would call a steady and stable relationship between the user and the viewport : "If I can draw it from this angle, I shouldn't have to draw it from another".

(On a side note, is there a way to append the "repeat" option to a shortcut for the Freehand Sketch tool ?)

EDITED: 5 Dec 2019 by PIOR_O


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9606.2 
FWIW, one workaround I've found so far is to rely on Create Point, and clicking multiple times in Repeat mode to sketch using dots which do snap well to the surface of objects. It works alright but of course but it very far from the fluidity of freehand sketching :



Also, temporarily changing the CPlane seems to be a decent option too. It really seems like the functionality to sketch on the surface of objects is almost there but not quite ...

Lastly : is there any way to set specific objects so that they do not get picked up by Object snapping ? This would be useful when drawing the final/clean curves on top of the sketched ones.

EDITED: 5 Dec 2019 by PIOR_O


Image Attachments:
Size: 162.4 KB, Downloaded: 19 times, Dimensions: 853x524px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9606.3 In reply to 9606.1 
Hi Pior,

re:
> In V4 beta, is there any way to make freehand sketch curves be drawn on the surface of objects ?

Sorry, no the sketch curve tool currently always draws on the construction plane. So one method though like you mention is to set the construction plane to your surface first before using it.


> (On a side note, is there a way to append the "repeat" option to a shortcut for the Freehand Sketch tool ?)

Not by appending it, but it is possible to make a shortcut that sets it and then launches the Sketch command, that would be like this:

script: /* Sketch curve with repeat */ moi.ui.sidePane.RepeatCheckbox.value = true; moi.command.execCommand( 'SketchCurve' );


> Lastly : is there any way to set specific objects so that they do not get picked up by
> Object snapping ? This would be useful when drawing the final/clean curves on top of
> the sketched ones.

If you turn off the option for snapping to locked objects under Options > Snaps > Object snap options > "Snap to locked objects" checkbox then you can use Edit > Lock for this purpose.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  pior (PIOR_O)
9606.4 
Hello Michael, thank you for another lighting fast reply.

Thank you for the shortcut, this makes total sense. Is there an official place somewhere listing all these script classes, and maybe even an inventory of useful commands like this one ? Sure enough it would help power users quite a bit (as opposed to having to ask here on the forum). This page could even be accessible directly from the Shortcut Keys option panel for instance.

On my end I am currently putting the finishing touches to a floating panel grouping all my needed commands using <moi:LabelButton command="commandname"></moi> tags, in a simple index.htm called through moi.ui.createDialog. Also with a search box, meaning that all tools are just two keystrokes away (for instance typing "tr" filters for Trim) :



So naturally I'd be curious to know if there a way to call a complex command like this "sketch repeat" script from the html code. This is what I meant by appending it to a button, if that makes sense :) This would basically allow me to store custom commands without necessarily having to assign them to KB shortcuts.

[edit] Ha, nevermind ! Found it : <moi:LabelButton onclick="scriptgoeshere"></moi:LabelButton>

Lastly a follow-up question on CPlane : is there a clever way to select a surface, then click a button/run a command and have the CPlane be instantly placed on there and aligned to said surface ? As opposed to having to launch CPlane and then picking the center point and setting the orientation manually each time.

"Snap to locked objects" turned off is excellent, that does it indeed :)

Thanks !

EDITED: 5 Dec 2019 by PIOR_O

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9606.5 In reply to 9606.4 
Hi Pior,

re:
> Is there an official place somewhere listing all these script classes, and maybe even
> an inventory of useful commands like this one ?

There is a collection of scripts used in buttons in the help file here:
http://moi3d.com/3.0/docs/moi_command_reference11.htm#shortcutkeys

And there are some other frequently requested ones collected here:
http://kyticka.webzdarma.cz/3d/moi/


> This page could even be accessible directly from the Shortcut Keys option
> panel for instance.

In the future I would like to make an online "script repository" that would hold a bunch of scripts listed in different categories and have a browser for them built into MoI but there will be a lot of work involved in making that so I'm not sure when it will be able to happen.


> So naturally I'd be curious to know if there a way to call a complex command like this "sketch repeat"
> script from the html code. This is what I meant by appending it to a button, if that makes sense :)
> This would basically allow me to store custom commands without necessarily having to assign them
> to KB shortcuts.

Yes, on a <moi:CommandButton> element instead of having a command="commandname" attribute instead put in an onclick="" event handler attribute which can contain general script code. So for the sketch repeat it would look like this:
code:
<moi:CommandButton onclick="moi.ui.sidePane.RepeatCheckbox.value = true; moi.command.execCommand( 'SketchCurve' );">Button label</moi:CommandButton>

(Looks like you found that already...)

> Lastly a follow-up question on CPlane : is there a clever way to select a surface, then
> click a button/run a command and have the CPlane be instantly placed on there and
> aligned to said surface ? As opposed to having to launch CPlane and then picking the
> center point and setting the orientation manually each time.

A couple of v4 betas back there were some new methods added to faces that allow scripts to retrieve information on the face so it is possible to do that. Here's a script that will set the cplane to a selected planar face:

script: /* Set cplane to selected face */ var faces = moi.geometryDatabase.getSelectedObjects().getFaces(); if ( faces.length == 1 ) { var f = faces.item(0); if ( f.isPlanar ) { moi.view.setCPlane( f.planarFrame ); } }

Hope that helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
9606.6 In reply to 9606.5 
Quasi automatic CPplane
This last one is some cool! :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
9606.7 
PS
CPlane's Script above...Not Undoable ?

EDITED: 6 Dec 2019 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9606.8 In reply to 9606.7 
Hi Pilou, you can right-click on the View > CPlane button to reset the cplane to the default world location. Or if you want to have it on a shortcut key put:

script: moi.view.resetCPlane();

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
9606.9 In reply to 9606.8 
Thx for the precision! ;)
Added to the French site :)
http://moiscript.weebly.com/plan-aux.html
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9606.10 In reply to 9606.7 
Hi Pilou, or this variation will work as a toggle, if you use the same shortcut a second time it should reset it:

script: /* Set cplane to selected face or reset on second use */ var faces = moi.geometryDatabase.getSelectedObjects().getFaces(); var was_set = false; if ( faces.length == 1 ) { var f = faces.item(0); var cp = moi.view.getCPlane(); var vm = moi.vectorMath; if ( f.isPlanar ) { var p = f.planarFrame; if ( !(vm.pointsAreEqual(p.origin,cp.origin) && vm.pointsAreEqual(p.xaxis,cp.xaxis) && vm.pointsAreEqual(p.yaxis,cp.yaxis)) ) { moi.view.setCPlane( p ); was_set = true; } } } if ( !was_set ) moi.view.resetCPlane();

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
9606.11 In reply to 9606.10 
Excellent! Added! :)

EDITED: 6 Dec 2019 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Marc (TELLIER)
9606.12 
Ooh, I like this script !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  nameless
9606.13 In reply to 9606.10 
Perfect!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All