3DCoatScripting  4.8.31Ξ²
Π‘ ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ скриптинга ΠΌΠΎΠΆΠ½ΠΎ ΡƒΠΏΡ€Π°Π²Π»ΡΡ‚ΡŒ возмоТностями ΠšΠΎΡƒΡ‚Π° ΠΈ Ρ€Π°ΡΡˆΠΈΡ€ΡΡ‚ΡŒ Π΅Π³ΠΎ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π».
πŸŒ€ Доступ ΠΊ устройствам Π²Π²ΠΎΠ΄Π°

Из скрипта Ρ‚Ρ‹ моТСшь ΠΏΠΎΠ»ΡƒΡ‡Π°Ρ‚ΡŒ Π΄Π°Π½Π½Ρ‹Π΅ ΠΎ Π½Π°ΠΆΠΈΠΌΠ°Π΅ΠΌΡ‹Ρ… ΠΊΠ»Π°Π²ΠΈΡˆΠ°Ρ… Π½Π° ΠΊΠ»Π°Π²ΠΈΠ°Ρ‚ΡƒΡ€Π΅, Ρ‰Π΅Π»Ρ‡ΠΊΠ°Ρ… ΠΌΡ‹ΡˆΠΈ ΠΈΠ»ΠΈ стилуса ΠΈ Ρ€Π΅Π°Π³ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Π½Π° Π½ΠΈΡ… Π½ΡƒΠΆΠ½Ρ‹ΠΌ Ρ‚Π΅Π±Π΅ способом. Как это ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ?

ΠŸΡ€ΠΎΡΡ‚ΠΎΠΉ ΠΏΡ€ΠΈΠΌΠ΅Ρ€:

// доступ ΠΊ ΠΎΡ‚Π»Π°Π΄ΠΊΠ΅
Debug dbg;
DebugLog log = dbg.log();
void main() {
// ΠΎΡ‡ΠΈΡ‰Π°Π΅ΠΌ Π»ΠΎΠ³-Ρ„Π°ΠΉΠ»
log.clear();
for( int i = 0; i < 1000; i++ ) {
float x = GetMouseX();
float y = GetMouseY();
// ΠΏΠ΅Ρ‡Π°Ρ‚Π°Π΅ΠΌ Π² Π»ΠΎΠ³-Ρ„Π°ΠΉΠ» ΠΊΠΎΠΎΡ€Π΄ΠΈΠ½Π°Ρ‚Ρ‹ ΠΌΡ‹ΡˆΠΈ ΠΊΠ°ΠΆΠ΄Ρ‹Π΅ 50 мс
log += "mouse coord " + x + " " + y;
Wait( 50 );
}
}

Π§Ρ‚ΠΎΠ±Ρ‹ ΡƒΠ²ΠΈΠ΄Π΅Ρ‚ΡŒ, Ρ‡Ρ‚ΠΎ ΠΆΠ΅ Π½Π°ΠΏΠ΅Ρ‡Π°Ρ‚Π°Π»ΠΎΡΡŒ Π² Π»ΠΎΠ³, Π²Ρ‹Π±Π΅Ρ€ΠΈ Π² мСню 3DCoat "Π‘ΠΊΡ€ΠΈΠΏΡ‚Ρ‹ / ΠŸΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ ΠΆΡƒΡ€Π½Π°Π» выполнСния".

ΠŸΠΎΡΠΌΠΎΡ‚Ρ€ΠΈ ΠΈ Π½Π° эти Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ:

// Get current mouse coordinate X.
DEPRECATED float GetMouseX()
// Get current mouse coordinate Y.
DEPRECATED float GetMouseY()
// Get pen pressure.
DEPRECATED float GetPressure()
// Check if LMB pressed.
DEPRECATED bool LMBPressed()
// Check if RMB pressed.
DEPRECATED bool RMBPressed()
// Check if MMB pressed.
DEPRECATED bool MMBPressed();
// Get visible (in screen projection) radius of the brush.
DEPRECATED float GetVisiblePenRadius();
// Start drawing stroke at point (x,y) with some pressure.
// \param Pressure In diapason [ 0.0 (without pressure); 1.0 (maximum pressure) ].
DEPRECATED void StartStroke(float x,float y,float Pressure)
// Draw stroke to point (x,y) with some pressure.
// \param Pressure In diapason [ 0.0 (without pressure); 1.0 (maximum pressure) ].
DEPRECATED void DrawStrokeTo(float x,float y,float Pressure)
// After that command stroke will be actually drawn.
// Set of commands StartStroke. DrawStrokeTo should be
// terminated by EndStroke.
DEPRECATED void EndStroke()
// True when object presents by ray (x,y).
DEPRECATED bool ScreenRayPicksObject(float x,float y)
// Was widget with identifier ID recently (within last Time sec) pressed?
DEPRECATED bool WasRecentlyPressed(string &in ID,float Time);
// Was widget with identifier ID recently (within last Time sec)
// pressed via RMB?
DEPRECATED bool WasRecentlyRMBPressed(string &in ID,float Time);
// Is user in tool identified as ID? To get current tool
// identifier press RMB + MMB over empty field.
DEPRECATED bool IsInTool(string &in ToolID);
// Get active tool ID.
DEPRECATED string GetCurrentToolID ();
// Get time (sec) since script started.
DEPRECATED float GetTimeSinceStart();