Custom Buttons for 3D Interaction?
how can set button change 3d tool using javascript?
as example, have button i've made change zoom tool. i'd click on , have 3d tool change default spin tool zoom tool.
i've tried couple different things having no luck. appreciated.
thanks!
-ted
as example, have button i've made change zoom tool. i'd click on , have 3d tool change default spin tool zoom tool.
i've tried couple different things having no luck. appreciated.
thanks!
-ted
yo zero,
here's hunk of code want. should know when acrobat processes 3d annotations, there 2 javascript engines running: document-level engine (escript) , 3d-specific engine (extendscript). there reasons this. regardless, there api's present allow 2 talk each other page-annot interaction.
this hunk of code shorter (very much) left little verbose give idea of what's going on.
//==============================
//get index of page containing annot3d object (count starts @ 0)
var pageindex = this.pagenum;
//index of annot3d (count starts @ 0)
var annotindex = 0;
//get annot object
var a3d = getannots3d(pageindex)[annotindex];
console.println("a3d = " + a3d);
//now forcibly activate
a3d.activated = true;
console.println("a3d.activated = " + a3d.activated);
//get reference annot3d script context
var c3d = a3d.context3d;
console.println("c3d = " + c3d);
//set 3d tool 3d api 'runtime' object global properties , methods
c3d.runtime.setcurrenttool(c3d.runtime.tool_name_zoom);
console.println("c3d = " + c3d);
//==============================
here's hunk of code want. should know when acrobat processes 3d annotations, there 2 javascript engines running: document-level engine (escript) , 3d-specific engine (extendscript). there reasons this. regardless, there api's present allow 2 talk each other page-annot interaction.
this hunk of code shorter (very much) left little verbose give idea of what's going on.
//==============================
//get index of page containing annot3d object (count starts @ 0)
var pageindex = this.pagenum;
//index of annot3d (count starts @ 0)
var annotindex = 0;
//get annot object
var a3d = getannots3d(pageindex)[annotindex];
console.println("a3d = " + a3d);
//now forcibly activate
a3d.activated = true;
console.println("a3d.activated = " + a3d.activated);
//get reference annot3d script context
var c3d = a3d.context3d;
console.println("c3d = " + c3d);
//set 3d tool 3d api 'runtime' object global properties , methods
c3d.runtime.setcurrenttool(c3d.runtime.tool_name_zoom);
console.println("c3d = " + c3d);
//==============================
More discussions in Rich Media & 3D
adobe
Comments
Post a Comment