Forum

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Py4D - the official page » Py4D Developer Forum » SDK Support » Auto Tool Script help

Pages: [1]
Author Topic: Auto Tool Script help
ScottA
Member
Posts: 18
Post Auto Tool Script help
on: July 25, 2010, 18:42
Quote

I noticed that the python tag gets called when the mouse rolls over an object’s axis. So I want to test this behavior out with a coffee script I have that automatically changes the tool when an object is selected.
Selecting objects in the scene don’t react live with coffee tags. But they do seem to work that way with Py4D tags. So I wanted to test this out with Py4D.

One of the problems I’m having is that I can’t find where the tool mode functions are listed for Move, Rotate and Scale in the docs.
All I can find is documentation on changing the object, axis, polygon, point, etc. modes.

Could anyone help me convert this simple Coffee code to Python?

var last_value;
  main(doc,op)
  {
    if (op->GetBit(BIT_ACTIVE) != last_value)
    {
  	last_value = op->GetBit(BIT_ACTIVE);
  	if (last_value) CallCommand(200000090); //GetRotateTool
    }
  }

Thanks
-ScottA

Sebastian
Member
Posts: 311
Post Re: Auto Tool Script help
on: July 25, 2010, 19:51
Quote

Hi ScottA,

please note, the Python Tag has a minor update bug in the current version of Py4D.
That means, even the tag should be updated in a scene change, it doesnt.

This will be fixed in the next version.

Cheers, Sebastian

ScottA
Member
Posts: 18
Post Re: Auto Tool Script help
on: July 25, 2010, 20:21
Quote

Ok. Thanks.

Could you please tell me how I can switch between the Move, Rotate, or Scale tool modes?

-ScottA

ScottA
Member
Posts: 18
Post Re: Auto Tool Script help
on: July 25, 2010, 22:04
Quote

Thanks,
I didn’t know that CallCommand() was supported. That will make life easier.

Unfortunately,
Having to scroll the time slider is the same problem in Coffee I was hoping to get around by using Py4D.
Foiled again. :-(

I guess I will have to stick with using my HUD trick.
If you drag an object from the OM to the HUD. It creates an icon that you can click on. And clicking it will act just like clicking the object in the OM and these kinds of scripts will execute without having to run the timeline.

I was hoping Py4D might make it possible for me to not need that workaround anymore. But I guess not.

-ScottA

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.3
Page loaded in: 0.058 seconds.
>