Skip to content

Instantly share code, notes, and snippets.

View JohnOnSoftware's full-sized avatar
🏠
Working from home

Zhong Wu JohnOnSoftware

🏠
Working from home
  • Autodesk
  • Shanghai, China
View GitHub Profile
@JohnOnSoftware
JohnOnSoftware / InViewerSearch.js
Last active December 11, 2016 03:34
Forge Viewer InViewerSearch Extension Raw
var config3d = {
extensions: ["Autodesk.InViewerSearch"],
inViewerSearchConfig: {
uiEnabled: true,
clientId: "adsk.forge.default",
sessionId: "Session-ID-example-F969EB70-242F-11E6-BDF4-0800200C9A66",
loadedModelTab: {
enabled: true, //if false we hide the tab
displayName: 'This View',
pageSize: 50
@JohnOnSoftware
JohnOnSoftware / UVEditorContextSample.cpp
Last active November 17, 2016 07:59
UVEditorContextSample
#include <maya/MFnPlugin.h>
#include <maya/MIOStream.h>
#include <maya/MStatus.h>
#include <maya/MEvent.h>
#include <maya/MGlobal.h>
#include <maya/MItSelectionList.h>
#include <maya/MFnSingleIndexedComponent.h>
#include <maya/MDagPath.h>
#include <maya/MFn.h>
#include <maya/MFnMesh.h>
@JohnOnSoftware
JohnOnSoftware / XGenForArnold.cpp
Last active February 22, 2024 09:45
Core code to support XGen Interactive Grooming in Arnold
MFnDagNode fnDagNode(m_dagPath);
// Apply the render overrides
static const MString sApplyRenderOverrideCmd = "xgmSplineApplyRenderOverride ";
MGlobal::executeCommand(sApplyRenderOverrideCmd + fnDagNode.partialPathName());
// Stream out the spline data
std::string data;
MPlug outPlug = fnDagNode.findPlug("outRenderData");
MObject outObj = outPlug.asMObject();
@JohnOnSoftware
JohnOnSoftware / ViewingApplication.js
Created November 2, 2016 03:24 — forked from leefsmp/ViewingApplication.js
Forge Viewing Application
var options = {
env: 'AutodeskProduction',
getAccessToken: function (onGetAccessToken) {
// Asynchronous request from your app to request
// access token from your server ...
yourAppGetAccessTokenAsync(function (tokenResponse) {
onGetAccessToken (
tokenResponse.access_token,