Пример #1
0
 public void write(DataOutput buffer) throws IOException {
   super.write(buffer);
   clone.write(buffer);
   buffer.writeInt(curve != null ? curve.hashCode() : 0);
   mtex.write(buffer);
   buffer.writeInt(icon_imbuf != null ? icon_imbuf.hashCode() : 0);
   buffer.writeInt(preview != null ? preview.hashCode() : 0);
   buffer.write(icon_filepath);
   buffer.writeFloat(normal_weight);
   buffer.writeShort(blend);
   buffer.writeShort(ob_mode);
   buffer.writeInt(size);
   buffer.writeInt(flag);
   buffer.writeFloat(jitter);
   buffer.writeInt(spacing);
   buffer.writeInt(smooth_stroke_radius);
   buffer.writeFloat(smooth_stroke_factor);
   buffer.writeFloat(rate);
   for (int i = 0; i < rgb.length; i++) buffer.writeFloat(rgb[i]);
   buffer.writeFloat(alpha);
   buffer.writeInt(sculpt_plane);
   buffer.writeFloat(plane_offset);
   buffer.writeByte(sculpt_tool);
   buffer.writeByte(vertexpaint_tool);
   buffer.writeByte(imagepaint_tool);
   buffer.write(pad3);
   buffer.writeFloat(autosmooth_factor);
   buffer.writeFloat(crease_pinch_factor);
   buffer.writeFloat(plane_trim);
   buffer.writeFloat(height);
   buffer.writeFloat(texture_sample_bias);
   buffer.writeInt(texture_overlay_alpha);
   buffer.writeFloat(unprojected_radius);
   for (int i = 0; i < add_col.length; i++) buffer.writeFloat(add_col[i]);
   for (int i = 0; i < sub_col.length; i++) buffer.writeFloat(sub_col[i]);
 }
Пример #2
0
 public void read(ByteBuffer buffer) {
   super.read(buffer);
   clone.read(buffer);
   curve = DNATools.link(DNATools.ptr(buffer), CurveMapping.class); // get ptr
   mtex.read(buffer);
   icon_imbuf = DNATools.ptr(buffer); // get ptr
   preview = DNATools.link(DNATools.ptr(buffer), PreviewImage.class); // get ptr
   buffer.get(icon_filepath);
   normal_weight = buffer.getFloat();
   blend = buffer.getShort();
   ob_mode = buffer.getShort();
   size = buffer.getInt();
   flag = buffer.getInt();
   jitter = buffer.getFloat();
   spacing = buffer.getInt();
   smooth_stroke_radius = buffer.getInt();
   smooth_stroke_factor = buffer.getFloat();
   rate = buffer.getFloat();
   for (int i = 0; i < rgb.length; i++) rgb[i] = buffer.getFloat();
   alpha = buffer.getFloat();
   sculpt_plane = buffer.getInt();
   plane_offset = buffer.getFloat();
   sculpt_tool = buffer.get();
   vertexpaint_tool = buffer.get();
   imagepaint_tool = buffer.get();
   buffer.get(pad3);
   autosmooth_factor = buffer.getFloat();
   crease_pinch_factor = buffer.getFloat();
   plane_trim = buffer.getFloat();
   height = buffer.getFloat();
   texture_sample_bias = buffer.getFloat();
   texture_overlay_alpha = buffer.getInt();
   unprojected_radius = buffer.getFloat();
   for (int i = 0; i < add_col.length; i++) add_col[i] = buffer.getFloat();
   for (int i = 0; i < sub_col.length; i++) sub_col[i] = buffer.getFloat();
 }