≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Script Snap to grid
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b][/b] wrote: I tried it in the Windows scripting and It works fantastic!! Thanks. But I wonder why this dosn't work as a plugin: [code]function snap(value, gridSize, roundFunction){ if (roundFunction === undefined) roundFunction = Math.round; return gridSize * roundFunction(value / gridSize); } var s = editorGetSelectedSceneNode(); var position = ccbGetSceneNodeProperty(s, "Position"); var moveobjX = snap(position.x,5); var moveobjY = snap(position.y,5); var moveobjZ = snap(position.z,5); ccbSetSceneNodeProperty(s,"Position",moveobjX,moveobjY,moveobjZ); ccbUpdateSceneNodeBoundingBox(s); editorUpdateAllWindows(); editorRegisterMenuEntry("snap()", "Snap to grid\tCtrl+M");[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact