≡
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: "Int?rnational"
(you are not logged in)
Text:
[quote][b]pmax[/b] wrote: searching the net I found a few examples and I tried to create a script. [code]var s = editorGetSelectedSceneNode(); var position = ccbGetSceneNodeProperty(s, "Position"); function snap(value, gridSize, roundFunction) { if (roundFunction === undefined) roundFunction = Math.round; return gridSize * roundFunction(value / gridSize); } 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(); [/code] Select an object and run the script. PS: Translation by Google[/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